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 |
||
5842 | hidnplayr | 14 | IPPROTO_RAW = 255 |
3618 | hidnplayr | 15 | |
5842 | hidnplayr | 16 | ; IP options |
17 | IP_TTL = 2 |
||
18 | |||
3618 | hidnplayr | 19 | ; Address families |
3704 | hidnplayr | 20 | AF_UNSPEC = 0 |
21 | AF_LOCAL = 1 |
||
22 | AF_INET4 = 2 ; IPv4 |
||
5842 | hidnplayr | 23 | AF_INET6 = 28 ; IPv6 |
3618 | hidnplayr | 24 | |
3704 | hidnplayr | 25 | PF_UNSPEC = AF_UNSPEC |
26 | PF_LOCAL = AF_LOCAL |
||
27 | PF_INET4 = AF_INET4 |
||
28 | PF_INET6 = AF_INET6 |
||
3618 | hidnplayr | 29 | |
30 | ; Flags for addrinfo |
||
3704 | hidnplayr | 31 | AI_PASSIVE = 1 |
32 | AI_CANONNAME = 2 |
||
33 | AI_NUMERICHOST = 4 |
||
34 | AI_NUMERICSERV = 8 |
||
35 | AI_ADDRCONFIG = 0x400 |
||
3618 | hidnplayr | 36 | |
37 | ; internal definition |
||
3704 | hidnplayr | 38 | AI_SUPPORTED = 0x40F |
3618 | hidnplayr | 39 | |
40 | ; for system function 76 |
||
3704 | hidnplayr | 41 | API_ETH = 0 shl 16 |
42 | API_IPv4 = 1 shl 16 |
||
43 | API_ICMP = 2 shl 16 |
||
44 | API_UDP = 3 shl 16 |
||
45 | API_TCP = 4 shl 16 |
||
46 | API_ARP = 5 shl 16 |
||
47 | API_PPPOE = 6 shl 16 |
||
3618 | hidnplayr | 48 | |
3704 | hidnplayr | 49 | ; Socket flags for user calls |
5842 | hidnplayr | 50 | MSG_PEEK = 0x02 |
51 | MSG_DONTWAIT = 0x40 |
||
3704 | hidnplayr | 52 | |
5842 | hidnplayr | 53 | ; Socket levels |
54 | SOL_SOCKET = 0xffff |
||
55 | |||
56 | ; Socket options |
||
57 | SO_BINDTODEVICE = 1 shl 9 |
||
58 | |||
3618 | hidnplayr | 59 | struct sockaddr_in |
3704 | hidnplayr | 60 | sin_family dw ? ; sa_family_t |
61 | sin_port dw ? ; in_port_t |
||
62 | sin_addr dd ? ; struct in_addr |
||
63 | sin_zero rb 8 ; zero |
||
3618 | hidnplayr | 64 | ends |
65 | |||
66 | struct addrinfo |
||
3704 | hidnplayr | 67 | ai_flags dd ? ; bitmask of AI_* |
68 | ai_family dd ? ; PF_* |
||
69 | ai_socktype dd ? ; SOCK_* |
||
70 | ai_protocol dd ? ; 0 or IPPROTO_* |
||
71 | ai_addrlen dd ? ; length of ai_addr |
||
72 | ai_canonname dd ? ; char* |
||
73 | ai_addr dd ? ; struct sockaddr* |
||
74 | ai_next dd ? ; struct addrinfo* |
||
3618 | hidnplayr | 75 | ends |
76 | |||
3704 | hidnplayr | 77 | EAI_ADDRFAMILY = 1 |
78 | EAI_AGAIN = 2 |
||
79 | EAI_BADFLAGS = 3 |
||
80 | EAI_FAIL = 4 |
||
81 | EAI_FAMILY = 5 |
||
82 | EAI_MEMORY = 6 |
||
83 | EAI_NONAME = 8 |
||
84 | EAI_SERVICE = 9 |
||
85 | EAI_SOCKTYPE = 10 |
||
86 | EAI_BADHINTS = 12 |
||
87 | EAI_PROTOCOL = 13 |
||
88 | EAI_OVERFLOW = 14 |
||
3618 | hidnplayr | 89 | |
3704 | hidnplayr | 90 | socket fix 75, 0 |
91 | close fix 75, 1 |
||
92 | bind fix 75, 2 |
||
93 | listen fix 75, 3 |
||
94 | connect fix 75, 4 |
||
95 | accept fix 75, 5 |
||
96 | send fix 75, 6 |
||
97 | recv fix 75, 7 |
||
98 | setsockopt fix 75, 8 |
||
99 | getsockopt fix 75, 9 |
||
100 | socketpair fix 75, 10 |
||
3618 | hidnplayr | 101 | |
102 | |||
3704 | hidnplayr | 103 | struct ARP_entry |
104 | IP dd ? |
||
105 | MAC dp ? |
||
106 | status dw ? |
||
107 | TTL dw ? |
||
3618 | hidnplayr | 108 | ends |
4208 | hidnplayr | 109 | |
110 | |||
111 | ; Socket error codes |
||
112 | ; Error Codes |
||
113 | ENOBUFS = 1 |
||
114 | EINPROGRESS = 2 |
||
115 | EOPNOTSUPP = 4 |
||
116 | EWOULDBLOCK = 6 |
||
117 | ENOTCONN = 9 |
||
118 | EALREADY = 10 |
||
119 | EINVAL = 11 |
||
120 | EMSGSIZE = 12 |
||
121 | ENOMEM = 18 |
||
122 | EADDRINUSE = 20 |
||
123 | ECONNREFUSED = 61 |
||
124 | ECONNRESET = 52 |
||
125 | EISCONN = 56 |
||
126 | ETIMEDOUT = 60 |
||
127 | ECONNABORTED = 53 |