Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5584 → Rev 5580

/kernel/trunk/network/socket.inc
1160,7 → 1160,7
cmp dword[edx+8], 0
je .unbind
 
movzx edx, byte[edx + 12]
movzx edx, byte[edx + 9]
cmp edx, NET_DEVICES_MAX
ja .invalid
 
/kernel/trunk/network/IPv4.inc
569,7 → 569,6
; IPv4_output
;
; IN: eax = Destination IP
; ebx = device ptr (or 0 to let IP layer decide)
; ecx = data length
; edx = Source IP
; di = TTL shl 8 + protocol
864,7 → 863,6
; IPv4_route
;
; IN: eax = Destination IP
; ebx = outgoing device / 0
; edx = Source IP
; OUT: eax = Destination IP (or gateway IP)
; edx = Source IP
876,9 → 874,6
align 4
IPv4_route: ; TODO: return error if no valid route found
 
test ebx, ebx
jnz .got_device
 
cmp eax, 0xffffffff
je .broadcast
 
908,29 → 903,8
 
ret
 
.got_device:
; Validate device ptr and convert to device number
call NET_ptr_to_num4
cmp edi, -1
je .fail
 
mov edx, [IP_LIST + edi] ; Source IP
 
; Check if we should route to gateway or not
mov ebx, [IP_LIST + edi]
and ebx, [SUBNET_LIST + edi]
mov ecx, eax
and ecx, [SUBNET_LIST + edi]
je @f
mov eax, [GATEWAY_LIST + edi]
@@:
ret
 
.fail:
ret
 
 
 
;---------------------------------------------------------------------------
;
; IPv4_get_frgmnt_num
/kernel/trunk/network/icmp.inc
388,7 → 388,6
 
mov di, IP_PROTO_ICMP SHL 8 + 128 ; TTL
mov edx, [eax + IP_SOCKET.LocalIP]
mov ebx, [eax + IP_SOCKET.device]
mov eax, [eax + IP_SOCKET.RemoteIP]
call IPv4_output
jz .exit
/kernel/trunk/network/tcp_output.inc
504,7 → 504,6
 
mov ecx, esi
mov edx, [eax + IP_SOCKET.LocalIP] ; source ip
mov ebx, [eax + IP_SOCKET.device]
mov eax, [eax + IP_SOCKET.RemoteIP] ; dest ip
mov di, IP_PROTO_TCP shl 8 + 128
call IPv4_output
/kernel/trunk/network/tcp_subr.inc
287,7 → 287,6
push cx ebx
mov eax, [ebx + IP_SOCKET.RemoteIP]
mov edx, [ebx + IP_SOCKET.LocalIP]
mov ebx, [ebx + IP_SOCKET.device]
mov ecx, sizeof.TCP_header
mov di, IP_PROTO_TCP shl 8 + 128
call IPv4_output
373,7 → 372,6
mov eax, [edi]
mov ecx, sizeof.TCP_header
mov di, IP_PROTO_TCP shl 8 + 128
xor ebx, ebx ;;; fixme
call IPv4_output
jz .error
pop esi cx
/kernel/trunk/network/udp.inc
258,7 → 258,6
sub esp, 4 ; Data ptr will be placed here
push edx esi
mov edx, [eax + IP_SOCKET.LocalIP]
mov ebx, [eax + IP_SOCKET.device]
mov eax, [eax + IP_SOCKET.RemoteIP]
mov di, IP_PROTO_UDP shl 8 + 128
add ecx, sizeof.UDP_header