-
-
Notifications
You must be signed in to change notification settings - Fork 9
unix netdb
IsaacShelton edited this page Nov 13, 2022
·
5 revisions
unix/netdb.adept
contains definitions from <netdb.h>
.
struct hostent (h_name *ubyte, h_aliases **ubyte, h_addrtype int, h_length int, h_addr_list **ubyte)
struct netent (n_name *ubyte, n_aliases **ubyte, n_addrtype int, n_net uint)
struct protoent (p_name *ubyte, p_aliases **ubyte, p_proto int)
struct servent (s_name *ubyte, s_aliases **ubyte, s_port int, s_proto *ubyte)
// NOTE: 'ai_next' is of type 'ptr' because the compiler can't handle self-referencing pointer '*addrinfo'
// Isaac Shelton - Nov 5th 2019
struct addrinfo (ai_flags, ai_family, ai_socktype, ai_protocol int, ai_addrlen socklen_t, ai_canonname *ubyte, ai_addr *sockaddr, ai_next ptr)
external h_errno int
foreign herror(*ubyte) void
foreign hstrerror(int) *ubyte
foreign endhostent() void
foreign endnetent() void
foreign endprotoent() void
foreign endservent() void
foreign freeaddrinfo(*addrinfo) void
foreign gai_strerror(int) *ubyte
foreign getaddrinfo(*ubyte, *ubyte, *addrinfo, **addrinfo) int
foreign gethostbyaddr(ptr, socklen_t, int) *hostent
foreign gethostbyname(*ubyte) *hostent
foreign gethostent() *hostent
foreign getnameinfo(*sockaddr, socklen_t, *ubyte, socklen_t, *ubyte, socklen_t, int) int
foreign getnetbyaddr(uint, int) *netent
foreign getnetbyname(*ubyte) *netent
foreign getnetent() *netent
foreign getprotobyname(*ubyte) *protoent
foreign getprotobynumber(int) *protoent
foreign getprotoent() *protoent
foreign getservbyname(*ubyte, *ubyte) *servent
foreign getservbyport(int, *ubyte) *servent
foreign getservent() *servent
foreign sethostent(int) void
foreign setnetent(int) void
foreign setprotoent() int
foreign setservent(int) void
define IPPORT_RESERVED = 1024
define AI_PASSIVE = 0x00000001
define AI_CANONNAME = 0x00000002
define AI_NUMERICHOST = 0x00000004
define AI_NUMERICSERV = 0x00001000
define AI_V4MAPPED = 0x00000800
define AI_ALL = 0x00000100
define AI_ADDRCONFIG = 0x00000400
define NI_NOFQDN = 0x00000001
define NI_NUMERICHOST = 0x00000002
define NI_NAMEREQD = 0x00000004
define NI_NUMERICSERV = 0x00000008
define NI_NUMERICSCOPE = 0x00000100
define NI_DGRAM = 0x00000010
define EAI_AGAIN = 2
define EAI_BADFLAGS = 3
define EAI_FAIL = 4
define EAI_FAMILY = 5
define EAI_MEMORY = 6
define EAI_NONAME = 8
define EAI_SERVICE = 9
define EAI_SOCKTYPE = 10
define EAI_SYSTEM = 11
define EAI_OVERFLOW = 14
import 'unix/socklen_t.adept'
import 'unix/netinet/in.adept'