summaryrefslogtreecommitdiff
path: root/src/network/networkd.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-15 14:21:44 +0200
committerTom Gundersen <teg@jklm.no>2014-04-19 18:41:58 +0200
commit505f8da7325591defe5f751f328bd26915267602 (patch)
tree5f4ff2ad396ab7666ac45ed2e1a9f3ff1f13b62b /src/network/networkd.h
parentd1ca51b153d7854d49400289ddedc7d493458f71 (diff)
networkd: tie links to rtnl rather than udev
This essentially swaps the roles of rtnl and udev in networkd. After this change libudev is only used for waiting for udev to initialize devices and to get udev-specific information needed for some [Match] attributes. This in particular simplifies the code in containers where udev is not really useful, but also simplifies things and reduces round-trips in the non-container case.
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r--src/network/networkd.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 36902e3c51..4a62fb8396 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -185,6 +185,7 @@ struct Route {
};
typedef enum LinkState {
+ LINK_STATE_INITIALIZING,
LINK_STATE_ENSLAVING,
LINK_STATE_SETTING_ADDRESSES,
LINK_STATE_SETTING_ROUTES,
@@ -246,10 +247,10 @@ void manager_free(Manager *m);
int manager_load_config(Manager *m);
bool manager_should_reload(Manager *m);
-int manager_udev_enumerate_links(Manager *m);
-int manager_udev_listen(Manager *m);
+int manager_rtnl_enumerate_links(Manager *m);
int manager_rtnl_listen(Manager *m);
+int manager_udev_listen(Manager *m);
int manager_bus_listen(Manager *m);
int manager_update_resolv_conf(Manager *m);
@@ -292,7 +293,9 @@ void network_free(Network *network);
DEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free);
#define _cleanup_network_free_ _cleanup_(network_freep)
-int network_get(Manager *manager, struct udev_device *device, Network **ret);
+int network_get(Manager *manager, struct udev_device *device,
+ const char *ifname, const struct ether_addr *mac,
+ Network **ret);
int network_apply(Manager *manager, Network *network, Link *link);
int config_parse_bridge(const char *unit, const char *filename, unsigned line,
@@ -362,13 +365,14 @@ int config_parse_label(const char *unit, const char *filename, unsigned line,
/* Link */
-int link_new(Manager *manager, struct udev_device *device, Link **ret);
void link_free(Link *link);
int link_get(Manager *m, int ifindex, Link **ret);
-int link_add(Manager *manager, struct udev_device *device, Link **ret);
+int link_add(Manager *manager, sd_rtnl_message *message, Link **ret);
int link_update(Link *link, sd_rtnl_message *message);
+int link_initialized(Link *link, struct udev_device *device);
+
int link_save(Link *link);
const char* link_state_to_string(LinkState s) _const_;