290,20 → 290,18 |
; No, it's just a regular IP packet, pass it to the higher protocols |
|
.handle_it: ; We reach here if packet hasnt been fragmented, or when it already has been re-constructed |
movzx eax, [edx + IPv4_header.VersionAndIHL] ; Calculate Header length by using IHL field |
and eax, 0x0000000f ; |
shl eax, 2 ; |
|
movzx esi, [edx + IPv4_header.VersionAndIHL] ; Calculate Header length by using IHL field |
and esi, 0x0000000f ; |
shl esi, 2 ; |
|
movzx ecx, [edx + IPv4_header.TotalLength] ; Calculate length of encapsulated Packet |
xchg cl , ch ; |
sub ecx, eax ; |
sub ecx, esi ; |
|
add eax, edx |
push eax |
|
mov esi, [edx + IPv4_header.SourceAddress] ; These values might be of interest to the higher protocols |
mov edi, [edx + IPv4_header.DestinationAddress] ; |
lea edi, [edx + IPv4_header.SourceAddress] ; make edi ptr to source and dest IPv4 address |
mov al , [edx + IPv4_header.Protocol] |
pop edx ; Offset to data (tcp/udp/icmp/.. Packet) |
add edx, esi ; make edi ptr to data |
|
cmp al , IP_PROTO_TCP |
je TCP_input |