Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3697 → Rev 3698

/kernel/trunk/network/ARP.inc
55,10 → 55,9
 
ends
 
uglobal
align 4
uglobal
 
 
ARP_table rb NET_DEVICES_MAX*(ARP_TABLE_SIZE * sizeof.ARP_entry)
 
ARP_entries_num rd NET_DEVICES_MAX
/kernel/trunk/network/IPv4.inc
55,8 → 55,8
ends
 
 
uglobal
align 4
uglobal
 
IP_LIST rd NET_DEVICES_MAX
SUBNET_LIST rd NET_DEVICES_MAX
69,6 → 69,7
IP_packets_dumped rd NET_DEVICES_MAX
 
FRAGMENT_LIST rb MAX_FRAGMENTS * sizeof.FRAGMENT_slot
 
endg
 
 
/kernel/trunk/network/IPv6.inc
30,8 → 30,8
ends
 
 
uglobal
align 4
uglobal
 
IPv6:
.addresses rd 4*NET_DEVICES_MAX
/kernel/trunk/network/PPPoE.inc
23,8 → 23,11
ends
 
uglobal
align 4
 
PPPoE_SID dw ?
PPPoE_MAC dp ?
 
endg
 
;-----------------------------------------------------------------
/kernel/trunk/network/ethernet.inc
32,8 → 32,8
 
ends
 
iglobal
align 4
iglobal
 
ETH_BROADCAST dp 0xffffffffffff
endg
/kernel/trunk/network/icmp.inc
97,10 → 97,12
ends
 
 
uglobal
align 4
uglobal
 
ICMP_PACKETS_TX rd NET_DEVICES_MAX
ICMP_PACKETS_RX rd NET_DEVICES_MAX
 
endg
 
 
/kernel/trunk/network/loopback.inc
17,6 → 17,7
$Revision: 2891 $
 
iglobal
align 4
 
LOOPBACK_DEVICE:
 
/kernel/trunk/network/queue.inc
28,6 → 28,7
size dd ? ; number of queued packets in this queue
w_ptr dd ? ; current writing pointer in queue
r_ptr dd ? ; current reading pointer
mutex MUTEX
 
ends
 
44,9 → 45,23
 
macro add_to_queue ptr, size, entry_size, failaddr {
 
local .ok, .no_wrap
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_lock
popa
 
cmp [ptr + queue.size], size ; Check if queue isnt full
jae failaddr
jb .ok
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_unlock
popa
jmp failaddr
 
.ok:
inc [ptr + queue.size] ; if not full, queue one more
 
mov edi, [ptr + queue.w_ptr] ; Current write pointer (FIFO!)
58,10 → 73,14
jb .no_wrap
 
sub edi, size*entry_size
 
.no_wrap:
mov [ptr + queue.w_ptr], edi
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_unlock
popa
 
}
 
 
68,9 → 87,23
 
macro get_from_queue ptr, size, entry_size, failaddr {
 
local .ok, .no_wrap
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_lock
popa
 
cmp [ptr + queue.size], 0 ; any packets queued?
je failaddr
ja .ok
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_unlock
popa
jmp failaddr
 
.ok:
dec [ptr + queue.size] ; if so, dequeue one
 
mov esi, [ptr + queue.r_ptr]
89,6 → 122,11
 
pop esi
 
pusha
lea ecx, [ptr + queue.mutex]
call mutex_unlock
popa
 
}
 
macro init_queue ptr {
97,4 → 135,7
lea edi, [ptr + sizeof.queue]
mov [ptr + queue.w_ptr], edi
mov [ptr + queue.r_ptr], edi
 
lea ecx, [ptr + queue.mutex]
call mutex_init
}
/kernel/trunk/network/socket.inc
194,11 → 194,14
SOCKET_QUEUE_LOCATION = (SOCKETBUFFSIZE - SOCKET_QUEUE_SIZE*sizeof.socket_queue_entry - sizeof.queue)
 
uglobal
align 4
 
net_sockets rd 4
last_socket_num dd ?
last_UDP_port dw ? ; These values give the number of the last used ephemeral port
last_TCP_port dw ? ;
socket_mutex MUTEX
 
endg
 
 
614,8 → 617,9
.loop:
cmp [eax + TCP_SOCKET.t_state], TCPS_CLOSED
je .fail
cmp [eax + TCP_SOCKET.t_state], TCPS_SYN_SENT
jne .syn_received
cmp [eax + TCP_SOCKET.t_state], TCPS_ESTABLISHED
je .established
ja .fail
 
call SOCKET_block
jmp .loop
626,7 → 630,7
mov dword[esp+32], -1
ret
 
.syn_received:
.established:
mov dword[esp+32], 0
ret
 
/kernel/trunk/network/stack.inc
221,8 → 221,8
 
 
 
uglobal
align 4
uglobal
 
NET_RUNNING dd ?
NET_DRV_LIST rd NET_DEVICES_MAX
/kernel/trunk/network/udp.inc
27,10 → 27,12
ends
 
 
uglobal
align 4
uglobal
 
UDP_PACKETS_TX rd NET_DEVICES_MAX
UDP_PACKETS_RX rd NET_DEVICES_MAX
 
endg
 
 
114,6 → 116,7
;
;-----------------------------------------------------------------
align 4
diff16 "UDP packetgfgfgfgfs", 0, $
UDP_input:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: size=%u\n", ecx