chiark / gitweb /
networkd: netdev - move tunnel address parsing to networkd-tunnel.c
authorTom Gundersen <teg@jklm.no>
Thu, 3 Jul 2014 08:55:59 +0000 (10:55 +0200)
committerTom Gundersen <teg@jklm.no>
Thu, 3 Jul 2014 09:00:36 +0000 (11:00 +0200)
src/network/networkd-netdev.c
src/network/networkd-tunnel.c

index a810be04b9fe19d9a945dfa0ad002a171576a28c..a8c1ea3b44a7e3b24f4409c66a2069298611fc46 100644 (file)
@@ -244,35 +244,6 @@ static int netdev_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda
         return 1;
 }
 
-int config_parse_tunnel_address(const char *unit,
-                                const char *filename,
-                                unsigned line,
-                                const char *section,
-                                unsigned section_line,
-                                const char *lvalue,
-                                int ltype,
-                                const char *rvalue,
-                                void *data,
-                                void *userdata) {
-        NetDev *n = userdata;
-        union in_addr_union *addr = data;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        r = net_parse_inaddr(rvalue, &n->family, addr);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
-                           "Tunnel address is invalid, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        return 0;
-}
-
 static int netdev_create(NetDev *netdev) {
         _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         const char *kind;
index bd1225942066ade6c156b3cf92beedc62c40f385..734148779544a5b841532b7e70070033a53c6dad 100644 (file)
@@ -30,6 +30,7 @@
 #include "network-internal.h"
 #include "util.h"
 #include "missing.h"
+#include "conf-parser.h"
 
 
 static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
@@ -535,3 +536,32 @@ int netdev_create_tunnel(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
 
         return 0;
 }
+
+int config_parse_tunnel_address(const char *unit,
+                                const char *filename,
+                                unsigned line,
+                                const char *section,
+                                unsigned section_line,
+                                const char *lvalue,
+                                int ltype,
+                                const char *rvalue,
+                                void *data,
+                                void *userdata) {
+        NetDev *n = userdata;
+        union in_addr_union *addr = data;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = net_parse_inaddr(rvalue, &n->family, addr);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+                           "Tunnel address is invalid, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        return 0;
+}