Subversion Repositories Kolibri OS

Rev

Rev 1171 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1171 Rev 1185
Line 17... Line 17...
17
;;                                                                 ;;
17
;;                                                                 ;;
18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 19... Line 19...
19
 
19
 
Line 20... Line -...
20
$Revision: 983 $
-
 
21
 
-
 
22
 
-
 
23
;*******************************************************************
-
 
24
;   Interface
-
 
25
;      The interfaces defined in ETHERNET.INC plus:
-
 
26
;      stack_init
-
 
27
;      stack_handler
-
 
28
;      app_stack_handler
-
 
29
;      app_socket_handler
-
 
30
;      checksum
-
 
31
;
-
 
32
;*******************************************************************
20
$Revision: 983 $
33
 
21
 
34
uglobal
22
uglobal
35
	last_1sTick	db ?
23
	last_1sTick	db ?
Line 36... Line 24...
36
	last_1hsTick	dd ?
24
	last_1hsTick	dd ?
Line 37... Line 25...
37
endg
25
endg
38
 
26
 
-
 
27
MAX_NET_DEVICES equ 16
39
MAX_NET_DEVICES equ 16
28
 
-
 
29
MIN_EPHEMERAL_PORT equ 49152
Line 40... Line 30...
40
 
30
MAX_EPHEMERAL_PORT equ 61000
41
; TCP opening modes
31
 
42
SOCKET_PASSIVE	equ 0
32
ETHER		equ 1337
43
SOCKET_ACTIVE	equ 1
33
ETHER_ARP	equ 0x0608
Line 58... Line 48...
58
IP_PROTO_IP	equ 0
48
IP_PROTO_IP	equ 0
59
IP_PROTO_ICMP	equ 1
49
IP_PROTO_ICMP	equ 1
60
IP_PROTO_TCP	equ 6
50
IP_PROTO_TCP	equ 6
61
IP_PROTO_UDP	equ 17
51
IP_PROTO_UDP	equ 17
Line -... Line 52...
-
 
52
 
62
 
53
; TCP opening modes
63
MIN_EPHEMERAL_PORT equ 49152
54
SOCKET_PASSIVE	equ 0
Line 64... Line 55...
64
MAX_EPHEMERAL_PORT equ 61000
55
SOCKET_ACTIVE	equ 1
65
 
56
 
66
include "queue.inc"
57
include "queue.inc"
67
include "ARP.inc"
58
include "arp.inc"
68
include "IPv4.inc"
59
include "ipv4.inc"
69
include "ethernet.inc"
60
include "ethernet.inc"
70
include "socket.inc"
61
include "socket.inc"
71
;include "TCP.inc"
62
;include "tcp.inc"
Line 72... Line 63...
72
include "UDP.inc"
63
include "udp.inc"
73
include "ICMP.inc"
64
include "icmp.inc"
74
 
65
 
75
;-----------------------------------------------
66
;-----------------------------------------------
Line 123... Line 114...
123
    call    ETH_send_queued
114
    call    ETH_send_queued
Line 124... Line 115...
124
 
115
 
125
    ; Test for 10ms tick, call tcp timer
116
    ; Test for 10ms tick, call tcp timer
126
    mov     eax, [timer_ticks]
117
    mov     eax, [timer_ticks]
127
    cmp     eax, [last_1hsTick]
118
    cmp     eax, [last_1hsTick]
Line 128... Line 119...
128
    je	    .sec_tick
119
    je	    .exit
129
 
120
 
Line 130... Line 121...
130
    mov     [last_1hsTick], eax
121
    mov     [last_1hsTick], eax
Line 139... Line 130...
139
    cmp     al, [last_1sTick]
130
    cmp     al, [last_1sTick]
140
    je	    .exit
131
    je	    .exit
Line 141... Line 132...
141
 
132
 
Line 142... Line 133...
142
    mov     [last_1sTick], al
133
    mov     [last_1sTick], al
143
 
134
 
144
    stdcall arp_table_manager, ARP_TABLE_TIMER, 0, 0
135
;    call    ARP_decrease_entry_ttls
Line 145... Line 136...
145
    call    IPv4_decrease_fragment_ttls
136
    call    IPv4_decrease_fragment_ttls
146
;    call    tcp_tcb_handler
137
;    call    tcp_tcb_handler
Line 273... Line 264...
273
;        je      TCP_API
264
;        je      TCP_API
Line 274... Line 265...
274
 
265
 
275
	cmp	ax , ETHER_ARP
266
	cmp	ax , ETHER_ARP
Line 276... Line 267...
276
	je	ARP_API
267
	je	ARP_API
277
 
268
 
Line 278... Line 269...
278
	cmp	ax , 1337
269
	cmp	ax , ETHER
Line 279... Line 270...
279
	je	ETH_API
270
	je	ETH_API