summaryrefslogtreecommitdiffhomepage
path: root/src/odhcpd.h
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-06-29 15:35:21 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-07-03 11:32:53 +0200
commit18df6cca092743a07be8e0f05d0a9ef941957b66 (patch)
treef438a10bde79dc55de8f0dee53bf70276ed82a4e /src/odhcpd.h
parent803b83ec64d6f77262b378b83af0a9d84da68c49 (diff)
treewide: rework logic to retrieve IPv6 interface addresses
Retrieve IPv6 interface addresses when the interface gets created; this allows to get rid of the IPv6 address dump logic in ndp.c. Add IPv4 address support in odhcp_ipaddr struct. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/odhcpd.h')
-rw-r--r--src/odhcpd.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/odhcpd.h b/src/odhcpd.h
index 8a196ea..28eb88e 100644
--- a/src/odhcpd.h
+++ b/src/odhcpd.h
@@ -68,10 +68,16 @@ struct odhcpd_event {
void (*recv_msgs)(struct odhcpd_event *e);
};
+union if_addr {
+ struct in_addr in;
+ struct in6_addr in6;
+};
struct odhcpd_ipaddr {
- struct in6_addr addr;
+ union if_addr addr;
uint8_t prefix;
+
+ /* ipv6 only */
uint8_t dprefix;
uint32_t preferred;
uint32_t valid;
@@ -203,7 +209,7 @@ struct nl_sock *odhcpd_create_nl_socket(int protocol);
ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest,
struct iovec *iov, size_t iov_len,
const struct interface *iface);
-ssize_t odhcpd_get_interface_addresses(int ifindex,
+ssize_t odhcpd_get_interface_addresses(int ifindex, bool v6,
struct odhcpd_ipaddr **addrs);
int odhcpd_get_interface_dns_addr(const struct interface *iface,
struct in6_addr *addr);
@@ -229,9 +235,6 @@ void odhcpd_bmemcpy(void *av, const void *bv, size_t bits);
int config_parse_interface(void *data, size_t len, const char *iname, bool overwrite);
-void ndp_handle_addr6_dump(void);
-void ndp_rqs_addr6_dump(void);
-
#ifdef WITH_UBUS
int init_ubus(void);
const char* ubus_get_ifname(const char *name);