summaryrefslogtreecommitdiffstats
path: root/Lib/plat-unixware7/SOCKET.py
blob: fe093a132f56e0b3a7a2cc851826a041f2553426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# Generated by h2py from /usr/include/sys/socket.h

# Included from sys/byteorder.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412

# Included from sys/byteorder_f.h
BYTE_ORDER = LITTLE_ENDIAN
def htonl(hl): return __htonl(hl)

def ntohl(nl): return __ntohl(nl)

def htons(hs): return __htons(hs)

def ntohs(ns): return __ntohs(ns)

def ntohl(x): return (x)

def ntohs(x): return (x)

def htonl(x): return (x)

def htons(x): return (x)


# Included from sys/types.h
def quad_low(x): return x.val[0]

ADT_EMASKSIZE = 8
SHRT_MIN = -32768
SHRT_MAX = 32767
INT_MIN = (-2147483647-1)
INT_MAX = 2147483647
LONG_MIN = (-2147483647-1)
LONG_MAX = 2147483647
OFF32_MAX = LONG_MAX
ISTAT_ASSERTED = 0
ISTAT_ASSUMED = 1
ISTAT_NONE = 2
OFF_MAX = OFF32_MAX
CLOCK_MAX = LONG_MAX
P_MYID = (-1)
P_MYHOSTID = (-1)

# Included from sys/select.h
FD_SETSIZE = 4096
NBBY = 8
NULL = 0

# Included from sys/bitypes.h

# Included from sys/convsa.h
__NETLIB_UW211_SVR4 = 1
__NETLIB_UW211_XPG4 = 2
__NETLIB_GEMINI_SVR4 = 3
__NETLIB_GEMINI_XPG4 = 4
__NETLIB_FP1_SVR4 = 5
__NETLIB_FP1_XPG4 = 6
__NETLIB_BASE_VERSION__ = __NETLIB_UW211_SVR4
__NETLIB_VERSION__ = __NETLIB_FP1_SVR4
__NETLIB_VERSION__ = __NETLIB_FP1_XPG4
__NETLIB_VERSION__ = __NETLIB_GEMINI_SVR4
__NETLIB_VERSION__ = __NETLIB_GEMINI_XPG4
__NETLIB_VERSION__ = __NETLIB_UW211_SVR4
__NETLIB_VERSION__ = __NETLIB_UW211_XPG4
__NETLIB_VERSION__ = __NETLIB_FP1_XPG4
def __NETLIB_VERSION_IS_XPG4(version): return (((version) % 2) == 0)

def __NETLIB_VERSION_HAS_SALEN(version): return ((version) >= __NETLIB_GEMINI_SVR4)

def __NETLIB_VERSION_IS_IKS(version): return ((version) >= __NETLIB_FP1_SVR4)

def SA_FAMILY_GET(sa): return \


# Included from sys/uio.h
SHUT_RD = 0
SHUT_WR = 1
SHUT_RDWR = 2

# Included from sys/netconfig.h

# Included from sys/cdefs.h
def __P(protos): return protos		 

def __STRING(x): return #x

def __P(protos): return ()		 

def __STRING(x): return "x"

NETCONFIG = "/etc/netconfig"
NETPATH = "NETPATH"
NC_TPI_CLTS = 1
NC_TPI_COTS = 2
NC_TPI_COTS_ORD = 3
NC_TPI_RAW = 4
NC_NOFLAG = 00
NC_VISIBLE = 01
NC_BROADCAST = 02
NC_NOPROTOFMLY = "-"
NC_LOOPBACK = "loopback"
NC_INET = "inet"
NC_INET6 = "inet6"
NC_IMPLINK = "implink"
NC_PUP = "pup"
NC_CHAOS = "chaos"
NC_NS = "ns"
NC_NBS = "nbs"
NC_ECMA = "ecma"
NC_DATAKIT = "datakit"
NC_CCITT = "ccitt"
NC_SNA = "sna"
NC_DECNET = "decnet"
NC_DLI = "dli"
NC_LAT = "lat"
NC_HYLINK = "hylink"
NC_APPLETALK = "appletalk"
NC_NIT = "nit"
NC_IEEE802 = "ieee802"
NC_OSI = "osi"
NC_X25 = "x25"
NC_OSINET = "osinet"
NC_GOSIP = "gosip"
NC_NETWARE = "netware"
NC_NOPROTO = "-"
NC_TCP = "tcp"
NC_UDP = "udp"
NC_ICMP = "icmp"
NC_IPX = "ipx"
NC_SPX = "spx"
NC_TPI_CLTS = 1
NC_TPI_COTS = 2
NC_TPI_COTS_ORD = 3
NC_TPI_RAW = 4
SOCK_STREAM = 2
SOCK_DGRAM = 1
SOCK_RAW = 4
SOCK_RDM = 5
SOCK_SEQPACKET = 6
SO_DEBUG = 0x0001
SO_ACCEPTCONN = 0x0002
SO_REUSEADDR = 0x0004
SO_KEEPALIVE = 0x0008
SO_DONTROUTE = 0x0010
SO_BROADCAST = 0x0020
SO_USELOOPBACK = 0x0040
SO_LINGER = 0x0080
SO_OOBINLINE = 0x0100
SO_ORDREL = 0x0200
SO_IMASOCKET = 0x0400
SO_MGMT = 0x0800
SO_REUSEPORT = 0x1000
SO_LISTENING = 0x2000
SO_RDWR = 0x4000
SO_SEMA = 0x8000
SO_DONTLINGER = (~SO_LINGER)
SO_SNDBUF = 0x1001
SO_RCVBUF = 0x1002
SO_SNDLOWAT = 0x1003
SO_RCVLOWAT = 0x1004
SO_SNDTIMEO = 0x1005
SO_RCVTIMEO = 0x1006
SO_ERROR = 0x1007
SO_TYPE = 0x1008
SO_PROTOTYPE = 0x1009
SO_ALLRAW = 0x100a
SOL_SOCKET = 0xffff
AF_UNSPEC = 0
AF_UNIX = 1
AF_LOCAL = AF_UNIX
AF_INET = 2
AF_IMPLINK = 3
AF_PUP = 4
AF_CHAOS = 5
AF_NS = 6
AF_NBS = 7
AF_ECMA = 8
AF_DATAKIT = 9
AF_CCITT = 10
AF_SNA = 11
AF_DECnet = 12
AF_DLI = 13
AF_LAT = 14
AF_HYLINK = 15
AF_APPLETALK = 16
AF_NIT = 17
AF_802 = 18
AF_OSI = 19
AF_ISO = AF_OSI
AF_X25 = 20
AF_OSINET = 21
AF_GOSIP = 22
AF_YNET = 23
AF_ROUTE = 24
AF_LINK = 25
pseudo_AF_XTP = 26
AF_INET6 = 27
AF_MAX = 27
AF_INET_BSWAP = 0x0200
PF_UNSPEC = AF_UNSPEC
PF_UNIX = AF_UNIX
PF_LOCAL = AF_LOCAL
PF_INET = AF_INET
PF_IMPLINK = AF_IMPLINK
PF_PUP = AF_PUP
PF_CHAOS = AF_CHAOS
PF_NS = AF_NS
PF_NBS = AF_NBS
PF_ECMA = AF_ECMA
PF_DATAKIT = AF_DATAKIT
PF_CCITT = AF_CCITT
PF_SNA = AF_SNA
PF_DECnet = AF_DECnet
PF_DLI = AF_DLI
PF_LAT = AF_LAT
PF_HYLINK = AF_HYLINK
PF_APPLETALK = AF_APPLETALK
PF_NIT = AF_NIT
PF_802 = AF_802
PF_OSI = AF_OSI
PF_ISO = PF_OSI
PF_X25 = AF_X25
PF_OSINET = AF_OSINET
PF_GOSIP = AF_GOSIP
PF_YNET = AF_YNET
PF_ROUTE = AF_ROUTE
PF_LINK = AF_LINK
pseudo_PF_XTP = pseudo_AF_XTP
PF_INET6 = AF_INET6
PF_MAX = AF_MAX
SOMAXCONN = 5
SCM_RIGHTS = 1
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_DONTROUTE = 0x4
MSG_CTRUNC = 0x8
MSG_TRUNC = 0x10
MSG_EOR = 0x30
MSG_WAITALL = 0x20
MSG_MAXIOVLEN = 16
def OPTLEN(x): return ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))

GIARG = 0x1
CONTI = 0x2
GITAB = 0x4
SOCKETSYS = 88
SOCKETSYS = 83
SO_ACCEPT = 1
SO_BIND = 2
SO_CONNECT = 3
SO_GETPEERNAME = 4
SO_GETSOCKNAME = 5
SO_GETSOCKOPT = 6
SO_LISTEN = 7
SO_RECV = 8
SO_RECVFROM = 9
SO_SEND = 10
SO_SENDTO = 11
SO_SETSOCKOPT = 12
SO_SHUTDOWN = 13
SO_SOCKET = 14
SO_SOCKPOLL = 15
SO_GETIPDOMAIN = 16
SO_SETIPDOMAIN = 17
SO_ADJTIME = 18