chiark / gitweb /
networkd: rename NetDev variable for consistency with Link
authorTom Gundersen <teg@jklm.no>
Thu, 15 May 2014 13:48:37 +0000 (15:48 +0200)
committerTom Gundersen <teg@jklm.no>
Thu, 15 May 2014 16:15:21 +0000 (18:15 +0200)
src/network/networkd-link.c
src/network/networkd-netdev-gperf.gperf
src/network/networkd-netdev.c
src/network/networkd-network.c
src/network/networkd-tunnel.c
src/network/networkd.h

index 6ce965b..930011a 100644 (file)
@@ -1476,7 +1476,7 @@ static int link_enter_enslave(Link *link) {
         if (link->network->bond) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",
-                                link->ifname, link->network->bond->name,
+                                link->ifname, link->network->bond->ifname,
                                 NETDEV(link->network->bond),
                                 NULL);
 
@@ -1484,7 +1484,7 @@ static int link_enter_enslave(Link *link) {
                 if (r < 0) {
                         log_struct_link(LOG_WARNING, link,
                                         "MESSAGE=%s: could not enslave by '%s': %s",
-                                        link->ifname, link->network->bond->name, strerror(-r),
+                                        link->ifname, link->network->bond->ifname, strerror(-r),
                                         NETDEV(link->network->bond),
                                         NULL);
                         link_enter_failed(link);
@@ -1498,7 +1498,7 @@ static int link_enter_enslave(Link *link) {
         if (link->network->bridge) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",
-                                link->ifname, link->network->bridge->name,
+                                link->ifname, link->network->bridge->ifname,
                                 NETDEV(link->network->bridge),
                                 NULL);
 
@@ -1506,7 +1506,7 @@ static int link_enter_enslave(Link *link) {
                 if (r < 0) {
                         log_struct_link(LOG_WARNING, link,
                                         "MESSAGE=%s: could not enslave by '%s': %s",
-                                        link->ifname, link->network->bridge->name, strerror(-r),
+                                        link->ifname, link->network->bridge->ifname, strerror(-r),
                                         NETDEV(link->network->bridge),
                                         NULL);
                         link_enter_failed(link);
@@ -1520,7 +1520,7 @@ static int link_enter_enslave(Link *link) {
         if (link->network->tunnel) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",
-                                link->ifname, link->network->tunnel->name,
+                                link->ifname, link->network->tunnel->ifname,
                                 NETDEV(link->network->tunnel),
                                 NULL);
 
@@ -1528,7 +1528,7 @@ static int link_enter_enslave(Link *link) {
                 if (r < 0) {
                         log_struct_link(LOG_WARNING, link,
                                         "MESSAGE=%s: could not enslave by '%s': %s",
-                                        link->ifname, link->network->tunnel->name, strerror(-r),
+                                        link->ifname, link->network->tunnel->ifname, strerror(-r),
                                         NETDEV(link->network->tunnel),
                                         NULL);
                         link_enter_failed(link);
@@ -1542,13 +1542,13 @@ static int link_enter_enslave(Link *link) {
         HASHMAP_FOREACH(vlan, link->network->vlans, i) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",
-                                link->ifname, vlan->name, NETDEV(vlan), NULL);
+                                link->ifname, vlan->ifname, NETDEV(vlan), NULL);
 
                 r = netdev_enslave(vlan, link, &enslave_handler);
                 if (r < 0) {
                         log_struct_link(LOG_WARNING, link,
                                         "MESSAGE=%s: could not enslave by '%s': %s",
-                                        link->ifname, vlan->name, strerror(-r),
+                                        link->ifname, vlan->ifname, strerror(-r),
                                         NETDEV(vlan), NULL);
                         link_enter_failed(link);
                         return r;
@@ -1561,13 +1561,13 @@ static int link_enter_enslave(Link *link) {
         HASHMAP_FOREACH(macvlan, link->network->macvlans, i) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",
-                                link->ifname, macvlan->name, NETDEV(macvlan), NULL);
+                                link->ifname, macvlan->ifname, NETDEV(macvlan), NULL);
 
                 r = netdev_enslave(macvlan, link, &enslave_handler);
                 if (r < 0) {
                         log_struct_link(LOG_WARNING, link,
                                         "MESSAGE=%s: could not enslave by '%s': %s",
-                                        link->ifname, macvlan->name, strerror(-r),
+                                        link->ifname, macvlan->ifname, strerror(-r),
                                         NETDEV(macvlan), NULL);
                         link_enter_failed(link);
                         return r;
index 7e6b885..29889cd 100644 (file)
@@ -20,7 +20,7 @@ Match.Virtualization,    config_parse_net_condition,         CONDITION_VIRTUALIZ
 Match.KernelCommandLine, config_parse_net_condition,         CONDITION_KERNEL_COMMAND_LINE, offsetof(NetDev, match_kernel)
 Match.Architecture,      config_parse_net_condition,         CONDITION_ARCHITECTURE,        offsetof(NetDev, match_arch)
 NetDev.Description,      config_parse_string,                0,                             offsetof(NetDev, description)
-NetDev.Name,             config_parse_ifname,                0,                             offsetof(NetDev, name)
+NetDev.Name,             config_parse_ifname,                0,                             offsetof(NetDev, ifname)
 NetDev.Kind,             config_parse_netdev_kind,           0,                             offsetof(NetDev, kind)
 NetDev.MTUBytes,         config_parse_iec_size,              0,                             offsetof(NetDev, mtu)
 VLAN.Id,                 config_parse_uint64,                0,                             offsetof(NetDev, vlanid)
index 62e1a3e..3bd6c07 100644 (file)
@@ -81,13 +81,13 @@ static void netdev_free(NetDev *netdev) {
 
         netdev_cancel_callbacks(netdev);
 
-        if (netdev->name)
-                hashmap_remove(netdev->manager->netdevs, netdev->name);
+        if (netdev->ifname)
+                hashmap_remove(netdev->manager->netdevs, netdev->ifname);
 
         free(netdev->filename);
 
         free(netdev->description);
-        free(netdev->name);
+        free(netdev->ifname);
 
         condition_free_list(netdev->match_host);
         condition_free_list(netdev->match_virt);
@@ -195,7 +195,7 @@ static int netdev_enter_ready(NetDev *netdev) {
         netdev_enslave_callback *callback;
 
         assert(netdev);
-        assert(netdev->name);
+        assert(netdev->ifname);
 
         if (netdev->state != NETDEV_STATE_CREATING)
                 return 0;
@@ -267,7 +267,7 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
         assert(netdev);
         assert(!(netdev->kind == NETDEV_KIND_VLAN || netdev->kind == NETDEV_KIND_MACVLAN) ||
                (link && callback));
-        assert(netdev->name);
+        assert(netdev->ifname);
         assert(netdev->manager);
         assert(netdev->manager->rtnl);
 
@@ -289,7 +289,7 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
                 }
         }
 
-        r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->name);
+        r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->ifname);
         if (r < 0) {
                 log_error_netdev(netdev,
                                  "Could not append IFLA_IFNAME attribute: %s",
@@ -464,7 +464,7 @@ int netdev_set_ifindex(NetDev *netdev, sd_rtnl_message *message) {
                 return r;
         }
 
-        if (!streq(netdev->name, received_name)) {
+        if (!streq(netdev->ifname, received_name)) {
                 log_error_netdev(netdev, "Received newlink with wrong IFNAME %s",
                                  received_name);
                 netdev_enter_failed(netdev);
@@ -555,7 +555,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
                 return 0;
         }
 
-        if (!netdev->name) {
+        if (!netdev->ifname) {
                 log_warning("NetDev without Name configured in %s. Ignoring", filename);
                 return 0;
         }
@@ -588,7 +588,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
                              NULL, NULL, NULL, NULL, NULL, NULL) <= 0)
                 return 0;
 
-        r = hashmap_put(netdev->manager->netdevs, netdev->name, netdev);
+        r = hashmap_put(netdev->manager->netdevs, netdev->ifname, netdev);
         if (r < 0)
                 return r;
 
index d6b06e8..91b1e3c 100644 (file)
@@ -315,7 +315,7 @@ int config_parse_netdev(const char *unit,
 
                 break;
         case NETDEV_KIND_MACVLAN:
-                r = hashmap_put(network->macvlans, netdev->name, netdev);
+                r = hashmap_put(network->macvlans, netdev->ifname, netdev);
                 if (r < 0) {
                         log_syntax(unit, LOG_ERR, filename, line, EINVAL,
                                    "Can not add MACVLAN to network: %s", rvalue);
index 0ecb1c9..5ea2878 100644 (file)
@@ -43,7 +43,7 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
 
         netdev = link->network->tunnel;
 
-        r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->name);
+        r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
         if (r < 0) {
                 log_error_netdev(netdev,
                                  "Could not append IFLA_IFNAME, attribute: %s",
@@ -141,7 +141,7 @@ int netdev_create_tunnel(Link *link, sd_rtnl_message_handler_t callback) {
         netdev = link->network->tunnel;
 
         assert(netdev);
-        assert(netdev->name);
+        assert(netdev->ifname);
         assert(netdev->manager);
         assert(netdev->manager->rtnl);
         assert(netdev->manager->kmod_ctx);
index 11d0056..c5f2d07 100644 (file)
@@ -97,7 +97,7 @@ struct NetDev {
         Condition *match_arch;
 
         char *description;
-        char *name;
+        char *ifname;
         size_t mtu;
         NetDevKind kind;
 
@@ -435,16 +435,16 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
 
 /* More macros which append INTERFACE= to the message */
 
-#define log_full_netdev(level, netdev, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->name, "%s: " fmt, netdev->name, ##__VA_ARGS__)
+#define log_full_netdev(level, netdev, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->ifname, "%s: " fmt, netdev->ifname, ##__VA_ARGS__)
 #define log_debug_netdev(netdev, ...)       log_full_netdev(LOG_DEBUG, netdev, ##__VA_ARGS__)
 #define log_info_netdev(netdev, ...)        log_full_netdev(LOG_INFO, netdev, ##__VA_ARGS__)
 #define log_notice_netdev(netdev, ...)      log_full_netdev(LOG_NOTICE, netdev, ##__VA_ARGS__)
 #define log_warning_netdev(netdev, ...)     log_full_netdev(LOG_WARNING, netdev,## __VA_ARGS__)
 #define log_error_netdev(netdev, ...)       log_full_netdev(LOG_ERR, netdev, ##__VA_ARGS__)
 
-#define log_struct_netdev(level, netdev, ...) log_struct(level, "INTERFACE=%s", netdev->name, __VA_ARGS__)
+#define log_struct_netdev(level, netdev, ...) log_struct(level, "INTERFACE=%s", netdev->ifname, __VA_ARGS__)
 
-#define NETDEV(netdev) "INTERFACE=%s", netdev->name
+#define NETDEV(netdev) "INTERFACE=%s", netdev->ifname
 #define ADDRESS_FMT_VAL(address)            \
         (address).s_addr & 0xFF,            \
         ((address).s_addr >> 8) & 0xFF,     \