X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fnetwork%2Flookup.h;h=54b2f8b5bff1bdcd5290fdd5de9f4699a50ce0c4;hb=83b858f83b658bd34eca5d8ad4d145f673ae7e5e;hp=19c9e488a21361b86f2a24e123e9582817362258;hpb=01dc3f4fea73e4df31cc3e3bb1cd5580fc0d7938;p=musl diff --git a/src/network/lookup.h b/src/network/lookup.h index 19c9e488..54b2f8b5 100644 --- a/src/network/lookup.h +++ b/src/network/lookup.h @@ -2,16 +2,39 @@ #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; unsigned scopeid; uint8_t addr[16]; + int sortkey; }; struct service { uint16_t port; - char proto; + 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 @@ -20,8 +43,13 @@ struct service { #define MAXADDRS 48 #define MAXSERVS 2 -int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int proto, 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 *, int), void *); #endif