struct interface;
struct nl_sock;
extern struct vlist_tree leases;
+extern struct config config;
struct odhcpd_event {
struct uloop_fd uloop;
void (*recv_msgs)(struct odhcpd_event *e);
};
+typedef int (*send_reply_cb_t)(const void *buf, size_t len,
+ const struct sockaddr *dest, socklen_t dest_len,
+ void *opaque);
+
typedef void (*dhcpv6_binding_cb_handler_t)(struct in6_addr *addr, int prefix,
uint32_t pref, uint32_t valid,
void *arg);
char *dhcp_cb;
char *dhcp_statefile;
int log_level;
-} config;
+};
struct lease {
bool master;
bool ignore;
bool always_rewrite_dns;
+ bool dns_service;
// NDP
int learn_routes;
uint32_t ra_hoplimit;
int ra_mtu;
+ // DHCP
+ uint32_t dhcp_leasetime;
+
// DHCPv4
struct in_addr dhcpv4_start;
struct in_addr dhcpv4_end;
size_t dhcpv4_router_cnt;
struct in_addr *dhcpv4_dns;
size_t dhcpv4_dns_cnt;
- uint32_t dhcpv4_leasetime;
bool dhcpv4_forcereconf;
// DNS
int dhcpv4_init(void);
int dhcpv4_setup_interface(struct interface *iface, bool enable);
+void dhcpv4_handle_msg(void *addr, void *data, size_t len,
+ struct interface *iface, _unused void *dest_addr,
+ send_reply_cb_t send_reply, void *opaque);
#endif
int router_setup_interface(struct interface *iface, bool enable);
int dhcpv6_setup_interface(struct interface *iface, bool enable);