apply hidden visibility to various remaining internal interfaces
[musl] / src / network / lookup.h
1 #ifndef LOOKUP_H
2 #define LOOKUP_H
3
4 #include <stdint.h>
5 #include <stddef.h>
6 #include <features.h>
7
8 struct address {
9         int family;
10         unsigned scopeid;
11         uint8_t addr[16];
12         int sortkey;
13 };
14
15 struct service {
16         uint16_t port;
17         unsigned char proto, socktype;
18 };
19
20 #define MAXNS 3
21
22 struct resolvconf {
23         struct address ns[MAXNS];
24         unsigned nns, attempts, ndots;
25         unsigned timeout;
26 };
27
28 /* The limit of 48 results is a non-sharp bound on the number of addresses
29  * that can fit in one 512-byte DNS packet full of v4 results and a second
30  * packet full of v6 results. Due to headers, the actual limit is lower. */
31 #define MAXADDRS 48
32 #define MAXSERVS 2
33
34 hidden int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int proto, int socktype, int flags);
35 hidden int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags);
36 hidden int __lookup_ipliteral(struct address buf[static 1], const char *name, int family);
37
38 hidden int __get_resolv_conf(struct resolvconf *, char *, size_t);
39 hidden int __res_msend_rc(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int, const struct resolvconf *);
40
41 hidden int __dns_parse(const unsigned char *, int, int (*)(void *, int, const void *, int, const void *), void *);
42
43 #endif