massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / _socket.pyi
1 import sys
2 from _typeshed import ReadableBuffer, WriteableBuffer
3 from collections.abc import Iterable
4 from typing import Any, SupportsInt, Tuple, Union, overload
5
6 if sys.version_info >= (3, 8):
7     from typing import SupportsIndex
8
9     _FD = SupportsIndex
10 else:
11     _FD = SupportsInt
12
13 _CMSG = Tuple[int, int, bytes]
14 _CMSGArg = Tuple[int, int, ReadableBuffer]
15
16 # Addresses can be either tuples of varying lengths (AF_INET, AF_INET6,
17 # AF_NETLINK, AF_TIPC) or strings (AF_UNIX).
18 _Address = Union[Tuple[Any, ...], str]
19 _RetAddress = Any
20 # TODO Most methods allow bytes as address objects
21
22 # ----- Constants -----
23 # Some socket families are listed in the "Socket families" section of the docs,
24 # but not the "Constants" section. These are listed at the end of the list of
25 # constants.
26 #
27 # Besides those and the first few constants listed, the constants are listed in
28 # documentation order.
29
30 has_ipv6: bool
31
32 # Per socketmodule.c, only these three families are portable
33 AF_UNIX: int
34 AF_INET: int
35 AF_INET6: int
36
37 SOCK_STREAM: int
38 SOCK_DGRAM: int
39 SOCK_RAW: int
40 SOCK_RDM: int
41 SOCK_SEQPACKET: int
42
43 if sys.platform == "linux":
44     SOCK_CLOEXEC: int
45     SOCK_NONBLOCK: int
46
47 # Address families not mentioned in the docs
48 AF_AAL5: int
49 AF_APPLETALK: int
50 AF_ASH: int
51 AF_ATMPVC: int
52 AF_ATMSVC: int
53 AF_AX25: int
54 AF_BRIDGE: int
55 AF_DECnet: int
56 AF_ECONET: int
57 AF_IPX: int
58 AF_IRDA: int
59 AF_KEY: int
60 AF_LLC: int
61 AF_NETBEUI: int
62 AF_NETROM: int
63 AF_PPPOX: int
64 AF_ROSE: int
65 AF_ROUTE: int
66 AF_SECURITY: int
67 AF_SNA: int
68 AF_SYSTEM: int
69 AF_UNSPEC: int
70 AF_WANPIPE: int
71 AF_X25: int
72
73 # The "many constants" referenced by the docs
74 SOMAXCONN: int
75 AI_ADDRCONFIG: int
76 AI_ALL: int
77 AI_CANONNAME: int
78 AI_DEFAULT: int
79 AI_MASK: int
80 AI_NUMERICHOST: int
81 AI_NUMERICSERV: int
82 AI_PASSIVE: int
83 AI_V4MAPPED: int
84 AI_V4MAPPED_CFG: int
85 EAI_ADDRFAMILY: int
86 EAI_AGAIN: int
87 EAI_BADFLAGS: int
88 EAI_BADHINTS: int
89 EAI_FAIL: int
90 EAI_FAMILY: int
91 EAI_MAX: int
92 EAI_MEMORY: int
93 EAI_NODATA: int
94 EAI_NONAME: int
95 EAI_OVERFLOW: int
96 EAI_PROTOCOL: int
97 EAI_SERVICE: int
98 EAI_SOCKTYPE: int
99 EAI_SYSTEM: int
100 INADDR_ALLHOSTS_GROUP: int
101 INADDR_ANY: int
102 INADDR_BROADCAST: int
103 INADDR_LOOPBACK: int
104 INADDR_MAX_LOCAL_GROUP: int
105 INADDR_NONE: int
106 INADDR_UNSPEC_GROUP: int
107 IPPORT_RESERVED: int
108 IPPORT_USERRESERVED: int
109 IPPROTO_AH: int
110 IPPROTO_BIP: int
111 IPPROTO_DSTOPTS: int
112 IPPROTO_EGP: int
113 IPPROTO_EON: int
114 IPPROTO_ESP: int
115 IPPROTO_FRAGMENT: int
116 IPPROTO_GGP: int
117 IPPROTO_GRE: int
118 IPPROTO_HELLO: int
119 IPPROTO_HOPOPTS: int
120 IPPROTO_ICMP: int
121 IPPROTO_ICMPV6: int
122 IPPROTO_IDP: int
123 IPPROTO_IGMP: int
124 IPPROTO_IP: int
125 IPPROTO_IPCOMP: int
126 IPPROTO_IPIP: int
127 IPPROTO_IPV4: int
128 IPPROTO_IPV6: int
129 IPPROTO_MAX: int
130 IPPROTO_MOBILE: int
131 IPPROTO_ND: int
132 IPPROTO_NONE: int
133 IPPROTO_PIM: int
134 IPPROTO_PUP: int
135 IPPROTO_RAW: int
136 IPPROTO_ROUTING: int
137 IPPROTO_RSVP: int
138 IPPROTO_SCTP: int
139 IPPROTO_TCP: int
140 IPPROTO_TP: int
141 IPPROTO_UDP: int
142 IPPROTO_VRRP: int
143 IPPROTO_XTP: int
144 IPV6_CHECKSUM: int
145 IPV6_DONTFRAG: int
146 IPV6_DSTOPTS: int
147 IPV6_HOPLIMIT: int
148 IPV6_HOPOPTS: int
149 IPV6_JOIN_GROUP: int
150 IPV6_LEAVE_GROUP: int
151 IPV6_MULTICAST_HOPS: int
152 IPV6_MULTICAST_IF: int
153 IPV6_MULTICAST_LOOP: int
154 IPV6_NEXTHOP: int
155 IPV6_PATHMTU: int
156 IPV6_PKTINFO: int
157 IPV6_RECVDSTOPTS: int
158 IPV6_RECVHOPLIMIT: int
159 IPV6_RECVHOPOPTS: int
160 IPV6_RECVPATHMTU: int
161 IPV6_RECVPKTINFO: int
162 IPV6_RECVRTHDR: int
163 IPV6_RECVTCLASS: int
164 IPV6_RTHDR: int
165 IPV6_RTHDRDSTOPTS: int
166 IPV6_RTHDR_TYPE_0: int
167 IPV6_TCLASS: int
168 IPV6_UNICAST_HOPS: int
169 IPV6_USE_MIN_MTU: int
170 IPV6_V6ONLY: int
171 IPX_TYPE: int
172 IP_ADD_MEMBERSHIP: int
173 IP_DEFAULT_MULTICAST_LOOP: int
174 IP_DEFAULT_MULTICAST_TTL: int
175 IP_DROP_MEMBERSHIP: int
176 IP_HDRINCL: int
177 IP_MAX_MEMBERSHIPS: int
178 IP_MULTICAST_IF: int
179 IP_MULTICAST_LOOP: int
180 IP_MULTICAST_TTL: int
181 IP_OPTIONS: int
182 IP_RECVDSTADDR: int
183 IP_RECVOPTS: int
184 IP_RECVRETOPTS: int
185 IP_RETOPTS: int
186 IP_TOS: int
187 IP_TRANSPARENT: int
188 IP_TTL: int
189 LOCAL_PEERCRED: int
190 MSG_BCAST: int
191 MSG_BTAG: int
192 MSG_CMSG_CLOEXEC: int
193 MSG_CONFIRM: int
194 MSG_CTRUNC: int
195 MSG_DONTROUTE: int
196 MSG_DONTWAIT: int
197 MSG_EOF: int
198 MSG_EOR: int
199 MSG_ERRQUEUE: int
200 MSG_ETAG: int
201 MSG_FASTOPEN: int
202 MSG_MCAST: int
203 MSG_MORE: int
204 MSG_NOSIGNAL: int
205 MSG_NOTIFICATION: int
206 MSG_OOB: int
207 MSG_PEEK: int
208 MSG_TRUNC: int
209 MSG_WAITALL: int
210 NI_DGRAM: int
211 NI_MAXHOST: int
212 NI_MAXSERV: int
213 NI_NAMEREQD: int
214 NI_NOFQDN: int
215 NI_NUMERICHOST: int
216 NI_NUMERICSERV: int
217 SCM_CREDENTIALS: int
218 SCM_CREDS: int
219 SCM_RIGHTS: int
220 SHUT_RD: int
221 SHUT_RDWR: int
222 SHUT_WR: int
223 SOL_ATALK: int
224 SOL_AX25: int
225 SOL_HCI: int
226 SOL_IP: int
227 SOL_IPX: int
228 SOL_NETROM: int
229 SOL_ROSE: int
230 SOL_SOCKET: int
231 SOL_TCP: int
232 SOL_UDP: int
233 SO_ACCEPTCONN: int
234 SO_BINDTODEVICE: int
235 SO_BROADCAST: int
236 SO_DEBUG: int
237 SO_DONTROUTE: int
238 SO_ERROR: int
239 SO_EXCLUSIVEADDRUSE: int
240 SO_KEEPALIVE: int
241 SO_LINGER: int
242 SO_MARK: int
243 SO_OOBINLINE: int
244 SO_PASSCRED: int
245 SO_PEERCRED: int
246 SO_PRIORITY: int
247 SO_RCVBUF: int
248 SO_RCVLOWAT: int
249 SO_RCVTIMEO: int
250 SO_REUSEADDR: int
251 SO_REUSEPORT: int
252 SO_SETFIB: int
253 SO_SNDBUF: int
254 SO_SNDLOWAT: int
255 SO_SNDTIMEO: int
256 SO_TYPE: int
257 SO_USELOOPBACK: int
258 TCP_CORK: int
259 TCP_DEFER_ACCEPT: int
260 TCP_FASTOPEN: int
261 TCP_INFO: int
262 TCP_KEEPCNT: int
263 TCP_KEEPIDLE: int
264 TCP_KEEPINTVL: int
265 TCP_LINGER2: int
266 TCP_MAXSEG: int
267 TCP_NODELAY: int
268 TCP_QUICKACK: int
269 TCP_SYNCNT: int
270 TCP_WINDOW_CLAMP: int
271 if sys.version_info >= (3, 7):
272     TCP_NOTSENT_LOWAT: int
273
274 # Specifically-documented constants
275
276 if sys.platform == "linux":
277     AF_CAN: int
278     PF_CAN: int
279     SOL_CAN_BASE: int
280     SOL_CAN_RAW: int
281     CAN_EFF_FLAG: int
282     CAN_EFF_MASK: int
283     CAN_ERR_FLAG: int
284     CAN_ERR_MASK: int
285     CAN_RAW: int
286     CAN_RAW_ERR_FILTER: int
287     CAN_RAW_FILTER: int
288     CAN_RAW_LOOPBACK: int
289     CAN_RAW_RECV_OWN_MSGS: int
290     CAN_RTR_FLAG: int
291     CAN_SFF_MASK: int
292
293     CAN_BCM: int
294     CAN_BCM_TX_SETUP: int
295     CAN_BCM_TX_DELETE: int
296     CAN_BCM_TX_READ: int
297     CAN_BCM_TX_SEND: int
298     CAN_BCM_RX_SETUP: int
299     CAN_BCM_RX_DELETE: int
300     CAN_BCM_RX_READ: int
301     CAN_BCM_TX_STATUS: int
302     CAN_BCM_TX_EXPIRED: int
303     CAN_BCM_RX_STATUS: int
304     CAN_BCM_RX_TIMEOUT: int
305     CAN_BCM_RX_CHANGED: int
306
307     CAN_RAW_FD_FRAMES: int
308
309 if sys.platform == "linux" and sys.version_info >= (3, 8):
310     CAN_BCM_SETTIMER: int
311     CAN_BCM_STARTTIMER: int
312     CAN_BCM_TX_COUNTEVT: int
313     CAN_BCM_TX_ANNOUNCE: int
314     CAN_BCM_TX_CP_CAN_ID: int
315     CAN_BCM_RX_FILTER_ID: int
316     CAN_BCM_RX_CHECK_DLC: int
317     CAN_BCM_RX_NO_AUTOTIMER: int
318     CAN_BCM_RX_ANNOUNCE_RESUME: int
319     CAN_BCM_TX_RESET_MULTI_IDX: int
320     CAN_BCM_RX_RTR_FRAME: int
321     CAN_BCM_CAN_FD_FRAME: int
322
323 if sys.platform == "linux" and sys.version_info >= (3, 7):
324     CAN_ISOTP: int
325
326 if sys.platform == "linux" and sys.version_info >= (3, 9):
327     CAN_J1939: int
328     CAN_RAW_JOIN_FILTERS: int
329
330     J1939_MAX_UNICAST_ADDR: int
331     J1939_IDLE_ADDR: int
332     J1939_NO_ADDR: int
333     J1939_NO_NAME: int
334     J1939_PGN_REQUEST: int
335     J1939_PGN_ADDRESS_CLAIMED: int
336     J1939_PGN_ADDRESS_COMMANDED: int
337     J1939_PGN_PDU1_MAX: int
338     J1939_PGN_MAX: int
339     J1939_NO_PGN: int
340
341     SO_J1939_FILTER: int
342     SO_J1939_PROMISC: int
343     SO_J1939_SEND_PRIO: int
344     SO_J1939_ERRQUEUE: int
345
346     SCM_J1939_DEST_ADDR: int
347     SCM_J1939_DEST_NAME: int
348     SCM_J1939_PRIO: int
349     SCM_J1939_ERRQUEUE: int
350
351     J1939_NLA_PAD: int
352     J1939_NLA_BYTES_ACKED: int
353
354     J1939_EE_INFO_NONE: int
355     J1939_EE_INFO_TX_ABORT: int
356
357     J1939_FILTER_MAX: int
358
359 if sys.platform == "linux":
360     AF_PACKET: int
361     PF_PACKET: int
362     PACKET_BROADCAST: int
363     PACKET_FASTROUTE: int
364     PACKET_HOST: int
365     PACKET_LOOPBACK: int
366     PACKET_MULTICAST: int
367     PACKET_OTHERHOST: int
368     PACKET_OUTGOING: int
369
370 if sys.platform == "linux":
371     AF_RDS: int
372     PF_RDS: int
373     SOL_RDS: int
374     RDS_CANCEL_SENT_TO: int
375     RDS_CMSG_RDMA_ARGS: int
376     RDS_CMSG_RDMA_DEST: int
377     RDS_CMSG_RDMA_MAP: int
378     RDS_CMSG_RDMA_STATUS: int
379     RDS_CMSG_RDMA_UPDATE: int
380     RDS_CONG_MONITOR: int
381     RDS_FREE_MR: int
382     RDS_GET_MR: int
383     RDS_GET_MR_FOR_DEST: int
384     RDS_RDMA_DONTWAIT: int
385     RDS_RDMA_FENCE: int
386     RDS_RDMA_INVALIDATE: int
387     RDS_RDMA_NOTIFY_ME: int
388     RDS_RDMA_READWRITE: int
389     RDS_RDMA_SILENT: int
390     RDS_RDMA_USE_ONCE: int
391     RDS_RECVERR: int
392
393 if sys.platform == "win32":
394     SIO_RCVALL: int
395     SIO_KEEPALIVE_VALS: int
396     SIO_LOOPBACK_FAST_PATH: int
397     RCVALL_IPLEVEL: int
398     RCVALL_MAX: int
399     RCVALL_OFF: int
400     RCVALL_ON: int
401     RCVALL_SOCKETLEVELONLY: int
402
403 if sys.platform == "linux":
404     AF_TIPC: int
405     SOL_TIPC: int
406     TIPC_ADDR_ID: int
407     TIPC_ADDR_NAME: int
408     TIPC_ADDR_NAMESEQ: int
409     TIPC_CFG_SRV: int
410     TIPC_CLUSTER_SCOPE: int
411     TIPC_CONN_TIMEOUT: int
412     TIPC_CRITICAL_IMPORTANCE: int
413     TIPC_DEST_DROPPABLE: int
414     TIPC_HIGH_IMPORTANCE: int
415     TIPC_IMPORTANCE: int
416     TIPC_LOW_IMPORTANCE: int
417     TIPC_MEDIUM_IMPORTANCE: int
418     TIPC_NODE_SCOPE: int
419     TIPC_PUBLISHED: int
420     TIPC_SRC_DROPPABLE: int
421     TIPC_SUBSCR_TIMEOUT: int
422     TIPC_SUB_CANCEL: int
423     TIPC_SUB_PORTS: int
424     TIPC_SUB_SERVICE: int
425     TIPC_TOP_SRV: int
426     TIPC_WAIT_FOREVER: int
427     TIPC_WITHDRAWN: int
428     TIPC_ZONE_SCOPE: int
429
430 if sys.platform == "linux":
431     AF_ALG: int
432     SOL_ALG: int
433     ALG_OP_DECRYPT: int
434     ALG_OP_ENCRYPT: int
435     ALG_OP_SIGN: int
436     ALG_OP_VERIFY: int
437     ALG_SET_AEAD_ASSOCLEN: int
438     ALG_SET_AEAD_AUTHSIZE: int
439     ALG_SET_IV: int
440     ALG_SET_KEY: int
441     ALG_SET_OP: int
442     ALG_SET_PUBKEY: int
443
444 if sys.platform == "linux" and sys.version_info >= (3, 7):
445     AF_VSOCK: int
446     IOCTL_VM_SOCKETS_GET_LOCAL_CID: int
447     VMADDR_CID_ANY: int
448     VMADDR_CID_HOST: int
449     VMADDR_PORT_ANY: int
450     SO_VM_SOCKETS_BUFFER_MAX_SIZE: int
451     SO_VM_SOCKETS_BUFFER_SIZE: int
452     SO_VM_SOCKETS_BUFFER_MIN_SIZE: int
453     VM_SOCKETS_INVALID_VERSION: int
454
455 AF_LINK: int  # Availability: BSD, macOS
456
457 # BDADDR_* and HCI_* listed with other bluetooth constants below
458
459 SO_DOMAIN: int
460 SO_PASSSEC: int
461 SO_PEERSEC: int
462 SO_PROTOCOL: int
463 TCP_CONGESTION: int
464 TCP_USER_TIMEOUT: int
465
466 if sys.platform == "linux" and sys.version_info >= (3, 8):
467     AF_QIPCRTR: int
468
469 # Semi-documented constants
470 # (Listed under "Socket families" in the docs, but not "Constants")
471
472 if sys.platform == "linux":
473     # Netlink is defined by Linux
474     AF_NETLINK: int
475     NETLINK_ARPD: int
476     NETLINK_CRYPTO: int
477     NETLINK_DNRTMSG: int
478     NETLINK_FIREWALL: int
479     NETLINK_IP6_FW: int
480     NETLINK_NFLOG: int
481     NETLINK_ROUTE6: int
482     NETLINK_ROUTE: int
483     NETLINK_SKIP: int
484     NETLINK_TAPBASE: int
485     NETLINK_TCPDIAG: int
486     NETLINK_USERSOCK: int
487     NETLINK_W1: int
488     NETLINK_XFRM: int
489
490 if sys.platform != "win32" and sys.platform != "darwin":
491     # Linux and some BSD support is explicit in the docs
492     # Windows and macOS do not support in practice
493     AF_BLUETOOTH: int
494     BTPROTO_HCI: int
495     BTPROTO_L2CAP: int
496     BTPROTO_RFCOMM: int
497     BTPROTO_SCO: int  # not in FreeBSD
498
499     BDADDR_ANY: str
500     BDADDR_LOCAL: str
501
502     HCI_FILTER: int  # not in NetBSD or DragonFlyBSD
503     # not in FreeBSD, NetBSD, or DragonFlyBSD
504     HCI_TIME_STAMP: int
505     HCI_DATA_DIR: int
506
507 if sys.platform == "darwin":
508     # PF_SYSTEM is defined by macOS
509     PF_SYSTEM: int
510     SYSPROTO_CONTROL: int
511
512 # ----- Exceptions -----
513
514 error = OSError
515
516 class herror(error): ...
517 class gaierror(error): ...
518
519 if sys.version_info >= (3, 10):
520     timeout = TimeoutError
521 else:
522     class timeout(error): ...
523
524 # ----- Classes -----
525
526 class socket:
527     family: int
528     type: int
529     proto: int
530     def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
531     def bind(self, __address: _Address | bytes) -> None: ...
532     def close(self) -> None: ...
533     def connect(self, __address: _Address | bytes) -> None: ...
534     def connect_ex(self, __address: _Address | bytes) -> int: ...
535     def detach(self) -> int: ...
536     def fileno(self) -> int: ...
537     def getpeername(self) -> _RetAddress: ...
538     def getsockname(self) -> _RetAddress: ...
539     @overload
540     def getsockopt(self, __level: int, __optname: int) -> int: ...
541     @overload
542     def getsockopt(self, __level: int, __optname: int, __buflen: int) -> bytes: ...
543     if sys.version_info >= (3, 7):
544         def getblocking(self) -> bool: ...
545     def gettimeout(self) -> float | None: ...
546     if sys.platform == "win32":
547         def ioctl(self, __control: int, __option: int | tuple[int, int, int] | bool) -> None: ...
548     def listen(self, __backlog: int = ...) -> None: ...
549     def recv(self, __bufsize: int, __flags: int = ...) -> bytes: ...
550     def recvfrom(self, __bufsize: int, __flags: int = ...) -> tuple[bytes, _RetAddress]: ...
551     if sys.platform != "win32":
552         def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> tuple[bytes, list[_CMSG], int, Any]: ...
553         def recvmsg_into(
554             self, __buffers: Iterable[WriteableBuffer], __ancbufsize: int = ..., __flags: int = ...
555         ) -> tuple[int, list[_CMSG], int, Any]: ...
556     def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
557     def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
558     def send(self, __data: ReadableBuffer, __flags: int = ...) -> int: ...
559     def sendall(self, __data: ReadableBuffer, __flags: int = ...) -> None: ...
560     @overload
561     def sendto(self, __data: ReadableBuffer, __address: _Address) -> int: ...
562     @overload
563     def sendto(self, __data: ReadableBuffer, __flags: int, __address: _Address) -> int: ...
564     if sys.platform != "win32":
565         def sendmsg(
566             self,
567             __buffers: Iterable[ReadableBuffer],
568             __ancdata: Iterable[_CMSGArg] = ...,
569             __flags: int = ...,
570             __address: _Address = ...,
571         ) -> int: ...
572     if sys.platform == "linux":
573         def sendmsg_afalg(
574             self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
575         ) -> int: ...
576     def setblocking(self, __flag: bool) -> None: ...
577     def settimeout(self, __value: float | None) -> None: ...
578     @overload
579     def setsockopt(self, __level: int, __optname: int, __value: int | bytes) -> None: ...
580     @overload
581     def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ...
582     if sys.platform == "win32":
583         def share(self, __process_id: int) -> bytes: ...
584     def shutdown(self, __how: int) -> None: ...
585
586 SocketType = socket
587
588 # ----- Functions -----
589
590 if sys.version_info >= (3, 7):
591     def close(__fd: _FD) -> None: ...
592
593 def dup(__fd: _FD) -> int: ...
594
595 # the 5th tuple item is an address
596 def getaddrinfo(
597     host: bytes | str | None,
598     port: bytes | str | int | None,
599     family: int = ...,
600     type: int = ...,
601     proto: int = ...,
602     flags: int = ...,
603 ) -> list[tuple[int, int, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
604 def gethostbyname(__hostname: str) -> str: ...
605 def gethostbyname_ex(__hostname: str) -> tuple[str, list[str], list[str]]: ...
606 def gethostname() -> str: ...
607 def gethostbyaddr(__ip_address: str) -> tuple[str, list[str], list[str]]: ...
608 def getnameinfo(__sockaddr: tuple[str, int] | tuple[str, int, int, int], __flags: int) -> tuple[str, str]: ...
609 def getprotobyname(__protocolname: str) -> int: ...
610 def getservbyname(__servicename: str, __protocolname: str = ...) -> int: ...
611 def getservbyport(__port: int, __protocolname: str = ...) -> str: ...
612 def ntohl(__x: int) -> int: ...  # param & ret val are 32-bit ints
613 def ntohs(__x: int) -> int: ...  # param & ret val are 16-bit ints
614 def htonl(__x: int) -> int: ...  # param & ret val are 32-bit ints
615 def htons(__x: int) -> int: ...  # param & ret val are 16-bit ints
616 def inet_aton(__ip_string: str) -> bytes: ...  # ret val 4 bytes in length
617 def inet_ntoa(__packed_ip: bytes) -> str: ...
618 def inet_pton(__address_family: int, __ip_string: str) -> bytes: ...
619 def inet_ntop(__address_family: int, __packed_ip: bytes) -> str: ...
620 def CMSG_LEN(__length: int) -> int: ...
621 def CMSG_SPACE(__length: int) -> int: ...
622 def getdefaulttimeout() -> float | None: ...
623 def setdefaulttimeout(__timeout: float | None) -> None: ...
624 def socketpair(__family: int = ..., __type: int = ..., __proto: int = ...) -> tuple[socket, socket]: ...
625
626 if sys.platform != "win32":
627     def sethostname(__name: str) -> None: ...
628
629 # Windows added these in 3.8, but didn't have them before
630 if sys.platform != "win32" or sys.version_info >= (3, 8):
631     def if_nameindex() -> list[tuple[int, str]]: ...
632     def if_nametoindex(__name: str) -> int: ...
633     def if_indextoname(__index: int) -> str: ...