Subversion Repositories Kolibri OS

Rev

Rev 3618 | Rev 4208 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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