Changed some debug output messages (and their levels) in new stack.

Implemented a queue for incoming TCP segments.

git-svn-id: svn://kolibrios.org@3251 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-02-17 17:58:53 +00:00
parent 8fc51dbddb
commit 72f758c218
8 changed files with 145 additions and 84 deletions

View File

@ -111,7 +111,7 @@ local .loop, .next
jmp .done
.died:
DEBUGF 1,"Fragment slot timed-out!\n"
DEBUGF 2,"IPv4 Fragment slot timed-out!\n"
;;; TODO: clear all entry's of timed-out slot
jmp .next
@ -204,10 +204,10 @@ macro IPv4_checksum ptr {
align 4
IPv4_input: ; TODO: add IPv4 raw sockets support
DEBUGF 1,"IPv4_input, packet from: %u.%u.%u.%u ",\
DEBUGF 2,"IPv4_input, packet from: %u.%u.%u.%u ",\
[edx + IPv4_header.SourceAddress + 0]:1,[edx + IPv4_header.SourceAddress + 1]:1,\
[edx + IPv4_header.SourceAddress + 2]:1,[edx + IPv4_header.SourceAddress + 3]:1
DEBUGF 1,"to: %u.%u.%u.%u\n",\
DEBUGF 2,"to: %u.%u.%u.%u\n",\
[edx + IPv4_header.DestinationAddress + 0]:1,[edx + IPv4_header.DestinationAddress + 1]:1,\
[edx + IPv4_header.DestinationAddress + 2]:1,[edx + IPv4_header.DestinationAddress + 3]:1
@ -302,7 +302,7 @@ IPv4_input: ; TODO: add IPv4
DEBUGF 2,"IPv4_input: unknown protocol %u\n", al
.dump:
DEBUGF 2,"IPv4_input: dumping\n"
DEBUGF 1,"IPv4_input: dumping\n"
; inc [dumped_rx_count] ;;; TODO
call kernel_free
add esp, 4 ; pop (balance stack)
@ -408,11 +408,11 @@ IPv4_input: ; TODO: add IPv4
.count_bytes:
cmp [esi + FRAGMENT_entry.PrevPtr], edi
jne .destroy_slot_pop ; Damn, something screwed up, remove the whole slot (and free buffers too if possible!)
mov cx, [esi + sizeof.FRAGMENT_entry + IPv4_header.TotalLength] ; Add total length
mov cx, [esi + sizeof.FRAGMENT_entry + IPv4_header.TotalLength] ; Add total length
xchg cl, ch
DEBUGF 1,"IPv4_input: Packet size=%u\n", cx
add ax, cx
movzx cx, [esi + sizeof.FRAGMENT_entry + IPv4_header.VersionAndIHL] ; Sub Header length
movzx cx, [esi + sizeof.FRAGMENT_entry + IPv4_header.VersionAndIHL] ; Sub Header length
and cx, 0x000F
shl cx, 2
DEBUGF 1,"IPv4_input: Header size=%u\n", cx
@ -423,12 +423,12 @@ IPv4_input: ; TODO: add IPv4
jne .count_bytes
mov esi, [esp+4]
mov [edi + FRAGMENT_entry.NextPtr], esi ; Add this packet to the chain, this simplifies the following code
mov [edi + FRAGMENT_entry.NextPtr], esi ; Add this packet to the chain, this simplifies the following code
mov [esi + FRAGMENT_entry.NextPtr], -1
mov [esi + FRAGMENT_entry.PrevPtr], edi
mov [esi + FRAGMENT_entry.Owner], ebx
mov cx, [edx + IPv4_header.TotalLength] ; Note: This time we dont substract Header length
mov cx, [edx + IPv4_header.TotalLength] ; Note: This time we dont substract Header length
xchg cl, ch
DEBUGF 1,"IPv4_input: Packet size=%u\n", cx
add ax, cx
@ -613,23 +613,23 @@ IPv4_output:
IPv4_checksum edi
add edi, sizeof.IPv4_header
DEBUGF 1,"IPv4_output: success!\n"
DEBUGF 2,"IPv4_output: success!\n"
ret
.eth_error:
DEBUGF 1,"IPv4_output: ethernet error\n"
DEBUGF 2,"IPv4_output: ethernet error\n"
add esp, 3*4+2+6
xor edi, edi
ret
.arp_error:
DEBUGF 1,"IPv4_output: ARP error=%x\n", eax
DEBUGF 2,"IPv4_output: ARP error=%x\n", eax
add esp, 3*4+2
xor edi, edi
ret
.too_large:
DEBUGF 1,"IPv4_output: Packet too large!\n"
DEBUGF 2,"IPv4_output: Packet too large!\n"
xor edi, edi
ret
@ -712,7 +712,7 @@ IPv4_output_raw:
IPv4_checksum edi ;;;; todo: checksum for IP packet with options!
add edi, sizeof.IPv4_header
DEBUGF 1,"IPv4_output_raw: device=%x\n", ebx
DEBUGF 2,"IPv4_output_raw: device=%x\n", ebx
call [ebx + NET_DEVICE.transmit]
ret
@ -721,7 +721,7 @@ IPv4_output_raw:
.arp_error:
add esp, 8+4+4
.too_large:
DEBUGF 1,"IPv4_output_raw: Failed\n"
DEBUGF 2,"IPv4_output_raw: Failed\n"
sub edi, edi
ret

View File

@ -83,7 +83,7 @@ macro IPv6_init {
align 4
IPv6_input:
DEBUGF 1,"IPv6_input from: %x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x\n",\
DEBUGF 2,"IPv6_input from: %x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x\n",\
[edx + IPv6_header.SourceAddress + 0]:2,[edx + IPv6_header.SourceAddress + 1]:2,\
[edx + IPv6_header.SourceAddress + 2]:2,[edx + IPv6_header.SourceAddress + 3]:2,\
[edx + IPv6_header.SourceAddress + 4]:2,[edx + IPv6_header.SourceAddress + 5]:2,\
@ -146,7 +146,7 @@ IPv6_input:
DEBUGF 2,"IPv6_input - unknown protocol: %u\n", al
.dump:
DEBUGF 2,"IPv6_input - dumping\n"
DEBUGF 1,"IPv6_input - dumping\n"
call kernel_free
add esp, 4
@ -166,7 +166,7 @@ IPv6_input:
; Hop-by-Hop
.hop_by_hop:
DEBUGF 2,"IPv6_input - hop by hop\n"
DEBUGF 1,"IPv6_input - hop by hop\n"
pushw [esi] ; 8 bit identifier for option type
movzx eax, byte[esi + 1] ; Hdr Ext Len
inc eax ; first 8 octets not counted
@ -195,7 +195,7 @@ IPv6_input:
.pad_n:
movzx eax, byte[esi + 1]
DEBUGF 2,"IPv6_input - pad %u\n", eax
DEBUGF 1,"IPv6_input - pad %u\n", eax
inc esi
inc esi
add esi, eax
@ -203,7 +203,7 @@ IPv6_input:
jmp .hop_by_hop
.pad_1:
DEBUGF 2,"IPv6_input - pad 1\n"
DEBUGF 1,"IPv6_input - pad 1\n"
inc esi
dec ecx
jmp .hop_by_hop
@ -211,11 +211,11 @@ IPv6_input:
.dest_opts:
DEBUGF 2,"IPv6_input - dest opts\n"
DEBUGF 1,"IPv6_input - dest opts\n"
jmp .nextheader
.routing:
DEBUGF 2,"IPv6_input - routing\n"
DEBUGF 1,"IPv6_input - routing\n"
pushw [esi] ; 8 bit identifier for option type
movzx eax, byte[esi + 1] ; Hdr Ext Len
inc eax ; first 8 octets not counted
@ -238,7 +238,7 @@ IPv6_input:
jmp .nextheader
.fragment:
DEBUGF 2,"IPv6_input - fragment\n"
DEBUGF 1,"IPv6_input - fragment\n"
jmp .nextheader

View File

@ -93,7 +93,7 @@ LOOP_input:
align 4
LOOP_output:
DEBUGF 1,"LOOP_output: "
DEBUGF 1,"LOOP_output\n"
push ecx
push di
@ -114,11 +114,11 @@ LOOP_output:
mov ebx, LOOPBACK_DEVICE
.done:
DEBUGF 1,"ptr=%x size=%u\n", eax, edx
DEBUGF 2,"LOOP_output: ptr=%x size=%u\n", eax, edx
ret
.out_of_ram:
DEBUGF 2,"error\n"
DEBUGF 2,"LOOP_output: failed\n"
add esp, 2+4
sub edi, edi
ret

View File

@ -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 ;;
@ -27,15 +27,15 @@ struct SOCKET
mutex MUTEX
PID dd ? ; application process id
Domain dd ? ; INET/UNIX/..
Domain dd ? ; INET/LOCAL/..
Type dd ? ; RAW/STREAM/DGRAP
Protocol dd ? ; ICMP/IPv4/ARP/TCP/UDP
errorcode dd ?
device dd ? ; driver pointer, socket pointer if it's an UNIX socket
device dd ? ; driver pointer, socket pointer if it's an LOCAL socket
options dd ?
state dd ?
backlog dw ? ; how many incomming connections that can be queued
backlog dw ? ; how many incoming connections that can be queued
snd_proc dd ?
rcv_proc dd ?
@ -183,7 +183,7 @@ ends
SOCKETBUFFSIZE = 4096 ; in bytes
SOCKET_QUEUE_SIZE = 10 ; maximum number ofincoming packets queued for 1 socket
SOCKET_QUEUE_SIZE = 10 ; maximum number of incoming packets queued for 1 socket
; the incoming packet queue for sockets is placed in the socket struct itself, at this location from start
SOCKET_QUEUE_LOCATION = (SOCKETBUFFSIZE - SOCKET_QUEUE_SIZE*sizeof.socket_queue_entry - sizeof.queue)
@ -279,7 +279,7 @@ sys_socket:
.number = ($ - .table) / 4 - 1
s_error:
DEBUGF 1,"socket error\n"
DEBUGF 2,"SOCKET: error\n"
mov dword [esp+32], -1
ret
@ -297,7 +297,7 @@ s_error:
align 4
SOCKET_open:
DEBUGF 1,"SOCKET_open: domain=%u type=%u protocol=%x\n", ecx, edx, esi
DEBUGF 2,"SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi
push ecx edx esi
call SOCKET_alloc
@ -305,6 +305,7 @@ SOCKET_open:
jz s_error
mov [esp+32], edi ; return socketnumber
DEBUGF 2,"socknum=%u\n", edi
mov [eax + SOCKET.Domain], ecx
mov [eax + SOCKET.Type], edx
@ -330,6 +331,7 @@ SOCKET_open:
je .pppoe
.no_ppp:
DEBUGF 2,"Unknown socket family/protocol\n"
ret
align 4
@ -402,7 +404,7 @@ align 4
align 4
SOCKET_bind:
DEBUGF 1,"SOCKET_bind: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
DEBUGF 2,"SOCKET_bind: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
call SOCKET_num_to_ptr
jz s_error
@ -413,12 +415,12 @@ SOCKET_bind:
cmp word [edx], AF_INET4
je .af_inet4
cmp word [edx], AF_UNIX
je .af_unix
cmp word [edx], AF_LOCAL
je .af_local
jmp s_error
.af_unix:
.af_local:
; TODO: write code here
mov dword [esp+32], 0
@ -475,7 +477,7 @@ SOCKET_bind:
align 4
SOCKET_connect:
DEBUGF 1,"SOCKET_connect: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
DEBUGF 2,"SOCKET_connect: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
call SOCKET_num_to_ptr
jz s_error
@ -624,7 +626,7 @@ align 4
align 4
SOCKET_listen:
DEBUGF 1,"SOCKET_listen: socknum=%u backlog=%u\n", ecx, edx
DEBUGF 2,"SOCKET_listen: socknum=%u backlog=%u\n", ecx, edx
call SOCKET_num_to_ptr
jz s_error
@ -676,7 +678,7 @@ SOCKET_listen:
align 4
SOCKET_accept:
DEBUGF 1,"SOCKET_accept: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
DEBUGF 2,"SOCKET_accept: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
call SOCKET_num_to_ptr
jz s_error
@ -722,7 +724,7 @@ SOCKET_accept:
align 4
SOCKET_close:
DEBUGF 1,"SOCKET_close: %u\n", ecx
DEBUGF 2,"SOCKET_close: socknum=%u\n", ecx
call SOCKET_num_to_ptr
jz s_error
@ -777,7 +779,7 @@ SOCKET_close:
align 4
SOCKET_receive:
DEBUGF 1,"SOCKET_receive: socknum=%u bufaddr=%x buflength=%u flags=%x\n", ecx, edx, esi, edi
DEBUGF 2,"SOCKET_receive: socknum=%u bufaddr=%x buflength=%u flags=%x\n", ecx, edx, esi, edi
call SOCKET_num_to_ptr
jz s_error
@ -826,7 +828,7 @@ SOCKET_receive_dgram:
.too_small:
DEBUGF 1,"SOCKET_receive: Buffer too small\n"
DEBUGF 2,"SOCKET_receive: Buffer too small\n"
jmp s_error
.block:
@ -870,7 +872,7 @@ SOCKET_receive_stream:
align 4
SOCKET_send:
DEBUGF 1,"SOCKET_send: socknum=%u data ptr=%x length=%u flags=%x\n", ecx, edx, esi, edi
DEBUGF 2,"SOCKET_send: socknum=%u data ptr=%x length=%u flags=%x\n", ecx, edx, esi, edi
call SOCKET_num_to_ptr
jz s_error
@ -949,9 +951,9 @@ SOCKET_send_pppoe:
align 4
SOCKET_send_unix:
SOCKET_send_local:
DEBUGF 1,"SOCKET_send: UNIX\n"
DEBUGF 1,"SOCKET_send: LOCAL\n"
; does this socket have a PID yet?
cmp [eax + SOCKET.PID], 0
@ -1000,7 +1002,7 @@ SOCKET_send_unix:
align 4
SOCKET_get_opt:
DEBUGF 1,"SOCKET_get_opt\n"
DEBUGF 2,"SOCKET_get_opt\n"
call SOCKET_num_to_ptr
jz s_error
@ -1050,7 +1052,7 @@ SOCKET_get_opt:
align 4
SOCKET_set_opt:
DEBUGF 1,"SOCKET_set_opt\n"
DEBUGF 2,"SOCKET_set_opt\n"
call SOCKET_num_to_ptr
jz s_error
@ -1111,7 +1113,7 @@ SOCKET_set_opt:
;
; SOCKET_pair
;
; Allocates a pair of linked UNIX domain sockets
; Allocates a pair of linked LOCAL domain sockets
;
; IN: /
; OUT: eax is socket1 num, -1 on error
@ -1121,16 +1123,16 @@ SOCKET_set_opt:
align 4
SOCKET_pair:
DEBUGF 1,"SOCKET_pair\n"
DEBUGF 2,"SOCKET_pair\n"
call SOCKET_alloc
jz s_error
mov [esp+32], edi ; application's eax
mov [eax + SOCKET.Domain], AF_UNIX
mov [eax + SOCKET.Domain], AF_LOCAL
mov [eax + SOCKET.Type], SOCK_STREAM
mov [eax + SOCKET.Protocol], 0 ;;; CHECKME
mov [eax + SOCKET.snd_proc], SOCKET_send_unix
mov [eax + SOCKET.snd_proc], SOCKET_send_local
mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream
mov ebx, eax
@ -1138,10 +1140,10 @@ SOCKET_pair:
jz .error
mov [esp+24], edi ; application's ebx
mov [eax + SOCKET.Domain], AF_UNIX
mov [eax + SOCKET.Domain], AF_LOCAL
mov [eax + SOCKET.Type], SOCK_STREAM
mov [eax + SOCKET.Protocol], 0 ;;; CHECKME
mov [eax + SOCKET.snd_proc], SOCKET_send_unix
mov [eax + SOCKET.snd_proc], SOCKET_send_local
mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream
; Link the two sockets to eachother
@ -1155,8 +1157,6 @@ SOCKET_pair:
call SOCKET_ring_create
pop eax
ret
.error:
@ -1180,7 +1180,7 @@ SOCKET_pair:
align 4
SOCKET_debug:
; DEBUGF 1,"SOCKET_debug\n"
DEBUGF 1,"SOCKET_debug\n"
mov edi, edx
@ -1229,7 +1229,7 @@ SOCKET_debug:
align 4
SOCKET_find_port:
DEBUGF 1,"SOCKET_find_port\n"
DEBUGF 2,"SOCKET_find_port\n"
push ebx esi ecx
@ -1290,7 +1290,7 @@ SOCKET_find_port:
align 4
SOCKET_check_port:
DEBUGF 1,"SOCKET_check_port: "
DEBUGF 2,"SOCKET_check_port: "
mov ecx, [eax + SOCKET.Protocol]
mov edx, [eax + IP_SOCKET.LocalIP]
@ -1310,11 +1310,11 @@ SOCKET_check_port:
cmp [esi + UDP_SOCKET.LocalPort], bx
jne .next_socket
DEBUGF 1,"local port %x already in use\n", bx ; FIXME: find a way to print big endian values with debugf
DEBUGF 2,"local port %x already in use\n", bx ; FIXME: find a way to print big endian values with debugf
ret
.port_ok:
DEBUGF 1,"local port %x is free\n", bx ; FIXME: find a way to print big endian values with debugf
DEBUGF 2,"local port %x is free\n", bx ; FIXME: find a way to print big endian values with debugf
mov [eax + UDP_SOCKET.LocalPort], bx
or bx, bx ; clear the zero-flag
ret
@ -1341,7 +1341,7 @@ SOCKET_check_port:
align 4
SOCKET_input:
DEBUGF 1,"SOCKET_input: socket=%x, data=%x size=%u\n", eax, esi, ecx
DEBUGF 2,"SOCKET_input: socket=%x, data=%x size=%u\n", eax, esi, ecx
mov [esp+4], ecx
push esi
@ -1349,7 +1349,7 @@ SOCKET_input:
add_to_queue (eax + SOCKET_QUEUE_LOCATION), SOCKET_QUEUE_SIZE, sizeof.socket_queue_entry, SOCKET_input.full
DEBUGF 1,"SOCKET_input: queued packet successfully\n"
DEBUGF 1,"SOCKET_input: success\n"
add esp, sizeof.socket_queue_entry
pusha

View File

@ -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 ;;
;; ;;
;; STACK.INC ;;
@ -48,7 +48,7 @@ PPP_IPV6 = 0x5780
;Protocol family
AF_UNSPEC = 0
AF_UNIX = 1
AF_LOCAL = 1
AF_INET4 = 2
AF_INET6 = 10
AF_PPP = 777
@ -259,6 +259,8 @@ stack_handler:
cmp [NET_RUNNING], 0
je .exit
call TCP_process_input ; de-queue TCP ragments and process them
; Test for 10ms tick
mov eax, [timer_ticks]
cmp eax, [net_10ms]
@ -587,7 +589,7 @@ checksum_2:
.not_zero:
xchg dl, dh
DEBUGF 1,"Checksum: %x\n", dx
DEBUGF 1,"Checksum: %x\n", dx
ret

View File

@ -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 ;;
@ -99,6 +99,8 @@ TCP_BIT_SENDALOT = 1 shl 0
TCP_PAWS_IDLE = 24*24*60*60*100 ; 24 days, in 1/100 seconds
TCP_QUEUE_SIZE = 50
struct TCP_header
SourcePort dw ?
@ -113,6 +115,18 @@ struct TCP_header
ends
struct TCP_queue_entry
ip_ptr dd ?
segment_ptr dd ?
segment_size dd ?
device_ptr dd ?
buffer_ptr dd ?
buffer_size dd ?
ends
align 4
uglobal
TCP_segments_tx rd MAX_NET_DEVICES
@ -120,6 +134,7 @@ uglobal
TCP_bytes_rx rq MAX_NET_DEVICES
TCP_bytes_tx rq MAX_NET_DEVICES
TCP_sequence_num dd ?
TCP_queue rd TCP_QUEUE_SIZE*sizeof.TCP_queue_entry/4
endg
@ -140,6 +155,8 @@ macro TCP_init {
pseudo_random eax
mov [TCP_sequence_num], eax
init_queue TCP_queue
}

View File

@ -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 ;;
@ -20,6 +20,8 @@ $Revision$
;
; TCP_input:
;
; Add a segment to the incoming TCP queue
;
; IN: [esp] = ptr to buffer
; [esp+4] = buffer size
; ebx = ptr to device struct
@ -34,14 +36,63 @@ $Revision$
align 4
TCP_input:
pushfd
push ebx ecx esi edi ; mind the order
mov esi, esp
pushf
cli
add_to_queue TCP_queue, TCP_QUEUE_SIZE, sizeof.TCP_queue_entry, .fail
popf
add esp, sizeof.TCP_queue_entry
ret
.fail:
DEBUGF 2, "TCP incoming queue is full, discarding packet!\n"
add esp, sizeof.TCP_queue_entry - 8
call kernel_free
add esp, 4
.done:
ret
align 4
TCP_process_input:
.loop:
get_from_queue TCP_queue, TCP_QUEUE_SIZE, sizeof.TCP_queue_entry, TCP_input.done
push .loop
push [esi + TCP_queue_entry.buffer_size]
push [esi + TCP_queue_entry.buffer_ptr]
mov ebx, [esi + TCP_queue_entry.device_ptr]
mov ecx, [esi + TCP_queue_entry.segment_size]
mov edi, [esi + TCP_queue_entry.ip_ptr]
mov esi, [esi + TCP_queue_entry.segment_ptr] ; change esi last
;-----------------------------------------------------------------
;
; IN: [esp] = ptr to buffer
; [esp+4] = buffer size - actually, we dont care
; ebx = ptr to device struct
; ecx = segment size
; esi = ptr to TCP segment
; edi = ptr to ipv4 source address, followed by ipv4 dest address
;
; OUT: /
;
;-----------------------------------------------------------------
DEBUGF 1,"TCP_input: size=%u time=%d\n", ecx, [timer_ticks]
; First, record the current time
mov eax, [timer_ticks] ; in 1/100 seconds
mov [esp+8], eax
mov [esp + 4], eax ; from now on, we'll call this TCP_now
; then, re-calculate the checksum (if not already done by hw)
; test [ebx + NET_DEVICE.hwacc], HWACC_TCP_IPv4_IN
@ -313,7 +364,7 @@ TCP_input:
DEBUGF 1,"TCP_input: PAWS: detected an old segment\n"
mov eax, [esp+4+4+4] ; tcp_now
mov eax, [esp+4+4] ; tcp_now
sub eax, [ebx + TCP_SOCKET.ts_recent_age]
cmp eax, TCP_PAWS_IDLE
jle .drop_after_ack ; TODO: update stats
@ -402,7 +453,7 @@ TCP_input:
test [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
jz .no_timestamp_rtt
mov eax, [esp + 4+4] ; timestamp when this segment was received
mov eax, [esp + 4] ; timestamp when this segment was received
sub eax, [ebx + TCP_SOCKET.ts_ecr]
inc eax
call TCP_xmit_timer
@ -669,7 +720,7 @@ TCP_input:
DEBUGF 1,"Recording timestamp\n"
mov eax, [esp + 4+4] ; tcp_now
mov eax, [esp + 4] ; tcp_now
mov [ebx + TCP_SOCKET.ts_recent_age], eax
mov eax, [ebx + TCP_SOCKET.ts_val]
mov [ebx + TCP_SOCKET.ts_recent], eax
@ -918,7 +969,7 @@ TCP_input:
test [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
jz .timestamp_not_present
mov eax, [esp+4+4]
mov eax, [esp+4]
sub eax, [ebx + TCP_SOCKET.ts_ecr]
inc eax
call TCP_xmit_timer
@ -1025,7 +1076,7 @@ TCP_input:
.wakeup:
pushf
pushf ; Why?
mov eax, ebx
call SOCKET_notify_owner
@ -1491,7 +1542,6 @@ align 4
.dumpit:
DEBUGF 1,"TCP_input: dumping\n"
popf
call kernel_free
add esp, 4
@ -1538,7 +1588,6 @@ align 4
.drop_no_socket:
DEBUGF 1,"TCP_input: Drop (no socket)\n"
popf
call kernel_free
add esp, 4

View File

@ -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 ;;
@ -28,9 +28,6 @@ $Revision$
align 4
TCP_output:
pushf
cli
DEBUGF 1,"TCP_output: socket=%x\n", eax
pusha
@ -292,7 +289,6 @@ TCP_output:
call mutex_unlock
popa
popf
ret
@ -586,7 +582,6 @@ TCP_send:
DEBUGF 1,"TCP_send: success!\n"
xor eax, eax
popf
ret
@ -605,7 +600,6 @@ TCP_send:
DEBUGF 1,"TCP_send: IP error\n"
or eax, -1
popf
ret
.send_error:
@ -614,7 +608,6 @@ TCP_send:
DEBUGF 1,"TCP_send: sending failed\n"
or eax, -2
popf
ret