Rev 1482 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1482 | Rev 1483 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; Version 2, June 1991 ;; |
13 | ;; Version 2, June 1991 ;; |
14 | ;; ;; |
14 | ;; ;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 16... | Line 16... | ||
16 | 16 | ||
Line 17... | Line 17... | ||
17 | $Revision: 1482 $ |
17 | $Revision: 1483 $ |
18 | 18 | ||
19 | 19 | ||
Line 72... | Line 72... | ||
72 | ; |
72 | ; |
73 | ;----------------------------------------------------------------- |
73 | ;----------------------------------------------------------------- |
74 | align 4 |
74 | align 4 |
75 | UDP_handler: |
75 | UDP_handler: |
Line 76... | Line 76... | ||
76 | 76 | ||
Line 77... | Line 77... | ||
77 | DEBUGF 1,"UDP_Handler, checksum:%x\n", [edx+UDP_Packet.Checksum]:4 |
77 | DEBUGF 1,"UDP_Handler, checksum:%x, size:%u\n", [edx+UDP_Packet.Checksum]:4, ecx |
78 | 78 | ||
79 | ; First validate, checksum: |
79 | ; First validate, checksum: |
Line 80... | Line 80... | ||
80 | cmp [edx + UDP_Packet.Checksum], 0 |
80 | cmp [edx + UDP_Packet.Checksum], 0 |
Line 81... | Line 81... | ||
81 | jz .no_checksum |
81 | jz .no_checksum |
82 | 82 | ||
83 | push ecx edx |
83 | push edx |
84 | 84 | ||
Line 85... | Line 85... | ||
85 | push esi |
85 | push esi |
Line 86... | Line 86... | ||
86 | push edi |
86 | push edi |
87 | mov esi, edx |
87 | mov esi, edx |
Line 88... | Line 88... | ||
88 | call UDP_checksum |
88 | call UDP_checksum |
Line 120... | Line 120... | ||
120 | ; I bind to, if the socket is opened with a destination IP address of |
120 | ; I bind to, if the socket is opened with a destination IP address of |
121 | ; 255.255.255.255 |
121 | ; 255.255.255.255 |
122 | cmp [eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], 0xffffffff |
122 | cmp [eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], 0xffffffff |
123 | je .ok1 |
123 | je .ok1 |
Line 124... | Line 124... | ||
124 | 124 | ||
125 | mov esi, [esp] |
125 | ; mov esi, [esp] ; start of data (ethernet header) |
126 | mov esi, [ebx + ETH_FRAME.Data + IPv4_Packet.SourceAddress] ; get the Source address from the IP Packet FIXME |
126 | ; mov esi, [esi + ETH_FRAME.Data + IPv4_Packet.SourceAddress] ; get the Source address from the IP Packet FIXME |
127 | cmp [eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], esi |
127 | cmp [eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], edi ;esi |
Line 128... | Line 128... | ||
128 | jne .try_more ; Quit if the source IP is not valid, check for more sockets with this IP/PORT combination |
128 | jne .try_more ; Quit if the source IP is not valid, check for more sockets with this IP/PORT combination |
129 | 129 | ||
Line 173... | Line 173... | ||
173 | mov [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], si |
173 | mov [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], si |
174 | inc [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.firstpacket] |
174 | inc [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.firstpacket] |
Line 175... | Line 175... | ||
175 | 175 | ||
Line -... | Line 176... | ||
- | 176 | jmp .ok2 |
|
176 | jmp .ok2 |
177 | |
Line 177... | Line 178... | ||
177 | 178 | ||
Line 178... | Line 179... | ||
178 | .checksum_mismatch: |
179 | .checksum_mismatch: |
Line 299... | Line 300... | ||
299 | adc dl, [esp+1+8] |
300 | adc dl, [esp+1+8] |
300 | adc dh, [esp+0+8] |
301 | adc dh, [esp+0+8] |
301 | adc dl, [esp+3+8] |
302 | adc dl, [esp+3+8] |
302 | adc dh, [esp+2+8] |
303 | adc dh, [esp+2+8] |
Line -... | Line 304... | ||
- | 304 | ||
303 | 305 | ||
304 | adc dl, byte[esi+UDP_Packet.Length+1] |
306 | adc dl, cl ; byte[esi+UDP_Packet.Length+1] |
Line 305... | Line 307... | ||
305 | adc dh, byte[esi+UDP_Packet.Length+0] |
307 | adc dh, ch ; byte[esi+UDP_Packet.Length+0] |
306 | 308 | ||
307 | ; Done with pseudoheader, now do real header |
309 | ; Done with pseudoheader, now do real header |