Lines Matching refs:rtnl

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
107 assert(rtnl); in add_ipv6_address()
110 r = sd_rtnl_message_new_addr(rtnl, &req, RTM_NEWADDR, LOOPBACK_IFINDEX, AF_INET6); in add_ipv6_address()
130 …r = sd_netlink_call_async(rtnl, NULL, req, generic_handler, NULL, s, USEC_INFINITY, "systemd-loopb… in add_ipv6_address()
138 static bool check_loopback(sd_netlink *rtnl) { in check_loopback() argument
143 r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, LOOPBACK_IFINDEX); in check_loopback()
147 r = sd_netlink_call(rtnl, req, USEC_INFINITY, &reply); in check_loopback()
159 _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; in loopback_setup()
174 r = sd_netlink_open(&rtnl); in loopback_setup()
184 r = add_ipv4_address(rtnl, &state_4); in loopback_setup()
188 r = add_ipv6_address(rtnl, &state_6); in loopback_setup()
192 r = start_loopback(rtnl, &state_up); in loopback_setup()
197 r = sd_netlink_wait(rtnl, LOOPBACK_SETUP_TIMEOUT_USEC); in loopback_setup()
201 r = sd_netlink_process(rtnl, NULL); in loopback_setup()
211 if (state_up.rcode == -EPERM && check_loopback(rtnl)) in loopback_setup()