Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1884 → Rev 1885

/kernel/branches/net/network/socket.inc
57,9 → 57,6
.LocalPort dw ?
.RemotePort dw ?
 
.OrigRemoteIP dd ? ; original remote IP address (used to reset to LISTEN state)
.OrigRemotePort dw ? ; original remote port (used to reset to LISTEN state)
 
.t_state dd ? ; TCB state
.t_rxtshift dd ?
.t_rxtcur dd ?
1491,8 → 1488,6
rep movsd
 
and [eax + SOCKET.options], not SO_ACCEPTCON
 
;;;;; call SOCKET_notify_owner
pop edi ecx esi
 
ret
1625,7 → 1620,7
 
 
 
;---------------------------------------------------
;------------------------------------------------------
;
; SOCKET_process_end
;
1675,6 → 1670,8
 
.tcp:
 
;;; TODO
 
jmp .next_socket
 
.done:
1685,12 → 1682,49
 
 
 
;-----------------------------------------------------------------
;
; SOCKET_is_connecting
;
; IN: eax = socket ptr
; OUT: /
;
;-----------------------------------------------------------------
 
align 4
SOCKET_is_connecting:
 
 
and [eax + SOCKET.options], not (SS_ISCONNECTED + SS_ISDISCONNECTING + SS_ISCONFIRMING)
or [eax + SOCKET.options], SS_ISCONNECTING
 
jmp SOCKET_notify_owner
 
 
 
;-----------------------------------------------------------------
;
; SOCKET_is_connected
;
; IN: eax = socket ptr
; OUT: /
;
;-----------------------------------------------------------------
 
align 4
SOCKET_is_connected:
 
 
and [eax + SOCKET.options], not (SS_ISCONNECTING + SS_ISDISCONNECTING + SS_ISCONFIRMING)
or [eax + SOCKET.options], SS_ISCONNECTED
 
jmp SOCKET_notify_owner
 
 
 
 
;-----------------------------------------------------------------
;
; SOCKET_is_disconnecting
;
; IN: eax = socket ptr
1738,6 → 1772,8
align 4
SOCKET_cant_recv_more:
 
or [eax + SOCKET.options], SS_CANTRCVMORE
 
ret
 
 
1744,7 → 1780,7
 
;-----------------------------------------------------------------
;
; SOCKET_is_connected
; SOCKET_cant_send_more
;
; IN: eax = socket ptr
; OUT: /
1752,10 → 1788,8
;-----------------------------------------------------------------
 
align 4
SOCKET_is_connected:
SOCKET_cant_send_more:
 
or [eax + SOCKET.options], SS_CANTSENDMORE
 
and [eax + SOCKET.options], not (SS_ISCONNECTING + SS_ISDISCONNECTING + SS_ISCONFIRMING)
or [eax + SOCKET.options], SS_ISCONNECTED
 
jmp SOCKET_notify_owner
ret
/kernel/branches/net/network/stack.inc
60,8 → 60,17
SOCK_RAW equ 3
 
; Socket options
SO_ACCEPTCON equ 1
SO_ACCEPTCON equ 1 shl 0
SO_BROADCAST equ 1 shl 1
SO_DEBUG equ 1 shl 2
SO_DONTROUTE equ 1 shl 3
SO_KEEPALIVE equ 1 shl 4
SO_OOBINLINE equ 1 shl 5
SO_REUSEADDR equ 1 shl 6
SO_REUSEPORT equ 1 shl 7
SO_USELOOPBACK equ 1 shl 8
 
 
; Socket States
SS_NOFDREF equ 0x001 ; no file table ref any more
SS_ISCONNECTED equ 0x002 ; socket connected to a peer
/kernel/branches/net/network/tcp_subr.inc
173,10 → 173,8
;;; TODO: update slow start threshold
;;; TODO: release connection resources
 
; Now, mark the socket as being disconnected
call SOCKET_is_disconnected
 
mov [eax + SOCKET.state], 0 ;;; FIXME
 
ret
 
 
/kernel/branches/net/network/tcp_timer.inc
33,7 → 33,7
cmp [ebx + SOCKET.Domain], AF_INET4
jne .loop
 
cmp [ebx + SOCKET.Protocol], IP_PROTO_TCP ;;; We should also check if family is AF_INET
cmp [ebx + SOCKET.Protocol], IP_PROTO_TCP
jne .loop
 
test [ebx + TCP_SOCKET.t_flags], TF_DELACK