X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fnetwork%2Flookup.h;h=ef6627256756abc3eb50850183c095e99f7fe430;hb=db505b794c697631f65e6b91ff106496debb86ac;hp=69419115b3f20ee37f80ffd2fa5a5f922c3f7e16;hpb=c63c98a6067030a25a42703db1209ccbcc74803a;p=musl diff --git a/src/network/lookup.h b/src/network/lookup.h index 69419115..ef662725 100644 --- a/src/network/lookup.h +++ b/src/network/lookup.h @@ -2,6 +2,20 @@ #define LOOKUP_H #include +#include +#include +#include +#include + +struct aibuf { + struct addrinfo ai; + union sa { + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + } sa; + volatile int lock[1]; + short slot, ref; +}; struct address { int family; @@ -15,14 +29,27 @@ struct service { unsigned char proto, socktype; }; +#define MAXNS 3 + +struct resolvconf { + struct address ns[MAXNS]; + unsigned nns, attempts, ndots; + unsigned timeout; +}; + /* The limit of 48 results is a non-sharp bound on the number of addresses * that can fit in one 512-byte DNS packet full of v4 results and a second * packet full of v6 results. Due to headers, the actual limit is lower. */ #define MAXADDRS 48 #define MAXSERVS 2 -int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int proto, int socktype, int flags); -int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags); -int __lookup_ipliteral(struct address buf[static 1], const char *name, int family); +hidden int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int proto, int socktype, int flags); +hidden int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags); +hidden int __lookup_ipliteral(struct address buf[static 1], const char *name, int family); + +hidden int __get_resolv_conf(struct resolvconf *, char *, size_t); +hidden int __res_msend_rc(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int, const struct resolvconf *); + +hidden int __dns_parse(const unsigned char *, int, int (*)(void *, int, const void *, int, const void *), void *); #endif