From 505f8da7325591defe5f751f328bd26915267602 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 15 Apr 2014 14:21:44 +0200 Subject: 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. --- src/network/networkd.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/network/networkd.h') 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_; -- cgit v1.2.3-54-g00ecf