Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3609 → Rev 3610

/kernel/trunk/network/IPv4.inc
575,10 → 575,11
 
push ecx eax edx di
 
cmp eax, 1 shl 24 + 127
je .loopback
call IPv4_route ; outputs device number in edi, dest ip in eax
 
call IPv4_route ; outputs device number in edi, dest ip in eax
test edi, edi
jz .loopback
 
call ARP_IP_to_MAC
test eax, 0xffff0000 ; error bits
jnz .arp_error
635,7 → 636,8
ret
 
.loopback:
mov dword [esp + 2], eax
mov dword [esp + 2], eax ; change source IP to dest IP
mov ecx, [esp + 10]
add ecx, sizeof.IPv4_header
mov edi, AF_INET4
call LOOP_output
875,7 → 877,11
and edx, [SUBNET_LIST+edi]
 
cmp ebx, edx
je .found_it
jne .next
 
DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_route: %u\n", edi
ret
 
.next:
add edi, 4
dec ecx
882,16 → 888,9
jnz .loop
 
.invalid:
xor edi, edi ; if none found, use device 1 as default ;;; FIXME
inc di
mov eax, [GATEWAY_LIST+4]
 
.found_it:
DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_route: %u\n", edi
ret
 
mov eax, [GATEWAY_LIST+4] ;;; FIXME
.broadcast:
xor edi, edi ;;;; FIXME
xor edi, edi ; if none found, use device 1 as default ;;;; FIXME
inc di
ret
 
/kernel/trunk/network/loopback.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; loopback.inc ;;
80,6 → 80,10
push ecx
push eax
 
inc [LOOPBACK_DEVICE.packets_rx]
add dword[LOOPBACK_DEVICE.bytes_rx], ecx
adc dword[LOOPBACK_DEVICE.bytes_rx + 4], 0
 
DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: size=%u\n", ecx
lea edx, [eax + 4]
mov eax, dword[eax]
102,7 → 106,7
;
; IN:
; ecx = packet size
; di = protocol
; edi = address family
;
; OUT: edi = 0 on error, pointer to buffer otherwise
; eax = buffer start
134,12 → 138,15
lea edx, [ecx + 4] ; Set edx to complete buffer size
mov ebx, LOOPBACK_DEVICE
 
.done:
inc [LOOPBACK_DEVICE.packets_tx]
add dword[LOOPBACK_DEVICE.bytes_tx], ecx
adc dword[LOOPBACK_DEVICE.bytes_tx + 4], 0
 
DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_output: ptr=%x size=%u\n", eax, edx
ret
 
.out_of_ram:
DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_output: failed\n"
DEBUGF DEBUG_NETWORK_ERROR, "LOOP_output: out of memory\n"
add esp, 4+4
xor edi, edi
ret