Subversion Repositories Kolibri OS

Rev

Rev 3618 | Rev 4208 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3618 Rev 3704
1
; Socket types
1
; Socket types
2
SOCK_STREAM	= 1
2
SOCK_STREAM     = 1
3
SOCK_DGRAM	= 2
3
SOCK_DGRAM      = 2
4
SOCK_RAW	= 3
4
SOCK_RAW        = 3
5
 
5
 
6
; Socket options
6
; Socket options
7
SO_NONBLOCK	= 1 shl 31
7
SO_NONBLOCK     = 1 shl 31
8
 
8
 
9
; IP protocols
9
; IP protocols
10
IPPROTO_IP	= 0
10
IPPROTO_IP      = 0
11
IPPROTO_ICMP	= 1
11
IPPROTO_ICMP    = 1
12
IPPROTO_TCP	= 6
12
IPPROTO_TCP     = 6
13
IPPROTO_UDP	= 17
13
IPPROTO_UDP     = 17
14
 
14
 
15
; Address families
15
; Address families
16
AF_UNSPEC	= 0
16
AF_UNSPEC       = 0
17
AF_LOCAL	= 1
17
AF_LOCAL        = 1
18
AF_INET4	= 2	; IPv4
18
AF_INET4        = 2     ; IPv4
19
AF_INET6	= 28	; IPv6 (not supported yet)
19
AF_INET6        = 28    ; IPv6 (not supported yet)
20
 
20
 
21
PF_UNSPEC	= AF_UNSPEC
21
PF_UNSPEC       = AF_UNSPEC
22
PF_LOCAL	= AF_LOCAL
22
PF_LOCAL        = AF_LOCAL
23
PF_INET4	= AF_INET4
23
PF_INET4        = AF_INET4
24
PF_INET6	= AF_INET6
24
PF_INET6        = AF_INET6
25
 
25
 
26
; Flags for addrinfo
26
; Flags for addrinfo
27
AI_PASSIVE	= 1
27
AI_PASSIVE      = 1
28
AI_CANONNAME	= 2
28
AI_CANONNAME    = 2
29
AI_NUMERICHOST	= 4
29
AI_NUMERICHOST  = 4
30
AI_NUMERICSERV	= 8
30
AI_NUMERICSERV  = 8
31
AI_ADDRCONFIG	= 0x400
31
AI_ADDRCONFIG   = 0x400
32
 
32
 
33
; internal definition
33
; internal definition
34
AI_SUPPORTED	= 0x40F
34
AI_SUPPORTED    = 0x40F
35
 
35
 
36
; for system function 76
36
; for system function 76
37
API_ETH 	= 0 shl 16
37
API_ETH         = 0 shl 16
38
API_IPv4	= 1 shl 16
38
API_IPv4        = 1 shl 16
39
API_ICMP	= 2 shl 16
39
API_ICMP        = 2 shl 16
40
API_UDP 	= 3 shl 16
40
API_UDP         = 3 shl 16
41
API_TCP 	= 4 shl 16
41
API_TCP         = 4 shl 16
42
API_ARP 	= 5 shl 16
42
API_ARP         = 5 shl 16
43
API_PPPOE	= 6 shl 16
43
API_PPPOE       = 6 shl 16
-
 
44
 
-
 
45
; Socket flags for user calls
-
 
46
MSG_PEEK                = 0x02
-
 
47
MSG_DONTWAIT            = 0x40
44
 
48
 
45
struct sockaddr_in
49
struct sockaddr_in
46
	sin_family	dw	?	; sa_family_t
50
        sin_family      dw      ?       ; sa_family_t
47
	sin_port	dw	?	; in_port_t
51
        sin_port        dw      ?       ; in_port_t
48
	sin_addr	dd	?	; struct in_addr
52
        sin_addr        dd      ?       ; struct in_addr
49
	sin_zero	rb	8	; zero
53
        sin_zero        rb      8       ; zero
50
ends
54
ends
51
 
55
 
52
struct addrinfo
56
struct addrinfo
53
	ai_flags	dd	?	; bitmask of AI_*
57
        ai_flags        dd      ?       ; bitmask of AI_*
54
	ai_family	dd	?	; PF_*
58
        ai_family       dd      ?       ; PF_*
55
	ai_socktype	dd	?	; SOCK_*
59
        ai_socktype     dd      ?       ; SOCK_*
56
	ai_protocol	dd	?	; 0 or IPPROTO_*
60
        ai_protocol     dd      ?       ; 0 or IPPROTO_*
57
	ai_addrlen	dd	?	; length of ai_addr
61
        ai_addrlen      dd      ?       ; length of ai_addr
58
	ai_canonname	dd	?	; char*
62
        ai_canonname    dd      ?       ; char*
59
	ai_addr 	dd	?	; struct sockaddr*
63
        ai_addr         dd      ?       ; struct sockaddr*
60
	ai_next 	dd	?	; struct addrinfo*
64
        ai_next         dd      ?       ; struct addrinfo*
61
ends
65
ends
62
 
66
 
63
EAI_ADDRFAMILY	= 1
67
EAI_ADDRFAMILY  = 1
64
EAI_AGAIN	= 2
68
EAI_AGAIN       = 2
65
EAI_BADFLAGS	= 3
69
EAI_BADFLAGS    = 3
66
EAI_FAIL	= 4
70
EAI_FAIL        = 4
67
EAI_FAMILY	= 5
71
EAI_FAMILY      = 5
68
EAI_MEMORY	= 6
72
EAI_MEMORY      = 6
69
EAI_NONAME	= 8
73
EAI_NONAME      = 8
70
EAI_SERVICE	= 9
74
EAI_SERVICE     = 9
71
EAI_SOCKTYPE	= 10
75
EAI_SOCKTYPE    = 10
72
EAI_BADHINTS	= 12
76
EAI_BADHINTS    = 12
73
EAI_PROTOCOL	= 13
77
EAI_PROTOCOL    = 13
74
EAI_OVERFLOW	= 14
78
EAI_OVERFLOW    = 14
75
 
79
 
76
socket		fix 75, 0
80
socket          fix 75, 0
77
close		fix 75, 1
81
close           fix 75, 1
78
bind		fix 75, 2
82
bind            fix 75, 2
79
listen		fix 75, 3
83
listen          fix 75, 3
80
connect 	fix 75, 4
84
connect         fix 75, 4
81
accept		fix 75, 5
85
accept          fix 75, 5
82
send		fix 75, 6
86
send            fix 75, 6
83
recv		fix 75, 7
87
recv            fix 75, 7
84
setsockopt	fix 75, 8
88
setsockopt      fix 75, 8
85
getsockopt	fix 75, 9
89
getsockopt      fix 75, 9
86
socketpair	fix 75, 10
90
socketpair      fix 75, 10
87
 
91
 
88
 
92
 
89
struct	ARP_entry
93
struct  ARP_entry
90
	IP	dd ?
94
        IP      dd ?
91
	MAC	dp ?
95
        MAC     dp ?
92
	status	dw ?
96
        status  dw ?
93
	TTL	dw ?
97
        TTL     dw ?
94
ends
98
ends