// Initialize NDP-proxy
-int init_ndp(void)
+int ndp_init(void)
{
int val = 2;
- rtnl_event.sock = odhcpd_create_nl_socket(NETLINK_ROUTE);
+ rtnl_event.sock = netlink_create_socket(NETLINK_ROUTE);
if (!rtnl_event.sock)
goto err;
nlmsg_free(msg);
}
-int setup_ndp_interface(struct interface *iface, bool enable)
+int ndp_setup_interface(struct interface *iface, bool enable)
{
int ret = 0, procfd;
bool dump_neigh = false;
inet_ntop(AF_INET6, addr, ipbuf, sizeof(ipbuf));
syslog(LOG_NOTICE, "Pinging for %s%%%s", ipbuf, iface->ifname);
- odhcpd_setup_route(addr, 128, iface, NULL, 128, true);
+ netlink_setup_route(addr, 128, iface, NULL, 128, true);
odhcpd_send(ping_socket, &dest, &iov, 1, iface);
- odhcpd_setup_route(addr, 128, iface, NULL, 128, false);
+ netlink_setup_route(addr, 128, iface, NULL, 128, false);
}
// Handle solicitations
(add) ? "Learned" : "Forgot", ipbuf, iface->ifname);
if (iface->learn_routes)
- odhcpd_setup_route(addr, 128, iface, NULL, 1024, add);
+ netlink_setup_route(addr, 128, iface, NULL, 1024, add);
}
// Check address update
static void check_addr_updates(struct interface *iface)
{
struct odhcpd_ipaddr *addr = NULL;
- ssize_t len = odhcpd_get_interface_addresses(iface->ifindex, false, &addr);
+ ssize_t len = netlink_get_interface_addrs(iface->ifindex, false, &addr);
if (len < 0)
return;
static void check_addr6_updates(struct interface *iface)
{
struct odhcpd_ipaddr *addr = NULL;
- ssize_t len = odhcpd_get_interface_addresses(iface->ifindex, true, &addr);
+ ssize_t len = netlink_get_interface_addrs(iface->ifindex, true, &addr);
if (len < 0)
return;
bool neigh_add = (c->ndp == MODE_RELAY ? add : false);
- if (odhcpd_setup_proxy_neigh(addr, c, neigh_add))
+ if (netlink_setup_proxy_neigh(addr, c, neigh_add))
syslog(LOG_DEBUG, "Failed to %s proxy neighbour entry %s%%%s",
neigh_add ? "add" : "delete", ipbuf, c->ifname);
else
if (ndm->ndm_flags & NTF_PROXY) {
/* Dump and flush proxy entries */
if (hdr->nlmsg_type == RTM_NEWNEIGH) {
- odhcpd_setup_proxy_neigh(addr6, iface, false);
+ netlink_setup_proxy_neigh(addr6, iface, false);
setup_route(addr6, iface, false);
dump_neigh_table(false);
}