/kernel/branches/net/network/ARP.inc |
---|
162,7 → 162,7 |
align 4 |
ARP_input: |
DEBUGF 1,"ARP_Handler - start\n" |
DEBUGF 1,"ARP_input - start\n" |
cmp ecx, sizeof.ARP_header |
jb .exit |
172,7 → 172,7 |
cmp [edx + ARP_header.Opcode], ARP_REP_OPCODE |
jne .maybe_request |
DEBUGF 1,"ARP_Handler - it's a reply packet from %u.%u.%u.%u\n",\ |
DEBUGF 1,"ARP_input - it's a reply packet from %u.%u.%u.%u\n",\ |
[edx + ARP_header.SenderIP]:1, [edx + ARP_header.SenderIP+1]:1, [edx + ARP_header.SenderIP+2]:1, [edx + ARP_header.SenderIP+3]:1 |
mov ecx, [NumARP] |
192,12 → 192,12 |
jmp .exit |
.gotit: |
DEBUGF 1,"ARP_Handler - found matching entry\n" |
DEBUGF 1,"ARP_input - found matching entry\n" |
cmp [esi + ARP_entry.TTL], ARP_STATIC_ENTRY ; if it is a static entry, dont touch it |
je .exit |
DEBUGF 1,"ARP_Handler - updating entry\n" |
DEBUGF 1,"ARP_input - updating entry\n" |
mov [esi + ARP_entry.Status], ARP_VALID_MAPPING |
mov [esi + ARP_entry.TTL], ARP_ENTRY_TTL |
262,7 → 262,7 |
; mov ax , ETHER_ARP |
; stosw |
DEBUGF 1,"ARP_Handler - Sending reply \n" |
DEBUGF 1,"ARP_input - Sending reply \n" |
call [ebx + NET_DEVICE.transmit] |
ret |
271,7 → 271,7 |
call kernel_free |
add esp, 4 ; pop (balance stack) |
DEBUGF 1,"ARP_Handler - exiting\n" |
DEBUGF 1,"ARP_input - exiting\n" |
ret |
447,7 → 447,10 |
align 4 |
ARP_IP_to_MAC: |
DEBUGF 1,"ARP_IP_to_MAC\n" |
DEBUGF 1,"ARP_IP_to_MAC: %u.%u", al, ah |
rol eax, 16 |
DEBUGF 1,".%u.%u\n", al, ah |
rol eax, 16 |
cmp eax, 0xffffffff |
je .broadcast |
/kernel/branches/net/network/IPv4.inc |
---|
621,7 → 621,7 |
add ecx, sizeof.IPv4_header |
mov di , ETHER_IPv4 |
call ETH_output |
jz .error |
jz .eth_error |
add esp, 6 ; pop the mac |
644,12 → 644,20 |
DEBUGF 1,"IPv4 Packet for device %x created successfully\n", ebx |
ret |
.error: |
add esp, 6 |
.eth_error: |
DEBUGF 1,"IPv4_output: ethernet error\n" |
add esp, 6+2+4 |
sub edi, edi |
ret |
.arp_error: |
DEBUGF 1,"IPv4_output: ARP error (0x%x)\n", eax |
add esp, 4+4+4+2+2 |
sub edi, edi |
ret |
.too_large: |
DEBUGF 1,"IPv4_output: Failed\n" |
DEBUGF 1,"IPv4_output: error: Packet too large!\n" |
sub edi, edi |
ret |
/kernel/branches/net/network/tcp_input.inc |
---|
187,8 → 187,6 |
pop [eax + TCP_SOCKET.LocalPort] |
mov [eax + TCP_SOCKET.t_state], TCPS_LISTEN |
; mov [ebx + SOCKET.lock], 0 |
mov ebx, eax |
jmp .LISTEN |
477,7 → 475,7 |
;;; TODO: check if it's a broadcast or multicast, and drop if so |
push dword [edi + 4] ; Ipv4 destination addres |
push dword [edi] ; Ipv4 source addres |
pop [ebx + IP_SOCKET.RemoteIP] |
push [edx + TCP_header.SourcePort] |
/kernel/branches/net/network/tcp_output.inc |
---|
424,7 → 424,7 |
mov eax, [eax + IP_SOCKET.RemoteIP] ; dest ip |
mov di, IP_PROTO_TCP shl 8 + 128 |
call IPv4_output |
jz .fail |
jz .ip_error |
;----------------------------------------- |
; Move TCP header from stack to TCP packet |
527,7 → 527,7 |
ret |
.fail: |
.ip_error: |
pop ecx |
add esp, ecx |
pop eax |
538,7 → 538,7 |
call mutex_unlock |
popa |
DEBUGF 1,"TCP_output: failed\n" |
DEBUGF 1,"TCP_output: IP error\n" |
ret |