/kernel/branches/net/network/IPv4.inc |
---|
202,7 → 202,7 |
IPv4_input: ; TODO: implement handler for IP options |
; TODO2: add code for raw sockets |
DEBUGF 1,"IPv4_Handler, packet from: %u.%u.%u.%u ",\ |
DEBUGF 1,"IPv4_input, packet from: %u.%u.%u.%u ",\ |
[edx + IPv4_header.SourceAddress]:1,[edx + IPv4_header.SourceAddress + 1]:1,[edx + IPv4_header.SourceAddress + 2]:1,[edx + IPv4_header.SourceAddress + 3]:1 |
DEBUGF 1,"to: %u.%u.%u.%u\n",\ |
[edx + IPv4_header.DestinationAddress]:1,[edx + IPv4_header.DestinationAddress + 1]:1,[edx + IPv4_header.DestinationAddress + 2]:1,[edx + IPv4_header.DestinationAddress + 3]:1 |
595,7 → 595,7 |
align 4 |
IPv4_output: |
DEBUGF 1,"IPv4_create_packet: size=%u\n", ecx |
DEBUGF 1,"IPv4_output: size=%u\n", ecx |
cmp ecx, 65500 ; Max IPv4 packet size |
ja .too_large |
649,7 → 649,7 |
.arp_error: |
add esp, 4+4+4+2+2 |
.too_large: |
DEBUGF 1,"IPv4_create_packet: Failed\n" |
DEBUGF 1,"IPv4_output: Failed\n" |
sub edi, edi |
ret |
/kernel/branches/net/network/icmp.inc |
---|
227,24 → 227,24 |
; Look for an open ICMP socket |
mov esi, [edi] ; ipv4 source address |
mov ebx, net_sockets |
mov eax, net_sockets |
.try_more: |
; mov ax , [edx + ICMP_header.Identifier] |
; mov , [edx + ICMP_header.Identifier] |
.next_socket: |
mov ebx, [ebx + SOCKET.NextPtr] |
or ebx, ebx |
mov eax, [eax + SOCKET.NextPtr] |
or eax, eax |
jz .dump |
cmp [ebx + SOCKET.Domain], AF_INET4 |
cmp [eax + SOCKET.Domain], AF_INET4 |
jne .next_socket |
cmp [ebx + SOCKET.Protocol], IP_PROTO_ICMP |
cmp [eax + SOCKET.Protocol], IP_PROTO_ICMP |
jne .next_socket |
cmp [ebx + IP_SOCKET.RemoteIP], esi |
cmp [eax + IP_SOCKET.RemoteIP], esi |
jne .next_socket |
; cmp [esi + ICMP_SOCKET.Identifier], ax |
; cmp [eax + ICMP_SOCKET.Identifier], |
; jne .next_socket |
; call IPv4_dest_to_dev |
252,7 → 252,7 |
; je .dump |
; inc [ICMP_PACKETS_RX+edi] |
DEBUGF 1,"Found valid ICMP packet for socket %x\n", ebx |
DEBUGF 1,"Found valid ICMP packet for socket %x\n", eax |
pusha |
lea ecx, [eax + SOCKET.mutex] |