Rev 2305 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2305 | Rev 2308 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | ;; GNU GENERAL PUBLIC LICENSE ;; |
14 | ;; GNU GENERAL PUBLIC LICENSE ;; |
15 | ;; Version 2, June 1991 ;; |
15 | ;; Version 2, June 1991 ;; |
16 | ;; ;; |
16 | ;; ;; |
17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 18... | Line 18... | ||
18 | 18 | ||
Line 19... | Line 19... | ||
19 | $Revision: 2305 $ |
19 | $Revision: 2308 $ |
20 | 20 | ||
21 | MAX_FRAGMENTS equ 64 |
21 | MAX_FRAGMENTS equ 64 |
Line 288... | Line 288... | ||
288 | 288 | ||
289 | ;------------------------------------------------------------------- |
289 | ;------------------------------------------------------------------- |
Line 290... | Line 290... | ||
290 | ; No, it's just a regular IP packet, pass it to the higher protocols |
290 | ; No, it's just a regular IP packet, pass it to the higher protocols |
- | 291 | ||
291 | 292 | .handle_it: ; We reach here if packet hasnt been fragmented, or when it already has been re-constructed |
|
292 | .handle_it: ; We reach here if packet hasnt been fragmented, or when it already has been re-constructed |
293 | |
293 | movzx eax, [edx + IPv4_header.VersionAndIHL] ; Calculate Header length by using IHL field |
294 | movzx esi, [edx + IPv4_header.VersionAndIHL] ; Calculate Header length by using IHL field |
- | 295 | and esi, 0x0000000f ; |
|
294 | and eax, 0x0000000f ; |
296 | shl esi, 2 ; |
295 | shl eax, 2 ; |
297 | |
296 | movzx ecx, [edx + IPv4_header.TotalLength] ; Calculate length of encapsulated Packet |
298 | movzx ecx, [edx + IPv4_header.TotalLength] ; Calculate length of encapsulated Packet |
297 | xchg cl , ch ; |
- | |
298 | sub ecx, eax ; |
- | |
299 | - | ||
Line 300... | Line 299... | ||
300 | add eax, edx |
299 | xchg cl , ch ; |
301 | push eax |
- | |
302 | 300 | sub ecx, esi ; |
|
303 | mov esi, [edx + IPv4_header.SourceAddress] ; These values might be of interest to the higher protocols |
301 | |
Line 304... | Line 302... | ||
304 | mov edi, [edx + IPv4_header.DestinationAddress] ; |
302 | lea edi, [edx + IPv4_header.SourceAddress] ; make edi ptr to source and dest IPv4 address |
305 | mov al , [edx + IPv4_header.Protocol] |
303 | mov al , [edx + IPv4_header.Protocol] |
Line 306... | Line 304... | ||
306 | pop edx ; Offset to data (tcp/udp/icmp/.. Packet) |
304 | add edx, esi ; make edi ptr to data |