if (iface->head.next)
list_del(&iface->head);
- setup_router_interface(iface, false);
- setup_dhcpv6_interface(iface, false);
- setup_ndp_interface(iface, false);
- setup_dhcpv4_interface(iface, false);
+ router_setup_interface(iface, false);
+ dhcpv6_setup_interface(iface, false);
+ ndp_setup_interface(iface, false);
+ dhcpv4_setup_interface(iface, false);
clean_interface(iface);
free(iface->addr4);
i->ndp = (master && master->ndp == MODE_RELAY) ?
MODE_RELAY : MODE_DISABLED;
- setup_router_interface(i, !i->ignore || i->ra != MODE_DISABLED);
- setup_dhcpv6_interface(i, !i->ignore || i->dhcpv6 != MODE_DISABLED);
- setup_ndp_interface(i, !i->ignore || i->ndp != MODE_DISABLED);
- setup_dhcpv4_interface(i, !i->ignore || i->dhcpv4 != MODE_DISABLED);
+ router_setup_interface(i, !i->ignore || i->ra != MODE_DISABLED);
+ dhcpv6_setup_interface(i, !i->ignore || i->dhcpv6 != MODE_DISABLED);
+ ndp_setup_interface(i, !i->ignore || i->ndp != MODE_DISABLED);
+ dhcpv4_setup_interface(i, !i->ignore || i->dhcpv4 != MODE_DISABLED);
} else
close_interface(i);
}
signal(SIGHUP, handle_signal);
#ifdef WITH_UBUS
- while (init_ubus())
+ while (ubus_init())
sleep(1);
#endif
};
/* Create socket and register events */
-int init_dhcpv4(void)
+int dhcpv4_init(void)
{
uloop_timeout_set(&valid_until_timeout, 1000);
return 0;
}
-int setup_dhcpv4_interface(struct interface *iface, bool enable)
+int dhcpv4_setup_interface(struct interface *iface, bool enable)
{
if (iface->dhcpv4_event.uloop.fd > 0) {
uloop_fd_delete(&iface->dhcpv4_event.uloop);
return 0;
}
-int setup_dhcpv6_ia_interface(struct interface *iface, bool enable)
+int dhcpv6_setup_ia_interface(struct interface *iface, bool enable)
{
if (!enable && iface->ia_assignments.next) {
struct dhcpv6_assignment *c;
struct interface *iface, void *dest_addr);
-
// Create socket and register events
-int init_dhcpv6(void)
+int dhcpv6_init(void)
{
dhcpv6_ia_init();
return 0;
}
-
-int setup_dhcpv6_interface(struct interface *iface, bool enable)
+int dhcpv6_setup_interface(struct interface *iface, bool enable)
{
if (iface->dhcpv6_event.uloop.fd > 0) {
uloop_fd_delete(&iface->dhcpv6_event.uloop);
odhcpd_register(&iface->dhcpv6_event);
}
- return setup_dhcpv6_ia_interface(iface, enable);
+ return dhcpv6_setup_ia_interface(iface, enable);
}
enum {
ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface,
const struct sockaddr_in6 *addr, const void *data, const uint8_t *end);
int dhcpv6_ia_init(void);
-int setup_dhcpv6_ia_interface(struct interface *iface, bool enable);
+int dhcpv6_setup_ia_interface(struct interface *iface, bool enable);
void dhcpv6_enum_ia_addrs(struct interface *iface, struct dhcpv6_assignment *c, time_t now,
dhcpv6_binding_cb_handler_t func, void *arg);
void dhcpv6_write_statefile(void);
// Initialize NDP-proxy
-int init_ndp(void)
+int ndp_init(void)
{
int val = 2;
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;
signal(SIGINT, sighandler);
signal(SIGTERM, sighandler);
- if (init_router())
+ if (router_init())
return 4;
- if (init_dhcpv6())
+ if (dhcpv6_init())
return 4;
- if (init_ndp())
+ if (ndp_init())
return 4;
- if (init_dhcpv4())
+ if (dhcpv4_init())
return 4;
odhcpd_run();
void dhcpv4_addr_update(struct interface *iface);
#ifdef WITH_UBUS
-int init_ubus(void);
+int ubus_init(void);
const char* ubus_get_ifname(const char *name);
void ubus_apply_network(void);
bool ubus_has_prefix(const char *name, const char *ifname);
// Exported module initializers
-int init_router(void);
-int init_dhcpv6(void);
-int init_dhcpv4(void);
-int init_ndp(void);
-
-int setup_router_interface(struct interface *iface, bool enable);
-int setup_dhcpv6_interface(struct interface *iface, bool enable);
-int setup_ndp_interface(struct interface *iface, bool enable);
-int setup_dhcpv4_interface(struct interface *iface, bool enable);
+int router_init(void);
+int dhcpv6_init(void);
+int dhcpv4_init(void);
+int ndp_init(void);
+
+int router_setup_interface(struct interface *iface, bool enable);
+int dhcpv6_setup_interface(struct interface *iface, bool enable);
+int ndp_setup_interface(struct interface *iface, bool enable);
+int dhcpv4_setup_interface(struct interface *iface, bool enable);
void odhcpd_reload(void);
#define TIME_LEFT(t1, now) ((t1) != UINT32_MAX ? (t1) - (now) : UINT32_MAX)
-int init_router(void)
+int router_init(void)
{
// Open ICMPv6 socket
int sock = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC, IPPROTO_ICMPV6);
}
-int setup_router_interface(struct interface *iface, bool enable)
+int router_setup_interface(struct interface *iface, bool enable)
{
if (!fp_route || router_event.uloop.fd < 0)
return -1;
}
-int init_ubus(void)
+int ubus_init(void)
{
if (!(ubus = ubus_connect(NULL))) {
syslog(LOG_ERR, "Unable to connect to ubus: %s", strerror(errno));