Searched defs:rtnl (Results 1 - 25 of 29) sorted by relevance

12

/systemd/src/core/
H A Dloopback-setup.c29 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 Dnetworkd-netdev-bridge.c28 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 Dnetworkd-wait-online.h39 sd_netlink *rtnl; member in struct:Manager
H A Dnetworkd-ipv4ll.c73 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 Dnetworkd.h40 sd_netlink *rtnl; member in struct:Manager
H A Dnetworkd-dhcp6.c35 static int dhcp6_address_handler(sd_netlink *rtnl, sd_netlink_message *m, argument
58 manager_rtnl_process_address(rtnl, m, link->manager);
H A Dnetworkd-fdb.c83 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 Dnetworkd-ndisc.c28 static int ndisc_netlink_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { argument
H A Dnetworkd-dhcp4.c29 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 Dnetworkd-wait-online-manager.c99 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 Dnetworkd-netdev.c100 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 Dnetworkctl.c199 _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 Dtest-netlink-manual.c64 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 Dnetlink-util.c25 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 Dnetlink-internal.h111 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 Dnetlink-socket.c280 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 Drtnl-message.c219 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 Dtest-netlink.c33 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 Dnetlink-message.c42 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 Dsd-netlink.c36 _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 Dnspawn-expose-ports.c133 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 Dnspawn-network.c88 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 Dresolved-manager.h53 sd_netlink *rtnl; member in struct:Manager
/systemd/src/udev/net/
H A Dlink-config.c53 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 Dudev.h47 sd_netlink *rtnl; member in struct:udev_event

Completed in 47 milliseconds

12