treewide: align function naming
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 13 Oct 2017 10:09:28 +0000 (12:09 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 13 Oct 2017 12:44:33 +0000 (14:44 +0200)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/config.c
src/dhcpv4.c
src/dhcpv6-ia.c
src/dhcpv6.c
src/dhcpv6.h
src/ndp.c
src/odhcpd.c
src/odhcpd.h
src/router.c
src/ubus.c

index 2c35aab2c0d4f97d7c4b4079950671602aac7a7c..597d5c5f6994750a4785f49937ecad3534b17945 100644 (file)
@@ -236,10 +236,10 @@ static void close_interface(struct interface *iface)
        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);
@@ -843,10 +843,10 @@ void odhcpd_reload(void)
                                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);
        }
@@ -887,7 +887,7 @@ void odhcpd_run(void)
        signal(SIGHUP, handle_signal);
 
 #ifdef WITH_UBUS
-       while (init_ubus())
+       while (ubus_init())
                sleep(1);
 #endif
 
index 6b3d782b82eb887974d649764d18a93a38e87932..bfe70cbf3e840876808e99d674b02ed19f3f2979 100644 (file)
@@ -58,13 +58,13 @@ struct odhcpd_ref_ip {
 };
 
 /* 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);
index dd549e6b41d05b1974a312fb8c2344059758638f..1a584c5bae9b3df1481714c06bd7eb510000284a 100644 (file)
@@ -53,7 +53,7 @@ int dhcpv6_ia_init(void)
        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;
index 902bdbf6b501bc59ea40a7964407f011a2fe9a29..b94e84dae42601b5cbbc6f571787b4aacb591a37 100644 (file)
@@ -34,16 +34,14 @@ static void handle_client_request(void *addr, void *data, size_t len,
                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);
@@ -95,7 +93,7 @@ int setup_dhcpv6_interface(struct interface *iface, bool enable)
                odhcpd_register(&iface->dhcpv6_event);
        }
 
-       return setup_dhcpv6_ia_interface(iface, enable);
+       return dhcpv6_setup_ia_interface(iface, enable);
 }
 
 enum {
index de815cf6494f40bc76e631551a6fef4de683f6b3..fe05ae5e1a0e9650387cb49748eefa3f3b0e6086 100644 (file)
@@ -192,7 +192,7 @@ int dhcpv6_init_ia(struct interface *iface, int socket);
 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);
index 8ecc79b6031af2f2d69698907e07bc5775d1f5d6..22a91066ea9e3da3ecfc9a9c70b843fc70d116b1 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -74,7 +74,7 @@ static const struct sock_fprog bpf_prog = {sizeof(bpf) / sizeof(*bpf), bpf};
 
 
 // Initialize NDP-proxy
-int init_ndp(void)
+int ndp_init(void)
 {
        int val = 2;
 
@@ -168,7 +168,7 @@ static void dump_addr_table(bool v6)
        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;
index f59d5a885f246502cb2fda7b8b7d68076bc99ffe..259b6234b9214219814e879bbafba31779cca63b 100644 (file)
@@ -108,16 +108,16 @@ int main(int argc, char **argv)
        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();
index 3d8f2543f796332aeef11c6e2d4a77c09eeb2e64..2d9e474d5671ef753c2ed1d30d48303ab9c3610e 100644 (file)
@@ -265,7 +265,7 @@ int config_parse_interface(void *data, size_t len, const char *iname, bool overw
 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);
@@ -273,14 +273,14 @@ 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);
index 30f1609b2a315514b492b4e34767ab24d3d7d9ec..b50df3a962995e5e7d65b03a12accbb474374baa 100644 (file)
@@ -41,7 +41,7 @@ static FILE *fp_route = NULL;
 
 #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);
@@ -88,7 +88,7 @@ int init_router(void)
 }
 
 
-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;
index 6fbb98ff8fddb91418c2f72af0ca01138d376c55..95eeff7b9fe5004367c1682171e0c50416515223 100644 (file)
@@ -390,7 +390,7 @@ bool ubus_has_prefix(const char *name, const char *ifname)
 }
 
 
-int init_ubus(void)
+int ubus_init(void)
 {
        if (!(ubus = ubus_connect(NULL))) {
                syslog(LOG_ERR, "Unable to connect to ubus: %s", strerror(errno));