/systemd/src/core/ |
H A D | loopback-setup.c | 29 static int start_loopback(sd_netlink *rtnl) { argument 33 r = sd_rtnl_message_new_link(rtnl, &req, RTM_SETLINK, LOOPBACK_IFINDEX); 41 r = sd_netlink_call(rtnl, req, 0, NULL); 48 static bool check_loopback(sd_netlink *rtnl) { argument 53 r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, LOOPBACK_IFINDEX); 57 r = sd_netlink_call(rtnl, req, 0, &reply); 69 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 72 r = sd_netlink_open(&rtnl); 76 r = start_loopback(rtnl); 83 if (r == -EPERM && check_loopback(rtnl)) [all...] |
/systemd/src/network/ |
H A D | networkd-netdev-bridge.c | 28 static int netdev_bridge_set_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument 57 r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_NEWLINK, netdev->ifindex); 100 r = sd_netlink_call_async(netdev->manager->rtnl, req, netdev_bridge_set_handler, netdev, 0, NULL);
|
H A D | networkd-wait-online.h | 39 sd_netlink *rtnl; member in struct:Manager
|
H A D | networkd-ipv4ll.c | 73 static int ipv4ll_route_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument 94 static int ipv4ll_address_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument 106 manager_rtnl_process_address(rtnl, m, link->manager);
|
H A D | networkd.h | 40 sd_netlink *rtnl; member in struct:Manager
|
H A D | networkd-dhcp6.c | 35 static int dhcp6_address_handler(sd_netlink *rtnl, sd_netlink_message *m, argument 58 manager_rtnl_process_address(rtnl, m, link->manager);
|
H A D | networkd-fdb.c | 83 static int set_fdb_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument 99 sd_netlink *rtnl; local 106 rtnl = link->manager->rtnl; 109 r = sd_rtnl_message_new_neigh(rtnl, &req, RTM_NEWNEIGH, link->ifindex, PF_BRIDGE); 135 r = sd_netlink_call_async(rtnl, req, set_fdb_handler, link, 0, NULL);
|
H A D | networkd-ndisc.c | 28 static int ndisc_netlink_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument
|
H A D | networkd-dhcp4.c | 29 static int dhcp4_route_handler(sd_netlink *rtnl, sd_netlink_message *m, argument 262 static int dhcp4_address_handler(sd_netlink *rtnl, sd_netlink_message *m, argument 274 manager_rtnl_process_address(rtnl, m, link->manager);
|
H A D | networkd-wait-online-manager.c | 99 static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { argument 106 assert(rtnl); 161 static int on_rtnl_event(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { argument 165 r = manager_process_link(rtnl, mm, m); 183 r = sd_netlink_open(&m->rtnl); 187 r = sd_netlink_attach_event(m->rtnl, m->event, 0); 191 r = sd_netlink_add_match(m->rtnl, RTM_NEWLINK, on_rtnl_event, m); 195 r = sd_netlink_add_match(m->rtnl, RTM_DELLINK, on_rtnl_event, m); 200 r = sd_rtnl_message_new_link(m->rtnl, &req, RTM_GETLINK, 0); 208 r = sd_netlink_call(m->rtnl, re [all...] |
H A D | networkd-netdev.c | 100 assert(netdev->manager->rtnl); 102 callback->callback(netdev->manager->rtnl, m, callback->link); 200 assert(netdev->manager->rtnl); 205 r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_SETLINK, link->ifindex); 213 r = sd_netlink_call_async(netdev->manager->rtnl, req, callback, link, 0, NULL); 257 static int netdev_create_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument 283 assert(netdev->manager->rtnl); 295 callback(netdev->manager->rtnl, m, link); 328 return log_netdev_error_errno(netdev, r, "Could not get rtnl message type: %m"); 331 log_netdev_error(netdev, "Cannot set ifindex from unexpected rtnl messag [all...] |
H A D | networkctl.c | 199 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 205 r = sd_netlink_open(&rtnl); 209 r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, 0); 217 r = sd_netlink_call(rtnl, req, 0, &reply); 294 sd_netlink *rtnl, 304 assert(rtnl); 310 r = sd_rtnl_message_new_neigh(rtnl, &req, RTM_GETNEIGH, ifindex, family); 318 r = sd_netlink_call(rtnl, req, 0, &reply); 400 sd_netlink *rtnl, 407 n = local_gateways(rtnl, ifinde 293 get_gateway_description( sd_netlink *rtnl, sd_hwdb *hwdb, int ifindex, int family, union in_addr_union *gateway, char **gateway_description) argument 399 dump_gateways( sd_netlink *rtnl, sd_hwdb *hwdb, const char *prefix, int ifindex) argument 448 dump_addresses( sd_netlink *rtnl, const char *prefix, int ifindex) argument 502 link_status_one( sd_netlink *rtnl, sd_hwdb *hwdb, const char *name) argument [all...] |
/systemd/src/test/ |
H A D | test-netlink-manual.c | 64 static int test_tunnel_configure(sd_netlink *rtnl) { argument 78 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0) >= 0); 97 assert_se(sd_netlink_call(rtnl, m, -1, 0) == 1); 106 assert_se(sd_rtnl_message_new_link(rtnl, &n, RTM_NEWLINK, 0) >= 0); 127 assert_se(sd_netlink_call(rtnl, n, -1, 0) == 1); 135 sd_netlink *rtnl; local 138 assert_se(sd_netlink_open(&rtnl) >= 0); 139 assert_se(rtnl); 141 r = test_tunnel_configure(rtnl); 143 assert_se((rtnl [all...] |
/systemd/src/libsystemd/sd-netlink/ |
H A D | netlink-util.c | 25 int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { argument 29 assert(rtnl); 33 if (!*rtnl) { 34 r = sd_netlink_open(rtnl); 39 r = sd_rtnl_message_new_link(*rtnl, &message, RTM_SETLINK, ifindex); 47 r = sd_netlink_call(*rtnl, message, 0, NULL); 54 int rtnl_set_link_properties(sd_netlink **rtnl, int ifindex, const char *alias, argument 59 assert(rtnl); 65 if (!*rtnl) { 66 r = sd_netlink_open(rtnl); [all...] |
H A D | netlink-internal.h | 111 sd_netlink *rtnl; member in struct:sd_netlink_message 122 int message_new(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t type); 123 int message_new_empty(sd_netlink *rtnl, sd_netlink_message **ret); 132 int rtnl_rqueue_make_room(sd_netlink *rtnl); 133 int rtnl_rqueue_partial_make_room(sd_netlink *rtnl); 135 /* Make sure callbacks don't destroy the rtnl connection */ 136 #define NETLINK_DONT_DESTROY(rtnl) \ 137 _cleanup_(sd_netlink_unrefp) _unused_ sd_netlink *_dont_destroy_##rtnl = sd_netlink_ref(rtnl)
|
H A D | netlink-socket.c | 280 log_debug("rtnl: kernel receive buffer overrun"); 282 log_debug("rtnl: no data in socket"); 289 log_debug("rtnl: ignoring message from portid %"PRIu32, sender.nl.nl_pid); 323 int socket_read_message(sd_netlink *rtnl) { argument 333 assert(rtnl); 334 assert(rtnl->rbuffer); 335 assert(rtnl->rbuffer_allocated >= sizeof(struct nlmsghdr)); 338 r = socket_recv_message(rtnl->fd, &iov, NULL, true); 345 if (!greedy_realloc((void **)&rtnl->rbuffer, 346 &rtnl [all...] |
H A D | rtnl-message.c | 219 int sd_rtnl_message_new_route(sd_netlink *rtnl, sd_netlink_message **ret, argument 230 r = message_new(rtnl, ret, nlmsg_type); 330 int sd_rtnl_message_new_neigh(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int index, int ndm_family) { argument 340 r = message_new(rtnl, ret, nlmsg_type); 399 int sd_rtnl_message_new_link(sd_netlink *rtnl, sd_netlink_message **ret, argument 408 r = message_new(rtnl, ret, nlmsg_type); 544 int sd_rtnl_message_new_addr(sd_netlink *rtnl, sd_netlink_message **ret, argument 557 r = message_new(rtnl, ret, nlmsg_type); 576 int sd_rtnl_message_new_addr_update(sd_netlink *rtnl, sd_netlink_message **ret, argument 580 r = sd_rtnl_message_new_addr(rtnl, re [all...] |
H A D | test-netlink.c | 33 static void test_message_link_bridge(sd_netlink *rtnl) { argument 37 assert_se(sd_rtnl_message_new_link(rtnl, &message, RTM_NEWLINK, 1) >= 0); 51 static void test_link_configure(sd_netlink *rtnl, int ifindex) { argument 60 assert_se(sd_rtnl_message_new_link(rtnl, &message, RTM_GETLINK, ifindex) >= 0); 65 assert_se(sd_netlink_call(rtnl, message, 0, NULL) == 1); 78 static void test_link_get(sd_netlink *rtnl, int ifindex) { argument 87 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_GETLINK, ifindex) >= 0); 102 assert_se(sd_netlink_call(rtnl, m, -1, &r) == 1); 123 static void test_address_get(sd_netlink *rtnl, int ifindex) { argument 130 assert_se(sd_rtnl_message_new_addr(rtnl, 192 link_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) argument 233 pipe_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) argument 343 test_get_addresses(sd_netlink *rtnl) argument 379 sd_netlink *rtnl; local [all...] |
H A D | netlink-message.c | 42 int message_new_empty(sd_netlink *rtnl, sd_netlink_message **ret) { argument 47 /* Note that 'rtnl' is currently unused, if we start using it internally 65 int message_new(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t type) { argument 78 r = message_new_empty(rtnl, &m); 752 log_debug("rtnl: message parse - overwriting repeated attribute");
|
H A D | sd-netlink.c | 36 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 40 rtnl = new0(sd_netlink, 1); 41 if (!rtnl) 44 rtnl->n_ref = REFCNT_INIT; 45 rtnl->fd = -1; 46 rtnl->sockaddr.nl.nl_family = AF_NETLINK; 47 rtnl->original_pid = getpid(); 49 LIST_HEAD_INIT(rtnl->match_callbacks); 53 if (!greedy_realloc((void**)&rtnl->rbuffer, &rtnl 96 rtnl_pid_changed(sd_netlink *rtnl) argument 147 sd_netlink_inc_rcvbuf(const sd_netlink *const rtnl, const int size) argument 151 sd_netlink_ref(sd_netlink *rtnl) argument 161 sd_netlink_unref(sd_netlink *rtnl) argument 201 rtnl_seal_message(sd_netlink *rtnl, sd_netlink_message *m) argument 238 rtnl_rqueue_make_room(sd_netlink *rtnl) argument 252 rtnl_rqueue_partial_make_room(sd_netlink *rtnl) argument 267 dispatch_rqueue(sd_netlink *rtnl, sd_netlink_message **message) argument 288 process_timeout(sd_netlink *rtnl) argument 320 process_reply(sd_netlink *rtnl, sd_netlink_message *m) argument 351 process_match(sd_netlink *rtnl, sd_netlink_message *m) argument 378 process_running(sd_netlink *rtnl, sd_netlink_message **ret) argument 420 sd_netlink_process(sd_netlink *rtnl, sd_netlink_message **ret) argument 445 rtnl_poll(sd_netlink *rtnl, bool need_more, uint64_t timeout_usec) argument 598 sd_netlink_call(sd_netlink *rtnl, sd_netlink_message *message, uint64_t usec, sd_netlink_message **ret) argument 684 sd_netlink_get_events(sd_netlink *rtnl) argument 694 sd_netlink_get_timeout(sd_netlink *rtnl, uint64_t *timeout_usec) argument 718 sd_netlink *rtnl = userdata; local 731 sd_netlink *rtnl = userdata; local 744 sd_netlink *rtnl = userdata; local 777 sd_netlink_attach_event(sd_netlink *rtnl, sd_event *event, int priority) argument 829 sd_netlink_detach_event(sd_netlink *rtnl) argument 842 sd_netlink_add_match(sd_netlink *rtnl, uint16_t type, sd_netlink_message_handler_t callback, void *userdata) argument 901 sd_netlink_remove_match(sd_netlink *rtnl, uint16_t type, sd_netlink_message_handler_t callback, void *userdata) argument [all...] |
/systemd/src/nspawn/ |
H A D | nspawn-expose-ports.c | 133 int expose_port_execute(sd_netlink *rtnl, ExposePort *l, union in_addr_union *exposed) { argument 149 r = local_addresses(rtnl, 0, af, &addresses); 212 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 223 r = sd_netlink_open_fd(&rtnl, fd); 226 return log_error_errno(r, "Failed to create rtnl object: %m"); 229 r = sd_netlink_add_match(rtnl, RTM_NEWADDR, handler, exposed); 233 r = sd_netlink_add_match(rtnl, RTM_DELADDR, handler, exposed); 237 r = sd_netlink_attach_event(rtnl, event, 0); 241 *ret = rtnl; 242 rtnl [all...] |
H A D | nspawn-network.c | 88 sd_netlink *rtnl, 98 assert(rtnl); 104 r = sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0); 152 r = sd_netlink_call(rtnl, m, 0, NULL); 164 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 185 r = sd_netlink_open(&rtnl); 189 r = add_veth(rtnl, pid, iface_name, &mac_host, "host0", &mac_container); 205 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; 216 r = sd_netlink_open(&rtnl); 231 r = add_veth(rtnl, pi 87 add_veth( sd_netlink *rtnl, pid_t pid, const char *ifname_host, const struct ether_addr *mac_host, const char *ifname_container, const struct ether_addr *mac_container) argument [all...] |
/systemd/src/resolve/ |
H A D | resolved-manager.h | 53 sd_netlink *rtnl; member in struct:Manager
|
/systemd/src/udev/net/ |
H A D | link-config.c | 53 sd_netlink *rtnl; member in struct:link_config_ctx 110 sd_netlink_unref(ctx->rtnl); 472 r = rtnl_set_link_properties(&ctx->rtnl, ifindex, config->alias, mac, config->mtu);
|
/systemd/src/udev/ |
H A D | udev.h | 47 sd_netlink *rtnl; member in struct:udev_event
|