#include <syslog.h>
#include <libubox/blobmsg.h>
-
-#ifndef typeof
-#define typeof __typeof
-#endif
-
-#ifndef container_of
-#define container_of(ptr, type, member) ( \
- (type *)( (char *)ptr - offsetof(type,member) ))
-#endif
-
#include <libubox/list.h>
#include <libubox/uloop.h>
+#include <libubox/avl.h>
// RFC 6106 defines this router advertisement option
#define ND_OPT_ROUTE_INFO 24
struct interface {
- struct list_head head;
+ struct avl_node avl;
int ifindex;
char *ifname;
bool ra_not_onlink;
bool ra_advrouter;
bool ra_useleasetime;
+ bool ra_dns;
bool no_dynamic_dhcp;
uint8_t pio_filter_length;
struct in6_addr pio_filter_addr;
void *dhcpv6_raw;
size_t dhcpv6_raw_len;
bool dhcpv6_assignall;
+ bool dhcpv6_pd;
+ bool dhcpv6_na;
char *upstream;
size_t upstream_len;
char *filter_class;
};
-extern struct list_head interfaces;
+extern struct avl_tree interfaces;
#define RA_MANAGED_NO_MFLAG 0
#define RA_MANAGED_MFLAG 1
const struct interface *iface);
int odhcpd_get_interface_dns_addr(const struct interface *iface,
struct in6_addr *addr);
-struct interface* odhcpd_get_interface_by_name(const char *name);
int odhcpd_get_interface_config(const char *ifname, const char *what);
int odhcpd_get_mac(const struct interface *iface, uint8_t mac[6]);
struct interface* odhcpd_get_interface_by_index(int ifindex);