/systemd-251/src/libsystemd/sd-netlink/ |
D | test-netlink.c | 26 static void test_message_link_bridge(sd_netlink *rtnl) { in test_message_link_bridge() argument 32 assert_se(sd_rtnl_message_new_link(rtnl, &message, RTM_NEWLINK, 1) >= 0); in test_message_link_bridge() 38 assert_se(sd_netlink_message_rewind(message, rtnl) >= 0); in test_message_link_bridge() 46 static void test_link_configure(sd_netlink *rtnl, int ifindex) { in test_link_configure() argument 55 assert_se(sd_rtnl_message_new_link(rtnl, &message, RTM_GETLINK, ifindex) >= 0); in test_link_configure() 57 assert_se(sd_netlink_call(rtnl, message, 0, &reply) == 1); in test_link_configure() 64 static void test_link_get(sd_netlink *rtnl, int ifindex) { in test_link_get() argument 73 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_GETLINK, ifindex) >= 0); in test_link_get() 76 assert_se(sd_netlink_call(rtnl, m, 0, &r) == 1); in test_link_get() 93 static void test_address_get(sd_netlink *rtnl, int ifindex) { in test_address_get() argument [all …]
|
D | netlink-util.c | 12 int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { in rtnl_set_link_name() argument 18 assert(rtnl); in rtnl_set_link_name() 25 r = rtnl_get_link_alternative_names(rtnl, ifindex, &alternative_names); in rtnl_set_link_name() 31 r = rtnl_delete_link_alternative_names(rtnl, ifindex, STRV_MAKE(name)); in rtnl_set_link_name() 41 r = sd_rtnl_message_new_link(*rtnl, &message, RTM_SETLINK, ifindex); in rtnl_set_link_name() 49 r = sd_netlink_call(*rtnl, message, 0, NULL); in rtnl_set_link_name() 54 r = rtnl_set_link_alternative_names(rtnl, ifindex, STRV_MAKE(old_name)); in rtnl_set_link_name() 64 sd_netlink **rtnl, in rtnl_set_link_properties() argument 77 assert(rtnl); in rtnl_set_link_properties() 90 if (!*rtnl) { in rtnl_set_link_properties() [all …]
|
D | netlink-util.h | 72 int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name); 74 sd_netlink **rtnl, 84 int rtnl_get_link_alternative_names(sd_netlink **rtnl, int ifindex, char ***ret); 85 int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names… 86 int rtnl_set_link_alternative_names_by_ifname(sd_netlink **rtnl, const char *ifname, char * const *… 87 int rtnl_delete_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_na… 88 int rtnl_resolve_link_alternative_name(sd_netlink **rtnl, const char *name, char **ret); 89 int rtnl_resolve_ifname(sd_netlink **rtnl, const char *name); 90 int rtnl_resolve_interface(sd_netlink **rtnl, const char *name); 91 int rtnl_resolve_interface_or_warn(sd_netlink **rtnl, const char *name); [all …]
|
D | netlink-message-rtnl.c | 247 int sd_rtnl_message_new_route(sd_netlink *rtnl, sd_netlink_message **ret, in sd_rtnl_message_new_route() argument 258 r = message_new(rtnl, ret, nlmsg_type); in sd_rtnl_message_new_route() 273 int sd_rtnl_message_new_nexthop(sd_netlink *rtnl, sd_netlink_message **ret, in sd_rtnl_message_new_nexthop() argument 295 r = message_new(rtnl, ret, nlmsg_type); in sd_rtnl_message_new_nexthop() 448 int sd_rtnl_message_new_neigh(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int … in sd_rtnl_message_new_neigh() argument 456 r = message_new(rtnl, ret, nlmsg_type); in sd_rtnl_message_new_neigh() 519 int sd_rtnl_message_new_link(sd_netlink *rtnl, sd_netlink_message **ret, in sd_rtnl_message_new_link() argument 527 r = message_new(rtnl, ret, nlmsg_type); in sd_rtnl_message_new_link() 665 int sd_rtnl_message_new_addr(sd_netlink *rtnl, sd_netlink_message **ret, in sd_rtnl_message_new_addr() argument 678 r = message_new(rtnl, ret, nlmsg_type); in sd_rtnl_message_new_addr() [all …]
|
/systemd-251/src/shared/ |
D | loopback-setup.c | 23 static int generic_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { in generic_handler() argument 45 static int start_loopback(sd_netlink *rtnl, struct state *s) { in start_loopback() argument 49 assert(rtnl); in start_loopback() 52 r = sd_rtnl_message_new_link(rtnl, &req, RTM_SETLINK, LOOPBACK_IFINDEX); in start_loopback() 60 …r = sd_netlink_call_async(rtnl, NULL, req, generic_handler, NULL, s, LOOPBACK_SETUP_TIMEOUT_USEC, … in start_loopback() 68 static int add_ipv4_address(sd_netlink *rtnl, struct state *s) { in add_ipv4_address() argument 72 assert(rtnl); in add_ipv4_address() 75 r = sd_rtnl_message_new_addr(rtnl, &req, RTM_NEWADDR, LOOPBACK_IFINDEX, AF_INET); in add_ipv4_address() 95 …r = sd_netlink_call_async(rtnl, NULL, req, generic_handler, NULL, s, USEC_INFINITY, "systemd-loopb… in add_ipv4_address() 103 static int add_ipv6_address(sd_netlink *rtnl, struct state *s) { in add_ipv6_address() argument [all …]
|
D | local-addresses.c | 68 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in local_addresses() 75 rtnl = sd_netlink_ref(context); in local_addresses() 77 r = sd_netlink_open(&rtnl); in local_addresses() 82 r = sd_rtnl_message_new_addr(rtnl, &req, RTM_GETADDR, ifindex, af); in local_addresses() 90 r = sd_netlink_call(rtnl, req, 0, &reply); in local_addresses() 214 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in local_gateways() 220 rtnl = sd_netlink_ref(context); in local_gateways() 222 r = sd_netlink_open(&rtnl); in local_gateways() 227 r = sd_rtnl_message_new_route(rtnl, &req, RTM_GETROUTE, af, RTPROT_UNSPEC); in local_gateways() 243 r = sd_netlink_call(rtnl, req, 0, &reply); in local_gateways()
|
D | local-addresses.h | 15 int local_addresses(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret); 17 int local_gateways(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret); 19 int local_outbounds(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
|
/systemd-251/src/nspawn/ |
D | nspawn-network.c | 37 static int remove_one_link(sd_netlink *rtnl, const char *name) { in remove_one_link() argument 44 r = sd_rtnl_message_new_link(rtnl, &m, RTM_DELLINK, 0); in remove_one_link() 52 r = sd_netlink_call(rtnl, m, 0, NULL); in remove_one_link() 106 static int set_alternative_ifname(sd_netlink *rtnl, const char *ifname, const char *altifname) { in set_alternative_ifname() argument 109 assert(rtnl); in set_alternative_ifname() 120 r = rtnl_set_link_alternative_names_by_ifname(&rtnl, ifname, STRV_MAKE(altifname)); in set_alternative_ifname() 130 sd_netlink *rtnl, in add_veth() argument 141 assert(rtnl); in add_veth() 147 r = sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0); in add_veth() 195 r = sd_netlink_call(rtnl, m, 0, NULL); in add_veth() [all …]
|
D | nspawn-expose-ports.c | 115 int expose_port_execute(sd_netlink *rtnl, FirewallContext **fw_ctx, ExposePort *l, int af, union in… in expose_port_execute() argument 129 r = local_addresses(rtnl, 0, af, &addresses); in expose_port_execute() 193 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in expose_port_watch_rtnl() 204 r = sd_netlink_open_fd(&rtnl, fd); in expose_port_watch_rtnl() 210 … r = sd_netlink_add_match(rtnl, NULL, RTM_NEWADDR, handler, NULL, userdata, "nspawn-NEWADDR"); in expose_port_watch_rtnl() 214 … r = sd_netlink_add_match(rtnl, NULL, RTM_DELADDR, handler, NULL, userdata, "nspawn-DELADDR"); in expose_port_watch_rtnl() 218 r = sd_netlink_attach_event(rtnl, event, 0); in expose_port_watch_rtnl() 222 *ret = TAKE_PTR(rtnl); in expose_port_watch_rtnl()
|
/systemd-251/src/network/ |
D | networkd-manager.c | 279 assert(manager->rtnl); in manager_setup_rtnl_filter() 281 return sd_netlink_attach_filter(manager->rtnl, ELEMENTSOF(filter), filter); in manager_setup_rtnl_filter() 291 r = sd_netlink_open(&m->rtnl); in manager_connect_rtnl() 293 r = sd_netlink_open_fd(&m->rtnl, fd); in manager_connect_rtnl() 301 r = sd_netlink_inc_rcvbuf(m->rtnl, RCVBUF_SIZE); in manager_connect_rtnl() 306 r = sd_netlink_attach_event(m->rtnl, m->event, 0); in manager_connect_rtnl() 310 …r = netlink_add_match(m->rtnl, NULL, RTM_NEWLINK, &manager_rtnl_process_link, NULL, m, "network-rt… in manager_connect_rtnl() 314 …r = netlink_add_match(m->rtnl, NULL, RTM_DELLINK, &manager_rtnl_process_link, NULL, m, "network-rt… in manager_connect_rtnl() 318 …r = netlink_add_match(m->rtnl, NULL, RTM_NEWQDISC, &manager_rtnl_process_qdisc, NULL, m, "network-… in manager_connect_rtnl() 322 …r = netlink_add_match(m->rtnl, NULL, RTM_DELQDISC, &manager_rtnl_process_qdisc, NULL, m, "network-… in manager_connect_rtnl() [all …]
|
D | networkd-setlink.c | 18 static int get_link_default_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { in get_link_default_handler() argument 19 return link_getlink_handler_internal(rtnl, m, link, "Failed to sync link information"); in get_link_default_handler() 22 static int get_link_master_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { in get_link_master_handler() argument 23 if (get_link_default_handler(rtnl, m, link) > 0) in get_link_master_handler() 28 static int get_link_update_flag_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { in get_link_update_flag_handler() argument 34 return get_link_default_handler(rtnl, m, link); in get_link_update_flag_handler() 38 sd_netlink *rtnl, in set_link_handler_internal() argument 79 static int link_set_addrgen_mode_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Lin… in link_set_addrgen_mode_handler() argument 82 r = set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); in link_set_addrgen_mode_handler() 95 static int link_set_bond_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link,… in link_set_bond_handler() argument [all …]
|
D | networkctl.c | 710 static int acquire_link_info(sd_bus *bus, sd_netlink *rtnl, char **patterns, LinkInfo **ret) { in acquire_link_info() argument 717 assert(rtnl); in acquire_link_info() 720 r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, 0); in acquire_link_info() 728 r = sd_netlink_call(rtnl, req, 0, &reply); in acquire_link_info() 789 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in list_links() 802 r = sd_netlink_open(&rtnl); in list_links() 806 c = acquire_link_info(NULL, rtnl, argc > 1 ? argv + 1 : NULL, &links); in list_links() 906 sd_netlink *rtnl, in get_gateway_description() argument 915 assert(rtnl); in get_gateway_description() 921 r = sd_rtnl_message_new_neigh(rtnl, &req, RTM_GETNEIGH, ifindex, family); in get_gateway_description() [all …]
|
D | networkd-sriov.c | 9 static int sr_iov_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, SRIOV … in sr_iov_handler() argument 38 assert(link->manager->rtnl); in sr_iov_configure() 44 r = sd_rtnl_message_new_link(link->manager->rtnl, &m, RTM_SETLINK, link->ifindex); in sr_iov_configure() 52 return request_call_netlink_async(link->manager->rtnl, m, req); in sr_iov_configure()
|
D | networkd-neighbor.c | 204 assert(link->manager->rtnl); in neighbor_configure() 209 r = sd_rtnl_message_new_neigh(link->manager->rtnl, &m, RTM_NEWNEIGH, in neighbor_configure() 218 return request_call_netlink_async(link->manager->rtnl, m, req); in neighbor_configure() 239 static int static_neighbor_configure_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req,… in static_neighbor_configure_handler() argument 327 static int neighbor_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { in neighbor_remove_handler() argument 352 assert(neighbor->link->manager->rtnl); in neighbor_remove() 358 r = sd_rtnl_message_new_neigh(link->manager->rtnl, &req, RTM_DELNEIGH, in neighbor_remove() 367 r = netlink_call_async(link->manager->rtnl, NULL, req, neighbor_remove_handler, in neighbor_remove() 450 int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m) { in manager_rtnl_process_neighbor() argument 457 assert(rtnl); in manager_rtnl_process_neighbor()
|
D | networkd-ipv6-proxy-ndp.c | 30 sd_netlink *rtnl, in ipv6_proxy_ndp_address_configure_handler() argument 62 assert(link->manager->rtnl); in ipv6_proxy_ndp_address_configure() 66 … r = sd_rtnl_message_new_neigh(link->manager->rtnl, &m, RTM_NEWNEIGH, link->ifindex, AF_INET6); in ipv6_proxy_ndp_address_configure() 78 return request_call_netlink_async(link->manager->rtnl, m, req); in ipv6_proxy_ndp_address_configure()
|
/systemd-251/src/udev/ |
D | test-udev-netlink.c | 11 static void test_link_info_one(sd_netlink *rtnl, int ifindex) { in test_link_info_one() argument 19 assert_se(link_info_get(&rtnl, ifindex, &info) >= 0); in test_link_info_one() 28 … assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "type", &s) >= 0); in test_link_info_one() 37 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "addr_len", &s) >= … in test_link_info_one() 45 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "address", &s) >= 0… in test_link_info_one() 52 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "broadcast", &s) >=… in test_link_info_one() 67 … assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "mtu", &s) >= 0); in test_link_info_one() 76 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "iflink", &s) >= 0); in test_link_info_one() 85 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "link_mode", &s) >=… in test_link_info_one() 93 …assert_se(device_get_sysattr_value_maybe_from_netlink(dev_with_netlink, &rtnl, "ifalias", &s) >= 0… in test_link_info_one() [all …]
|
D | udev-netlink.c | 20 int link_info_get(sd_netlink **rtnl, int ifindex, LinkInfo *ret) { in link_info_get() argument 26 assert(rtnl); in link_info_get() 30 if (!*rtnl) { in link_info_get() 31 r = sd_netlink_open(rtnl); in link_info_get() 36 r = sd_rtnl_message_new_link(*rtnl, &message, RTM_GETLINK, ifindex); in link_info_get() 40 r = sd_netlink_call(*rtnl, message, 0, &reply); in link_info_get() 296 sd_netlink **rtnl, in device_get_sysattr_value_maybe_from_netlink() argument 304 assert(rtnl); in device_get_sysattr_value_maybe_from_netlink() 319 r = link_info_get(rtnl, ifindex, &info); in device_get_sysattr_value_maybe_from_netlink()
|
D | udev-builtin-net_setup_link.c | 13 static int builtin_net_setup_link(sd_device *dev, sd_netlink **rtnl, int argc, char **argv, bool te… in builtin_net_setup_link() argument 20 r = link_new(ctx, rtnl, dev, &link); in builtin_net_setup_link() 41 r = link_apply_config(ctx, rtnl, link); in builtin_net_setup_link()
|
/systemd-251/src/test/ |
D | test-netlink-manual.c | 43 static int test_tunnel_configure(sd_netlink *rtnl) { in test_tunnel_configure() argument 61 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0) >= 0); in test_tunnel_configure() 80 assert_se(sd_netlink_call(rtnl, m, -1, 0) == 1); in test_tunnel_configure() 85 assert_se(sd_rtnl_message_new_link(rtnl, &n, RTM_NEWLINK, 0) >= 0); in test_tunnel_configure() 106 assert_se(sd_netlink_call(rtnl, n, -1, 0) == 1); in test_tunnel_configure() 114 sd_netlink *rtnl; in main() local 119 assert_se(sd_netlink_open(&rtnl) >= 0); in main() 120 assert_se(rtnl); in main() 122 r = test_tunnel_configure(rtnl); in main() 124 assert_se((rtnl = sd_netlink_unref(rtnl)) == NULL); in main()
|
/systemd-251/src/network/wait-online/ |
D | manager.c | 178 static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { in manager_process_link() argument 185 assert(rtnl); in manager_process_link() 245 static int on_rtnl_event(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { in on_rtnl_event() argument 249 r = manager_process_link(rtnl, mm, m); in on_rtnl_event() 266 r = sd_netlink_open(&m->rtnl); in manager_rtnl_listen() 270 r = sd_netlink_attach_event(m->rtnl, m->event, 0); in manager_rtnl_listen() 274 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_NEWLINK, on_rtnl_event, NULL, m, "wait-online-on-NEWLI… in manager_rtnl_listen() 278 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_DELLINK, on_rtnl_event, NULL, m, "wait-online-on-DELLI… in manager_rtnl_listen() 283 r = sd_rtnl_message_new_link(m->rtnl, &req, RTM_GETLINK, 0); in manager_rtnl_listen() 291 r = sd_netlink_call(m->rtnl, req, 0, &reply); in manager_rtnl_listen() [all …]
|
/systemd-251/src/udev/net/ |
D | link-config.c | 369 int link_new(LinkConfigContext *ctx, sd_netlink **rtnl, sd_device *device, Link **ret) { in link_new() argument 374 assert(rtnl); in link_new() 406 r = rtnl_get_link_info(rtnl, link->ifindex, &link->iftype, &link->flags, in link_new() 671 static int link_apply_rtnl_settings(Link *link, sd_netlink **rtnl) { in link_apply_rtnl_settings() argument 678 assert(rtnl); in link_apply_rtnl_settings() 684 r = rtnl_set_link_properties(rtnl, link->ifindex, config->alias, &hw_addr, in link_apply_rtnl_settings() 797 static int link_apply_alternative_names(Link *link, sd_netlink **rtnl) { in link_apply_alternative_names() argument 806 assert(rtnl); in link_apply_alternative_names() 851 r = rtnl_get_link_alternative_names(rtnl, link->ifindex, ¤t_altnames); in link_apply_alternative_names() 860 r = rtnl_set_link_alternative_names(rtnl, link->ifindex, altnames); in link_apply_alternative_names() [all …]
|
/systemd-251/src/libsystemd-network/ |
D | test-acd.c | 61 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in test_acd() 71 assert_se(sd_netlink_open(&rtnl) >= 0); in test_acd() 72 assert_se(sd_netlink_attach_event(rtnl, e, 0) >= 0); in test_acd() 74 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_GETLINK, 0) >= 0); in test_acd() 76 assert_se(sd_netlink_call(rtnl, m, 0, &reply) >= 0); in test_acd()
|
D | test-ipv4ll-manual.c | 76 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in test_ll() 83 assert_se(sd_netlink_open(&rtnl) >= 0); in test_ll() 84 assert_se(sd_netlink_attach_event(rtnl, e, 0) >= 0); in test_ll() 86 assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_GETLINK, 0) >= 0); in test_ll() 88 assert_se(sd_netlink_call(rtnl, m, 0, &reply) >= 0); in test_ll()
|
/systemd-251/src/resolve/ |
D | resolved-manager.c | 46 static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { in manager_process_link() argument 52 assert(rtnl); in manager_process_link() 108 static int manager_process_address(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { in manager_process_address() argument 116 assert(rtnl); in manager_process_address() 200 r = sd_netlink_open(&m->rtnl); in manager_rtnl_listen() 204 r = sd_netlink_attach_event(m->rtnl, m->event, SD_EVENT_PRIORITY_IMPORTANT); in manager_rtnl_listen() 208 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_NEWLINK, manager_process_link, NULL, m, "resolve-NEWLI… in manager_rtnl_listen() 212 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_DELLINK, manager_process_link, NULL, m, "resolve-DELLI… in manager_rtnl_listen() 216 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_NEWADDR, manager_process_address, NULL, m, "resolve-NE… in manager_rtnl_listen() 220 …r = sd_netlink_add_match(m->rtnl, NULL, RTM_DELADDR, manager_process_address, NULL, m, "resolve-DE… in manager_rtnl_listen() [all …]
|
D | resolved-dns-synthesize.c | 220 n = local_addresses(m->rtnl, ifindex, af, &addresses); in synthesize_system_hostname_rr() 289 n = local_addresses(m->rtnl, ifindex, af, &addresses); in synthesize_system_hostname_ptr() 330 n = lookup(m->rtnl, ifindex, af, &addresses); in synthesize_gateway_rr() 337 n = lookup(m->rtnl, ifindex, AF_INET6, NULL); in synthesize_gateway_rr() 340 n = lookup(m->rtnl, ifindex, AF_INET, NULL); in synthesize_gateway_rr() 366 n = local_gateways(m->rtnl, ifindex, af, &addresses); in synthesize_gateway_ptr()
|