Rev 1281 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1281 | Rev 1299 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | ;; GNU GENERAL PUBLIC LICENSE ;; |
11 | ;; GNU GENERAL PUBLIC LICENSE ;; |
12 | ;; Version 2, June 1991 ;; |
12 | ;; Version 2, June 1991 ;; |
13 | ;; ;; |
13 | ;; ;; |
14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 15... | Line 15... | ||
15 | 15 | ||
Line 16... | Line 16... | ||
16 | $Revision: 1281 $ |
16 | $Revision: 1299 $ |
17 | 17 | ||
18 | struct SOCKET_head |
18 | struct SOCKET_head |
19 | .PrevPtr dd ? ; pointer to previous socket in list |
19 | .PrevPtr dd ? ; pointer to previous socket in list |
Line 739... | Line 739... | ||
739 | ; dd level, optname, optval, optlen |
739 | ; dd level, optname, optval, optlen |
740 | ; OUT: -1 on error |
740 | ; OUT: -1 on error |
741 | ; |
741 | ; |
742 | ; At moment, uses only pseudo-optname -2 for get last_ack_number for TCP. |
742 | ; At moment, uses only pseudo-optname -2 for get last_ack_number for TCP. |
743 | ; TODO: find best way to notify that send()'ed data were acknowledged |
743 | ; TODO: find best way to notify that send()'ed data were acknowledged |
- | 744 | ; Also pseudo-optname -3 is valid and returns socket state, one of TCB_*. |
|
744 | ; |
745 | ; |
745 | ;----------------------------------------------------------------- |
746 | ;----------------------------------------------------------------- |
746 | align 4 |
747 | align 4 |
747 | socket_get_opt: |
748 | socket_get_opt: |
Line 748... | Line 749... | ||
748 | 749 | ||
749 | cmp dword [edx], IP_PROTO_TCP |
750 | cmp dword [edx], IP_PROTO_TCP |
750 | jnz .unknown |
751 | jnz .unknown |
- | 752 | cmp dword [edx+4], -2 |
|
- | 753 | jz @f |
|
751 | cmp dword [edx+4], -2 |
754 | cmp dword [edx+4], -3 |
- | 755 | jnz .unknown |
|
752 | jnz .unknown |
756 | @@: |
753 | mov eax, [edx+12] |
757 | mov eax, [edx+12] |
754 | test eax, eax |
758 | test eax, eax |
755 | jz .fail |
759 | jz .fail |
756 | cmp dword [eax], 4 |
760 | cmp dword [eax], 4 |
Line 759... | Line 763... | ||
759 | stdcall net_socket_num_to_addr, ecx |
763 | stdcall net_socket_num_to_addr, ecx |
760 | test eax, eax |
764 | test eax, eax |
761 | jz .fail |
765 | jz .fail |
762 | ; todo: check that eax is really TCP socket |
766 | ; todo: check that eax is really TCP socket |
763 | mov ecx, [eax + SOCKET_head.end + IPv4_SOCKET.end + TCP_SOCKET.last_ack_number] |
767 | mov ecx, [eax + SOCKET_head.end + IPv4_SOCKET.end + TCP_SOCKET.last_ack_number] |
- | 768 | cmp dword [edx+4], -2 |
|
- | 769 | jz @f |
|
- | 770 | mov ecx, [eax + SOCKET_head.end + IPv4_SOCKET.end + TCP_SOCKET.state] |
|
- | 771 | @@: |
|
764 | mov eax, [edx+8] |
772 | mov eax, [edx+8] |
765 | test eax, eax |
773 | test eax, eax |
766 | jz @f |
774 | jz @f |
767 | mov [eax], ecx |
775 | mov [eax], ecx |
768 | @@: |
776 | @@: |