util.h revision 1.11 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.11 roy bool (*af_addr_tentative)(struct ifaddrs *);
17 1.6 dyoung SIMPLEQ_ENTRY(afswtch) af_next;
18 1.1 dyoung };
19 1.1 dyoung
20 1.7 dyoung void print_link_addresses(prop_dictionary_t, bool);
21 1.9 dyoung const char *get_string(const char *, const char *, u_int8_t *, int *, bool);
22 1.1 dyoung const struct afswtch *lookup_af_byname(const char *);
23 1.1 dyoung const struct afswtch *lookup_af_bynum(int);
24 1.1 dyoung void print_string(const u_int8_t *, int);
25 1.1 dyoung int getsock(int);
26 1.1 dyoung struct paddr_prefix *prefixlen_to_mask(int, int);
27 1.4 dyoung int direct_ioctl(prop_dictionary_t, unsigned long, void *);
28 1.4 dyoung int indirect_ioctl(prop_dictionary_t, unsigned long, void *);
29 1.8 dyoung bool ifa_any_preferences(const char *, struct ifaddrs *, int);
30 1.8 dyoung void ifa_print_preference(const char *, const struct sockaddr *);
31 1.8 dyoung int16_t ifa_get_preference(const char *, const struct sockaddr *);
32 1.1 dyoung
33 1.1 dyoung #endif /* _IFCONFIG_UTIL_H */
34