Subversion Repositories Kolibri OS

Rev

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

Rev 1773 Rev 1774
Line 19... Line 19...
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
20
;;             Version 2, June 1991                                ;;
20
;;             Version 2, June 1991                                ;;
21
;;                                                                 ;;
21
;;                                                                 ;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 23... Line 23...
23
 
23
 
Line 24... Line 24...
24
$Revision: 1773 $
24
$Revision: 1774 $
25
 
25
 
Line 26... Line 26...
26
__DEBUG_LEVEL_OLD__	equ __DEBUG_LEVEL__	; use seperate debug level for network part of kernel
26
__DEBUG_LEVEL_OLD__	equ __DEBUG_LEVEL__	; use seperate debug level for network part of kernel
Line 41... Line 41...
41
ETHER_IPv4		equ 0x0008
41
ETHER_IPv4		equ 0x0008
42
ETHER_PPP_DISCOVERY	equ 0x6388
42
ETHER_PPP_DISCOVERY	equ 0x6388
43
ETHER_PPP_SESSION	equ 0x6488
43
ETHER_PPP_SESSION	equ 0x6488
Line 44... Line 44...
44
 
44
 
45
;Protocol family
45
;Protocol family
46
AF_UNSPEC	equ 0
46
AF_UNSPEC		equ 0
47
AF_UNIX 	equ 1
47
AF_UNIX 		equ 1
48
AF_INET4	equ 2
48
AF_INET4		equ 2
Line 49... Line 49...
49
AF_INET6	equ 10
49
AF_INET6		equ 10
50
 
50
 
51
; Internet protocol numbers
51
; Internet protocol numbers
52
IP_PROTO_IP	equ 0
52
IP_PROTO_IP		equ 0
53
IP_PROTO_ICMP	equ 1
53
IP_PROTO_ICMP		equ 1
Line 54... Line 54...
54
IP_PROTO_TCP	equ 6
54
IP_PROTO_TCP		equ 6
55
IP_PROTO_UDP	equ 17
55
IP_PROTO_UDP		equ 17
56
 
56
 
57
; Socket types
57
; Socket types
Line 58... Line 58...
58
SOCK_STREAM	equ 1
58
SOCK_STREAM		equ 1
59
SOCK_DGRAM	equ 2
59
SOCK_DGRAM		equ 2
Line 60... Line 60...
60
SOCK_RAW	equ 3
60
SOCK_RAW		equ 3
61
 
61
 
62
; Socket options
62
; Socket options
63
SO_ACCEPTCON	equ 1
63
SO_ACCEPTCON		equ 1
64
 
64
 
65
; Socket States
65
; Socket States
66
SS_NOFDREF		equ 0x001   ; no file table ref any more
66
SS_NOFDREF		equ 0x001	; no file table ref any more
67
SS_ISCONNECTED		equ 0x002   ; socket connected to a peer
67
SS_ISCONNECTED		equ 0x002	; socket connected to a peer
68
SS_ISCONNECTING 	equ 0x004   ; in process of connecting to peer
68
SS_ISCONNECTING 	equ 0x004	; in process of connecting to peer
69
SS_ISDISCONNECTING	equ 0x008   ; in process of disconnecting
69
SS_ISDISCONNECTING	equ 0x008	; in process of disconnecting
70
SS_CANTSENDMORE 	equ 0x010   ; can't send more data to peer
70
SS_CANTSENDMORE 	equ 0x010	; can't send more data to peer
71
SS_CANTRCVMORE		equ 0x020   ; can't receive more data from peer
71
SS_CANTRCVMORE		equ 0x020	; can't receive more data from peer
72
SS_RCVATMARK		equ 0x040   ; at mark on input
72
SS_RCVATMARK		equ 0x040	; at mark on input
73
SS_ISABORTING		equ 0x080   ; aborting fd references - close()
73
SS_ISABORTING		equ 0x080	; aborting fd references - close()
74
SS_RESTARTSYS		equ 0x100   ; restart blocked system calls
74
SS_RESTARTSYS		equ 0x100	; restart blocked system calls
Line 75... Line 75...
75
SS_ISDISCONNECTED	equ 0x800   ; socket disconnected from peer
75
SS_ISDISCONNECTED	equ 0x800	; socket disconnected from peer
Line 76... Line 76...
76
 
76
 
77
SS_ASYNC		equ 0x100   ; async i/o notify
77
SS_ASYNC		equ 0x100	; async i/o notify
78
SS_ISCONFIRMING 	equ 0x200   ; deciding to accept connection req
78
SS_ISCONFIRMING 	equ 0x200	; deciding to accept connection req
Line 79... Line 79...
79
SS_MORETOCOME		equ 0x400   ;
79
SS_MORETOCOME		equ 0x400
Line 80... Line 80...
80
 
80
 
81
 
81
 
82
SOCKET_MAXDATA	equ 4096*32	; must be 4096*(power of 2) where 'power of 2' is at least 8
82
SOCKET_MAXDATA		equ 4096*32	; must be 4096*(power of 2) where 'power of 2' is at least 8
83
 
83
 
84
; Network driver types
84
; Network driver types
85
NET_TYPE_ETH	equ 1
85
NET_TYPE_ETH		equ 1
Line 86... Line 86...
86
NET_TYPE_SLIP	equ 2
86
NET_TYPE_SLIP		equ 2
Line 143... Line 143...
143
 
143
 
Line 144... Line 144...
144
	rol	word reg, 8
144
	rol	word reg, 8
Line 145... Line -...
145
 
-
 
146
}
-
 
147
 
-
 
148
 
-
 
149
macro packet_to_debug { 	; set esi to packet you want to print, ecx to number of bytes
-
 
150
 
-
 
151
local	.loop
-
 
152
 
-
 
153
  .loop:
-
 
154
	lodsb
-
 
155
	DEBUGF	1,"%x ", eax:2
-
 
156
	loop	@r
-
 
157
 
-
 
158
}
145
 
Line 159... Line 146...
159
 
146
}
Line 160... Line 147...
160
 
147
 
Line 261... Line 248...
261
 
248
 
262
 
249
 
263
 
250
 
264
;-----------------------------------------------------------------
251
;-----------------------------------------------------------------
265
;
252
;
266
; NET_Add_Device:
253
; NET_add_Device:
267
;
254
;
268
;  This function is called by the network drivers,
255
;  This function is called by the network drivers,