123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715 |
-
- #ifndef _NETDB_H
- #define _NETDB_H 1
- #include <features.h>
- #include <netinet/in.h>
- #include <stdint.h>
- #ifdef __USE_MISC
- # include <rpc/netdb.h>
- #endif
- #ifdef __USE_GNU
- # define __need_sigevent_t
- # include <bits/siginfo.h>
- # define __need_timespec
- # include <time.h>
- #endif
- #include <bits/netdb.h>
- #define _PATH_HEQUIV "/etc/hosts.equiv"
- #define _PATH_HOSTS "/etc/hosts"
- #define _PATH_NETWORKS "/etc/networks"
- #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
- #define _PATH_PROTOCOLS "/etc/protocols"
- #define _PATH_SERVICES "/etc/services"
- __BEGIN_DECLS
- #if defined __USE_MISC || !defined __USE_XOPEN2K8
- # define h_errno (*__h_errno_location ())
- extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
- # define HOST_NOT_FOUND 1
- # define TRY_AGAIN 2
- # define NO_RECOVERY 3
- # define NO_DATA 4
- #endif
- #ifdef __USE_MISC
- # define NETDB_INTERNAL -1
- # define NETDB_SUCCESS 0
- # define NO_ADDRESS NO_DATA
- #endif
- #if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED
- # define IPPORT_RESERVED 1024
- #endif
- #ifdef __USE_GNU
- # define SCOPE_DELIMITER '%'
- #endif
- #ifdef __USE_MISC
- extern void herror (const char *__str) __THROW;
- extern const char *hstrerror (int __err_num) __THROW;
- #endif
- struct hostent
- {
- char *h_name;
- char **h_aliases;
- int h_addrtype;
- int h_length;
- char **h_addr_list;
- #ifdef __USE_MISC
- # define h_addr h_addr_list[0]
- #endif
- };
- extern void sethostent (int __stay_open);
- extern void endhostent (void);
- extern struct hostent *gethostent (void);
- extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len,
- int __type);
- extern struct hostent *gethostbyname (const char *__name);
- #ifdef __USE_MISC
- extern struct hostent *gethostbyname2 (const char *__name, int __af);
- extern int gethostent_r (struct hostent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct hostent **__restrict __result,
- int *__restrict __h_errnop);
- extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len,
- int __type,
- struct hostent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct hostent **__restrict __result,
- int *__restrict __h_errnop);
- extern int gethostbyname_r (const char *__restrict __name,
- struct hostent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct hostent **__restrict __result,
- int *__restrict __h_errnop);
- extern int gethostbyname2_r (const char *__restrict __name, int __af,
- struct hostent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct hostent **__restrict __result,
- int *__restrict __h_errnop);
- #endif
- extern void setnetent (int __stay_open);
- extern void endnetent (void);
- extern struct netent *getnetent (void);
- extern struct netent *getnetbyaddr (uint32_t __net, int __type);
- extern struct netent *getnetbyname (const char *__name);
- #ifdef __USE_MISC
- extern int getnetent_r (struct netent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct netent **__restrict __result,
- int *__restrict __h_errnop);
- extern int getnetbyaddr_r (uint32_t __net, int __type,
- struct netent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct netent **__restrict __result,
- int *__restrict __h_errnop);
- extern int getnetbyname_r (const char *__restrict __name,
- struct netent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct netent **__restrict __result,
- int *__restrict __h_errnop);
- #endif
- struct servent
- {
- char *s_name;
- char **s_aliases;
- int s_port;
- char *s_proto;
- };
- extern void setservent (int __stay_open);
- extern void endservent (void);
- extern struct servent *getservent (void);
- extern struct servent *getservbyname (const char *__name, const char *__proto);
- extern struct servent *getservbyport (int __port, const char *__proto);
- #ifdef __USE_MISC
- extern int getservent_r (struct servent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct servent **__restrict __result);
- extern int getservbyname_r (const char *__restrict __name,
- const char *__restrict __proto,
- struct servent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct servent **__restrict __result);
- extern int getservbyport_r (int __port, const char *__restrict __proto,
- struct servent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct servent **__restrict __result);
- #endif
- struct protoent
- {
- char *p_name;
- char **p_aliases;
- int p_proto;
- };
- extern void setprotoent (int __stay_open);
- extern void endprotoent (void);
- extern struct protoent *getprotoent (void);
- extern struct protoent *getprotobyname (const char *__name);
- extern struct protoent *getprotobynumber (int __proto);
- #ifdef __USE_MISC
- extern int getprotoent_r (struct protoent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct protoent **__restrict __result);
- extern int getprotobyname_r (const char *__restrict __name,
- struct protoent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct protoent **__restrict __result);
- extern int getprotobynumber_r (int __proto,
- struct protoent *__restrict __result_buf,
- char *__restrict __buf, size_t __buflen,
- struct protoent **__restrict __result);
- extern int setnetgrent (const char *__netgroup);
- extern void endnetgrent (void);
- extern int getnetgrent (char **__restrict __hostp,
- char **__restrict __userp,
- char **__restrict __domainp);
- extern int innetgr (const char *__netgroup, const char *__host,
- const char *__user, const char *__domain);
- extern int getnetgrent_r (char **__restrict __hostp,
- char **__restrict __userp,
- char **__restrict __domainp,
- char *__restrict __buffer, size_t __buflen);
- #endif
- #ifdef __USE_MISC
- extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
- const char *__restrict __locuser,
- const char *__restrict __remuser,
- const char *__restrict __cmd, int *__restrict __fd2p);
- extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
- const char *__restrict __locuser,
- const char *__restrict __remuser,
- const char *__restrict __cmd, int *__restrict __fd2p,
- sa_family_t __af);
- extern int rexec (char **__restrict __ahost, int __rport,
- const char *__restrict __name,
- const char *__restrict __pass,
- const char *__restrict __cmd, int *__restrict __fd2p);
- extern int rexec_af (char **__restrict __ahost, int __rport,
- const char *__restrict __name,
- const char *__restrict __pass,
- const char *__restrict __cmd, int *__restrict __fd2p,
- sa_family_t __af);
- extern int ruserok (const char *__rhost, int __suser,
- const char *__remuser, const char *__locuser);
- extern int ruserok_af (const char *__rhost, int __suser,
- const char *__remuser, const char *__locuser,
- sa_family_t __af);
- extern int iruserok (uint32_t __raddr, int __suser,
- const char *__remuser, const char *__locuser);
- extern int iruserok_af (const void *__raddr, int __suser,
- const char *__remuser, const char *__locuser,
- sa_family_t __af);
- extern int rresvport (int *__alport);
- extern int rresvport_af (int *__alport, sa_family_t __af);
- #endif
- #ifdef __USE_XOPEN2K
- struct addrinfo
- {
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- socklen_t ai_addrlen;
- struct sockaddr *ai_addr;
- char *ai_canonname;
- struct addrinfo *ai_next;
- };
- # ifdef __USE_GNU
- struct gaicb
- {
- const char *ar_name;
- const char *ar_service;
- const struct addrinfo *ar_request;
- struct addrinfo *ar_result;
-
- int __return;
- int __glibc_reserved[5];
- };
- # define GAI_WAIT 0
- # define GAI_NOWAIT 1
- # endif
- # define AI_PASSIVE 0x0001
- # define AI_CANONNAME 0x0002
- # define AI_NUMERICHOST 0x0004
- # define AI_V4MAPPED 0x0008
- # define AI_ALL 0x0010
- # define AI_ADDRCONFIG 0x0020
- # ifdef __USE_GNU
- # define AI_IDN 0x0040
- # define AI_CANONIDN 0x0080
- # define AI_IDN_ALLOW_UNASSIGNED 0x0100
- # define AI_IDN_USE_STD3_ASCII_RULES 0x0200
- # endif
- # define AI_NUMERICSERV 0x0400
- # define EAI_BADFLAGS -1
- # define EAI_NONAME -2
- # define EAI_AGAIN -3
- # define EAI_FAIL -4
- # define EAI_FAMILY -6
- # define EAI_SOCKTYPE -7
- # define EAI_SERVICE -8
- # define EAI_MEMORY -10
- # define EAI_SYSTEM -11
- # define EAI_OVERFLOW -12
- # ifdef __USE_GNU
- # define EAI_NODATA -5
- # define EAI_ADDRFAMILY -9
- # define EAI_INPROGRESS -100
- # define EAI_CANCELED -101
- # define EAI_NOTCANCELED -102
- # define EAI_ALLDONE -103
- # define EAI_INTR -104
- # define EAI_IDN_ENCODE -105
- # endif
- # ifdef __USE_MISC
- # define NI_MAXHOST 1025
- # define NI_MAXSERV 32
- # endif
- # define NI_NUMERICHOST 1
- # define NI_NUMERICSERV 2
- # define NI_NOFQDN 4
- # define NI_NAMEREQD 8
- # define NI_DGRAM 16
- # ifdef __USE_GNU
- # define NI_IDN 32
- # define NI_IDN_ALLOW_UNASSIGNED 64
- # define NI_IDN_USE_STD3_ASCII_RULES 128
- # endif
- extern int getaddrinfo (const char *__restrict __name,
- const char *__restrict __service,
- const struct addrinfo *__restrict __req,
- struct addrinfo **__restrict __pai);
- extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
- extern const char *gai_strerror (int __ecode) __THROW;
- extern int getnameinfo (const struct sockaddr *__restrict __sa,
- socklen_t __salen, char *__restrict __host,
- socklen_t __hostlen, char *__restrict __serv,
- socklen_t __servlen, int __flags);
- #endif
- #ifdef __USE_GNU
- extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
- int __ent, struct sigevent *__restrict __sig);
- extern int gai_suspend (const struct gaicb *const __list[], int __ent,
- const struct timespec *__timeout);
- extern int gai_error (struct gaicb *__req) __THROW;
- extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
- #endif
- __END_DECLS
- #endif
|