-
-
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) voidforeign hstrerror(int) *ubyteforeign endhostent() voidforeign endnetent() voidforeign endprotoent() voidforeign endservent() voidforeign freeaddrinfo(*addrinfo) voidforeign gai_strerror(int) *ubyteforeign getaddrinfo(*ubyte, *ubyte, *addrinfo, **addrinfo) intforeign gethostbyaddr(ptr, socklen_t, int) *hostentforeign gethostbyname(*ubyte) *hostentforeign gethostent() *hostentforeign getnameinfo(*sockaddr, socklen_t, *ubyte, socklen_t, *ubyte, socklen_t, int) intforeign getnetbyaddr(uint, int) *netentforeign getnetbyname(*ubyte) *netentforeign getnetent() *netentforeign getprotobyname(*ubyte) *protoentforeign getprotobynumber(int) *protoentforeign getprotoent() *protoentforeign getservbyname(*ubyte, *ubyte) *serventforeign getservbyport(int, *ubyte) *serventforeign getservent() *serventforeign sethostent(int) voidforeign setnetent(int) voidforeign setprotoent() intforeign 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'