Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3907 → Rev 3908

/kernel/branches/Kolibri-acpi/network/ARP.inc
293,7 → 293,7
DEBUGF DEBUG_NETWORK_VERBOSE, "ARP_input: IP address conflict detected!\n"
 
.exit:
call kernel_free
call NET_packet_free
add esp, 4 ; pop (balance stack)
 
DEBUGF DEBUG_NETWORK_VERBOSE, "ARP_input: exiting\n"
/kernel/branches/Kolibri-acpi/network/IPv4.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; IPv4.INC ;;
305,7 → 305,7
.dump:
DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: dumping\n"
inc [IP_packets_dumped] ; FIXME: use correct interface
call kernel_free
call NET_packet_free
add esp, 4 ; pop (balance stack)
ret
 
485,7 → 485,7
push edx ; Push pointer to fragment onto stack
mov ebx, [edx + FRAGMENT_entry.Owner] ; we need to remeber the owner, in case this is the last packet
mov edx, [edx + FRAGMENT_entry.NextPtr] ; Set edx to the next pointer
call kernel_free ; free the previous fragment buffer (this uses the value from stack)
call NET_packet_free ; free the previous fragment buffer (this uses the value from stack)
pop eax
cmp edx, -1 ; Check if it is last fragment in chain
jne .rebuild_packet_loop
845,7 → 845,7
add esp, 12 + 4 + 6
.err2:
DEBUGF DEBUG_NETWORK_VERBOSE, "Ipv4_fragment: dumping\n"
call kernel_free
call NET_packet_free
add esp, 4
 
ret
/kernel/branches/Kolibri-acpi/network/PPPoE.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2012-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; PPPoE.INC ;;
103,7 → 103,7
popa
 
DEBUGF DEBUG_NETWORK_VERBOSE, 'PPPoE_discovery_input: dumping\n'
call kernel_free
call NET_packet_free
add esp, 4
ret
 
229,7 → 229,7
 
.dump:
DEBUGF DEBUG_NETWORK_VERBOSE, "PPPoE_input: dumping\n"
call kernel_free
call NET_packet_free
add esp, 4
ret
 
/kernel/branches/Kolibri-acpi/network/ethernet.inc
82,7 → 82,7
 
.dump:
DEBUGF DEBUG_NETWORK_VERBOSE,"ETH_input: dumping\n"
call kernel_free
call NET_packet_free
add esp, 4
ret
 
/kernel/branches/Kolibri-acpi/network/icmp.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 ;;
;; ;;
;; ICMP.INC ;;
304,7 → 304,7
.dump:
DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input: dumping\n"
 
call kernel_free
call NET_packet_free
add esp, 4 ; pop (balance stack)
 
ret
/kernel/branches/Kolibri-acpi/network/loopback.inc
97,7 → 97,7
 
.dump:
DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: dumping\n"
call kernel_free
call NET_packet_free
add esp, 4
ret
 
/kernel/branches/Kolibri-acpi/network/socket.inc
754,15 → 754,15
; Ok, we got a socket ptr
mov eax, [esi]
 
; Convert it to a socket number
call SOCKET_ptr_to_num
jz .invalid ; FIXME ?
 
; Change thread ID to that of the current thread
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov [eax + SOCKET.TID], ebx
 
; Convert it to a socket number
call SOCKET_ptr_to_num
jz .invalid ; FIXME ?
 
; and return it to caller
mov [esp+32], eax
ret
871,6 → 871,9
test edi, MSG_DONTWAIT
jnz .return_err
 
test [eax + SOCKET.state], SS_CANTRCVMORE
jnz .return_err
 
; test [eax + SOCKET.options], SO_NONBLOCK
; jnz .return_err
 
926,7 → 929,7
rep movsd
.nd:
 
call kernel_free ; free kernel buffer
call NET_packet_free
pop eax ; return number of bytes copied to application
xor ebx, ebx
ret
1565,7 → 1568,7
call mutex_unlock
popa
 
call kernel_free
call NET_packet_free
add esp, 8
 
ret
1891,8 → 1894,7
shl ecx, 8
or [ecx + SLOT_BASE + APPDATA.event_mask], EVENT_NETWORK
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Raised a network event!\n"
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", eax
jmp .done
 
.unblock:
2049,6 → 2051,7
; SOCKET_free
;
; Free socket data memory and remove socket from the list
; Caller should lock and unlock socket_mutex
;
; IN: eax = socket ptr
; OUT: /
2059,11 → 2062,6
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: %x\n", eax
 
pusha
mov ecx, socket_mutex
call mutex_lock
popa
 
call SOCKET_check
jz .error
 
2109,12 → 2107,6
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: success!\n"
 
.error:
 
pusha
mov ecx, socket_mutex
call mutex_unlock
popa
 
ret
 
;------------------------------------
2149,7 → 2141,8
pop eax
 
; Copy structure from current socket to new
; We start at PID to preserve the socket num, and the 2 pointers at beginning of socket
; We start at PID to preserve the socket num, 2 pointers and mutex
; TID will be filled in later
lea esi, [ebx + SOCKET.PID]
lea edi, [eax + SOCKET.PID]
mov ecx, (SOCKET_QUEUE_LOCATION - SOCKET.PID + 3)/4
2157,6 → 2150,12
 
and [eax + SOCKET.options], not SO_ACCEPTCON
 
; Notify owner of parent socket
push eax
mov eax, ebx
call SOCKET_notify
pop eax
 
ret
 
.fail2:
2322,9 → 2321,6
align 4
SOCKET_process_end:
 
pushf
cli ; FIXME
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_process_end: %x\n", edx
 
pusha
2351,11 → 2347,6
mov ebx, [ebx + SOCKET.NextPtr]
 
pusha
mov ecx, socket_mutex
call mutex_unlock
popa
 
pusha
cmp [eax + SOCKET.Domain], AF_INET4
jne .free
 
2370,12 → 2361,6
 
.closed:
popa
 
pusha
mov ecx, socket_mutex
call mutex_lock
popa
 
jmp .next_socket_test
 
.done:
2386,8 → 2371,6
call mutex_unlock
popa
 
popf
 
ret
 
 
/kernel/branches/Kolibri-acpi/network/stack.inc
316,7 → 316,12
ret
 
 
align 4
NET_packet_free:
and dword[esp+4], not 0xfff
jmp kernel_free
 
 
align 4
NET_link_changed:
 
613,7 → 618,7
align 4
sys_network:
 
cmp ebx, -1
cmp bl, 255
jne @f
 
mov eax, [NET_RUNNING]
/kernel/branches/Kolibri-acpi/network/tcp_input.inc
69,7 → 69,7
inc [TCP_segments_missed + edi]
 
add esp, sizeof.TCP_queue_entry - 8
call kernel_free
call NET_packet_free
add esp, 4
 
ret
1455,10 → 1455,9
jnz @f
 
test ecx, ecx
jnz .final_processing
jz .final_processing
@@:
 
 
; The segment is in order?
mov eax, [edx + TCP_header.SequenceNumber]
cmp eax, [ebx + TCP_SOCKET.RCV_NXT]
1491,6 → 1490,8
 
.out_of_order:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP data is out of order\n"
 
; Uh-oh, some data is out of order, lets call TCP reassemble for help
 
call TCP_reassemble
1622,7 → 1623,7
.dumpit:
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: dumping\n"
 
call kernel_free
call NET_packet_free
add esp, 4
jmp .loop
 
1695,6 → 1696,6
.drop_no_socket:
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: Drop (no socket)\n"
 
call kernel_free
call NET_packet_free
add esp, 4
jmp .loop
/kernel/branches/Kolibri-acpi/network/tcp_subr.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Part of the TCP/IP network stack for KolibriOS ;;
190,7 → 190,7
;;; TODO: update slow start threshold
 
call SOCKET_is_disconnected
call SOCKET_free
;; call SOCKET_free
 
ret
 
338,7 → 338,7
; Create the IP packet
 
push cx edx
mov ebx, [edi + 4]
mov edx, [edi + 4]
mov eax, [edi]
mov ecx, sizeof.TCP_header
mov di, IP_PROTO_TCP shl 8 + 128
/kernel/branches/Kolibri-acpi/network/udp.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; UDP.INC ;;
116,7 → 116,6
;
;-----------------------------------------------------------------
align 4
diff16 "UDP packetgfgfgfgfs", 0, $
UDP_input:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: size=%u\n", ecx
231,7 → 230,7
DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: checksum mismatch\n"
 
.dump:
call kernel_free
call NET_packet_free
add esp, 4 ; pop (balance stack)
DEBUGF DEBUG_NETWORK_VERBOSE,"UDP_input: dumping\n"