diff options
author | Tom Gundersen <teg@jklm.no> | 2015-06-12 16:31:33 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-06-13 19:52:54 +0200 |
commit | 1c4baffc1895809bae9ac36b670af90a4cb9cd7d (patch) | |
tree | a0ad5af06e5aa9cf8998cc20e97780cfe375bcb9 /src/resolve | |
parent | eb59b6094197a7dcef89639ec3e91eef61b639bb (diff) |
sd-netlink: rename from sd-rtnl
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-link.c | 8 | ||||
-rw-r--r-- | src/resolve/resolved-link.h | 4 | ||||
-rw-r--r-- | src/resolve/resolved-manager.c | 50 | ||||
-rw-r--r-- | src/resolve/resolved-manager.h | 4 |
4 files changed, 33 insertions, 33 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c index 27d9129e00..ff8dc3a5bc 100644 --- a/src/resolve/resolved-link.c +++ b/src/resolve/resolved-link.c @@ -124,7 +124,7 @@ void link_add_rrs(Link *l, bool force_remove) { link_address_add_rrs(a, force_remove); } -int link_update_rtnl(Link *l, sd_rtnl_message *m) { +int link_update_rtnl(Link *l, sd_netlink_message *m) { const char *n = NULL; int r; @@ -135,9 +135,9 @@ int link_update_rtnl(Link *l, sd_rtnl_message *m) { if (r < 0) return r; - sd_rtnl_message_read_u32(m, IFLA_MTU, &l->mtu); + sd_netlink_message_read_u32(m, IFLA_MTU, &l->mtu); - if (sd_rtnl_message_read_string(m, IFLA_IFNAME, &n) >= 0) { + if (sd_netlink_message_read_string(m, IFLA_IFNAME, &n) >= 0) { strncpy(l->name, n, sizeof(l->name)-1); char_array_0(l->name); } @@ -522,7 +522,7 @@ fail: log_debug_errno(r, "Failed to update address RRs: %m"); } -int link_address_update_rtnl(LinkAddress *a, sd_rtnl_message *m) { +int link_address_update_rtnl(LinkAddress *a, sd_netlink_message *m) { int r; assert(a); assert(m); diff --git a/src/resolve/resolved-link.h b/src/resolve/resolved-link.h index eee1846108..e3ab27c249 100644 --- a/src/resolve/resolved-link.h +++ b/src/resolve/resolved-link.h @@ -69,7 +69,7 @@ struct Link { int link_new(Manager *m, Link **ret, int ifindex); Link *link_free(Link *l); -int link_update_rtnl(Link *l, sd_rtnl_message *m); +int link_update_rtnl(Link *l, sd_netlink_message *m); int link_update_monitor(Link *l); bool link_relevant(Link *l, int family); LinkAddress* link_find_address(Link *l, int family, const union in_addr_union *in_addr); @@ -82,7 +82,7 @@ void link_next_dns_server(Link *l); int link_address_new(Link *l, LinkAddress **ret, int family, const union in_addr_union *in_addr); LinkAddress *link_address_free(LinkAddress *a); -int link_address_update_rtnl(LinkAddress *a, sd_rtnl_message *m); +int link_address_update_rtnl(LinkAddress *a, sd_netlink_message *m); bool link_address_relevant(LinkAddress *l); void link_address_add_rrs(LinkAddress *a, bool force_remove); diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index aa78885ac3..dee5e61922 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -24,7 +24,7 @@ #include <poll.h> #include <netinet/in.h> -#include "rtnl-util.h" +#include "netlink-util.h" #include "network-internal.h" #include "socket-util.h" #include "af-list.h" @@ -41,7 +41,7 @@ #define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC) -static int manager_process_link(sd_rtnl *rtnl, sd_rtnl_message *mm, void *userdata) { +static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { Manager *m = userdata; uint16_t type; Link *l; @@ -51,7 +51,7 @@ static int manager_process_link(sd_rtnl *rtnl, sd_rtnl_message *mm, void *userda assert(m); assert(mm); - r = sd_rtnl_message_get_type(mm, &type); + r = sd_netlink_message_get_type(mm, &type); if (r < 0) goto fail; @@ -102,7 +102,7 @@ fail: return 0; } -static int manager_process_address(sd_rtnl *rtnl, sd_rtnl_message *mm, void *userdata) { +static int manager_process_address(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { Manager *m = userdata; union in_addr_union address; uint16_t type; @@ -114,7 +114,7 @@ static int manager_process_address(sd_rtnl *rtnl, sd_rtnl_message *mm, void *use assert(mm); assert(m); - r = sd_rtnl_message_get_type(mm, &type); + r = sd_netlink_message_get_type(mm, &type); if (r < 0) goto fail; @@ -133,9 +133,9 @@ static int manager_process_address(sd_rtnl *rtnl, sd_rtnl_message *mm, void *use switch (family) { case AF_INET: - r = sd_rtnl_message_read_in_addr(mm, IFA_LOCAL, &address.in); + r = sd_netlink_message_read_in_addr(mm, IFA_LOCAL, &address.in); if (r < 0) { - r = sd_rtnl_message_read_in_addr(mm, IFA_ADDRESS, &address.in); + r = sd_netlink_message_read_in_addr(mm, IFA_ADDRESS, &address.in); if (r < 0) goto fail; } @@ -143,9 +143,9 @@ static int manager_process_address(sd_rtnl *rtnl, sd_rtnl_message *mm, void *use break; case AF_INET6: - r = sd_rtnl_message_read_in6_addr(mm, IFA_LOCAL, &address.in6); + r = sd_netlink_message_read_in6_addr(mm, IFA_LOCAL, &address.in6); if (r < 0) { - r = sd_rtnl_message_read_in6_addr(mm, IFA_ADDRESS, &address.in6); + r = sd_netlink_message_read_in6_addr(mm, IFA_ADDRESS, &address.in6); if (r < 0) goto fail; } @@ -188,34 +188,34 @@ fail: } static int manager_rtnl_listen(Manager *m) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; - sd_rtnl_message *i; + _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL, *reply = NULL; + sd_netlink_message *i; int r; assert(m); /* First, subscribe to interfaces coming and going */ - r = sd_rtnl_open(&m->rtnl); + r = sd_netlink_open(&m->rtnl); if (r < 0) return r; - r = sd_rtnl_attach_event(m->rtnl, m->event, 0); + r = sd_netlink_attach_event(m->rtnl, m->event, 0); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_NEWLINK, manager_process_link, m); + r = sd_netlink_add_match(m->rtnl, RTM_NEWLINK, manager_process_link, m); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_DELLINK, manager_process_link, m); + r = sd_netlink_add_match(m->rtnl, RTM_DELLINK, manager_process_link, m); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_NEWADDR, manager_process_address, m); + r = sd_netlink_add_match(m->rtnl, RTM_NEWADDR, manager_process_address, m); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_DELADDR, manager_process_address, m); + r = sd_netlink_add_match(m->rtnl, RTM_DELADDR, manager_process_address, m); if (r < 0) return r; @@ -224,37 +224,37 @@ static int manager_rtnl_listen(Manager *m) { if (r < 0) return r; - r = sd_rtnl_message_request_dump(req, true); + r = sd_netlink_message_request_dump(req, true); if (r < 0) return r; - r = sd_rtnl_call(m->rtnl, req, 0, &reply); + r = sd_netlink_call(m->rtnl, req, 0, &reply); if (r < 0) return r; - for (i = reply; i; i = sd_rtnl_message_next(i)) { + for (i = reply; i; i = sd_netlink_message_next(i)) { r = manager_process_link(m->rtnl, i, m); if (r < 0) return r; } - req = sd_rtnl_message_unref(req); - reply = sd_rtnl_message_unref(reply); + req = sd_netlink_message_unref(req); + reply = sd_netlink_message_unref(reply); /* Finally, enumerate all addresses, too */ r = sd_rtnl_message_new_addr(m->rtnl, &req, RTM_GETADDR, 0, AF_UNSPEC); if (r < 0) return r; - r = sd_rtnl_message_request_dump(req, true); + r = sd_netlink_message_request_dump(req, true); if (r < 0) return r; - r = sd_rtnl_call(m->rtnl, req, 0, &reply); + r = sd_netlink_call(m->rtnl, req, 0, &reply); if (r < 0) return r; - for (i = reply; i; i = sd_rtnl_message_next(i)) { + for (i = reply; i; i = sd_netlink_message_next(i)) { r = manager_process_address(m->rtnl, i, m); if (r < 0) return r; diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h index 5a581cc13a..0f4ffad141 100644 --- a/src/resolve/resolved-manager.h +++ b/src/resolve/resolved-manager.h @@ -23,7 +23,7 @@ #include "sd-event.h" #include "sd-network.h" -#include "sd-rtnl.h" +#include "sd-netlink.h" #include "list.h" #include "hashmap.h" @@ -50,7 +50,7 @@ struct Manager { /* Network */ Hashmap *links; - sd_rtnl *rtnl; + sd_netlink *rtnl; sd_event_source *rtnl_event_source; sd_network_monitor *network_monitor; |