util.h revision 1.9 1 1.1 dyoung #ifndef _IFCONFIG_UTIL_H
2 1.1 dyoung #define _IFCONFIG_UTIL_H
3 1.1 dyoung
4 1.6 dyoung #include <netinet/in.h>
5 1.8 dyoung #include <sys/types.h>
6 1.8 dyoung #include <sys/socket.h>
7 1.8 dyoung #include <ifaddrs.h>
8 1.6 dyoung
9 1.1 dyoung #include "parse.h"
10 1.1 dyoung
11 1.1 dyoung struct afswtch {
12 1.1 dyoung const char *af_name;
13 1.1 dyoung short af_af;
14 1.2 dyoung void (*af_status)(prop_dictionary_t, prop_dictionary_t, bool);
15 1.3 dyoung void (*af_addr_commit)(prop_dictionary_t, prop_dictionary_t);
16 1.6 dyoung SIMPLEQ_ENTRY(afswtch) af_next;
17 1.1 dyoung };
18 1.1 dyoung
19 1.7 dyoung void print_link_addresses(prop_dictionary_t, bool);
20 1.9 dyoung const char *get_string(const char *, const char *, u_int8_t *, int *, bool);
21 1.1 dyoung const struct afswtch *lookup_af_byname(const char *);
22 1.1 dyoung const struct afswtch *lookup_af_bynum(int);
23 1.1 dyoung void print_string(const u_int8_t *, int);
24 1.1 dyoung int getsock(int);
25 1.1 dyoung struct paddr_prefix *prefixlen_to_mask(int, int);
26 1.4 dyoung int direct_ioctl(prop_dictionary_t, unsigned long, void *);
27 1.4 dyoung int indirect_ioctl(prop_dictionary_t, unsigned long, void *);
28 1.6 dyoung #ifdef INET6
29 1.6 dyoung void in6_fillscopeid(struct sockaddr_in6 *sin6);
30 1.6 dyoung #endif /* INET6 */
31 1.8 dyoung bool ifa_any_preferences(const char *, struct ifaddrs *, int);
32 1.8 dyoung void ifa_print_preference(const char *, const struct sockaddr *);
33 1.8 dyoung int16_t ifa_get_preference(const char *, const struct sockaddr *);
34 1.1 dyoung
35 1.1 dyoung #endif /* _IFCONFIG_UTIL_H */
36