Lines Matching refs:req

40                 Request *req,  in set_link_handler_internal()  argument
48 assert(req); in set_link_handler_internal()
55 …error_msg = strjoina("Failed to set ", request_type_to_string(req->type), ignore ? ", ignoring" : … in set_link_handler_internal()
63 log_link_debug(link, "%s set.", request_type_to_string(req->type)); in set_link_handler_internal()
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
96 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); in link_set_bond_handler()
99 static int link_set_bridge_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *lin… in link_set_bridge_handler() argument
100 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); in link_set_bridge_handler()
103 static int link_set_bridge_vlan_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link… in link_set_bridge_vlan_handler() argument
104 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); in link_set_bridge_vlan_handler()
107 static int link_set_can_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, … in link_set_can_handler() argument
108 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); in link_set_can_handler()
111 static int link_set_flags_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link… in link_set_flags_handler() argument
112 …return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, get_link_default_handle… in link_set_flags_handler()
115 static int link_set_group_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link… in link_set_group_handler() argument
116 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); in link_set_group_handler()
119 static int link_set_ipoib_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link… in link_set_ipoib_handler() argument
120 return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); in link_set_ipoib_handler()
123 static int link_set_mac_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, … in link_set_mac_handler() argument
124 …return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_default_handler… in link_set_mac_handler()
127 static int link_set_mac_allow_retry_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, … in link_set_mac_allow_retry_handler() argument
148 return link_set_mac_handler(rtnl, m, req, link, userdata); in link_set_mac_allow_retry_handler()
151 static int link_set_master_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *lin… in link_set_master_handler() argument
152 …return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, get_link_master_handler… in link_set_master_handler()
155 static int link_unset_master_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *l… in link_unset_master_handler() argument
157 …return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_master_handler); in link_unset_master_handler()
160 static int link_set_mtu_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, … in link_set_mtu_handler() argument
163 … r = set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_default_handler); in link_set_mtu_handler()
178 sd_netlink_message *req, in link_configure_fill_message() argument
185 r = ipv6ll_addrgen_mode_fill_message(req, PTR_TO_UINT8(userdata)); in link_configure_fill_message()
190 r = sd_netlink_message_set_flags(req, NLM_F_REQUEST | NLM_F_ACK); in link_configure_fill_message()
194 r = sd_netlink_message_open_container(req, IFLA_LINKINFO); in link_configure_fill_message()
198 r = sd_netlink_message_open_container_union(req, IFLA_INFO_DATA, "bond"); in link_configure_fill_message()
203 … r = sd_netlink_message_append_u32(req, IFLA_BOND_ACTIVE_SLAVE, link->ifindex); in link_configure_fill_message()
209 r = sd_netlink_message_append_u32(req, IFLA_BOND_PRIMARY, link->ifindex); in link_configure_fill_message()
214 r = sd_netlink_message_close_container(req); in link_configure_fill_message()
218 r = sd_netlink_message_close_container(req); in link_configure_fill_message()
224 r = sd_rtnl_message_link_set_family(req, AF_BRIDGE); in link_configure_fill_message()
228 r = sd_netlink_message_open_container(req, IFLA_PROTINFO); in link_configure_fill_message()
233 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_GUARD, link->network->use_bpdu); in link_configure_fill_message()
239 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MODE, link->network->hairpin); in link_configure_fill_message()
245 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_ISOLATED, link->network->isolated); in link_configure_fill_message()
251 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_FAST_LEAVE, link->network->fast_leave); in link_configure_fill_message()
257 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, link->network->allow_port_to_be_root); in link_configure_fill_message()
263 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_UNICAST_FLOOD, link->network->unicast_flood); in link_configure_fill_message()
269 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MCAST_FLOOD, link->network->multicast_flood); in link_configure_fill_message()
275 …r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MCAST_TO_UCAST, link->network->multicast_to_unic… in link_configure_fill_message()
281 …r = sd_netlink_message_append_u8(req, IFLA_BRPORT_NEIGH_SUPPRESS, link->network->neighbor_suppress… in link_configure_fill_message()
287 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_LEARNING, link->network->learning); in link_configure_fill_message()
293 … r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROXYARP, link->network->bridge_proxy_arp); in link_configure_fill_message()
299 …r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROXYARP_WIFI, link->network->bridge_proxy_arp_w… in link_configure_fill_message()
305 … r = sd_netlink_message_append_u32(req, IFLA_BRPORT_COST, link->network->cost); in link_configure_fill_message()
311 … r = sd_netlink_message_append_u16(req, IFLA_BRPORT_PRIORITY, link->network->priority); in link_configure_fill_message()
317 …r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MULTICAST_ROUTER, link->network->multicast_route… in link_configure_fill_message()
322 r = sd_netlink_message_close_container(req); in link_configure_fill_message()
327 r = sd_rtnl_message_link_set_family(req, AF_BRIDGE); in link_configure_fill_message()
331 r = sd_netlink_message_open_container(req, IFLA_AF_SPEC); in link_configure_fill_message()
337 … r = sd_netlink_message_append_u16(req, IFLA_BRIDGE_FLAGS, BRIDGE_FLAGS_SELF); in link_configure_fill_message()
342 …r = bridge_vlan_append_info(link, req, link->network->pvid, link->network->br_vid_bitmap, link->ne… in link_configure_fill_message()
346 r = sd_netlink_message_close_container(req); in link_configure_fill_message()
352 r = can_set_netlink_message(link, req); in link_configure_fill_message()
379 r = sd_rtnl_message_link_set_flags(req, ifi_flags, ifi_change); in link_configure_fill_message()
386 r = sd_netlink_message_append_u32(req, IFLA_GROUP, (uint32_t) link->network->group); in link_configure_fill_message()
391 r = netlink_message_append_hw_addr(req, IFLA_ADDRESS, &link->requested_hw_addr); in link_configure_fill_message()
396 r = ipoib_set_netlink_message(link, req); in link_configure_fill_message()
401 r = sd_netlink_message_append_u32(req, IFLA_MASTER, PTR_TO_UINT32(userdata)); in link_configure_fill_message()
406 r = sd_netlink_message_append_u32(req, IFLA_MTU, PTR_TO_UINT32(userdata)); in link_configure_fill_message()
417 static int link_configure(Link *link, Request *req) { in link_configure() argument
423 assert(req); in link_configure()
425 log_link_debug(link, "Setting %s", request_type_to_string(req->type)); in link_configure()
427 if (req->type == REQUEST_TYPE_SET_LINK_BOND) in link_configure()
429 else if (IN_SET(req->type, REQUEST_TYPE_SET_LINK_CAN, REQUEST_TYPE_SET_LINK_IPOIB)) in link_configure()
436 r = link_configure_fill_message(link, m, req->type, req->userdata); in link_configure()
440 return request_call_netlink_async(link->manager->rtnl, m, req); in link_configure()
454 static int link_is_ready_to_set_link(Link *link, Request *req) { in link_is_ready_to_set_link() argument
460 assert(req); in link_is_ready_to_set_link()
465 switch (req->type) { in link_is_ready_to_set_link()
496 if (req->netlink_handler == link_set_mac_handler) { in link_is_ready_to_set_link()
544 req->userdata = UINT32_TO_PTR(m); in link_is_ready_to_set_link()
562 static int link_process_set_link(Request *req, Link *link, void *userdata) { in link_process_set_link() argument
565 assert(req); in link_process_set_link()
568 r = link_is_ready_to_set_link(link, req); in link_process_set_link()
572 r = link_configure(link, req); in link_process_set_link()
574 … return log_link_warning_errno(link, r, "Failed to set %s", request_type_to_string(req->type)); in link_process_set_link()
585 Request *req; in link_request_set_link() local
594 &req); in link_request_set_link()
602 *ret = req; in link_request_set_link()
608 Request *req; in link_request_to_set_addrgen_mode() local
637 &req); in link_request_to_set_addrgen_mode()
641 req->userdata = UINT8_TO_PTR(mode); in link_request_to_set_addrgen_mode()
818 Request *req; in link_request_to_set_mtu() local
856 &req); in link_request_to_set_mtu()
860 req->userdata = UINT32_TO_PTR(mtu); in link_request_to_set_mtu()
940 static int link_up_or_down_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *lin… in link_up_or_down_handler() argument
945 assert(req); in link_up_or_down_handler()
948 on_activate = req->type == REQUEST_TYPE_ACTIVATE_LINK; in link_up_or_down_handler()
949 up = PTR_TO_INT(req->userdata); in link_up_or_down_handler()
986 static int link_up_or_down(Link *link, bool up, Request *req) { in link_up_or_down() argument
993 assert(req); in link_up_or_down()
1005 return request_call_netlink_async(link->manager->rtnl, m, req); in link_up_or_down()
1020 static int link_process_activation(Request *req, Link *link, void *userdata) { in link_process_activation() argument
1024 assert(req); in link_process_activation()
1030 r = link_up_or_down(link, up, req); in link_process_activation()
1110 static int link_process_up_or_down(Request *req, Link *link, void *userdata) { in link_process_up_or_down() argument
1114 assert(req); in link_process_up_or_down()
1120 r = link_up_or_down(link, up, req); in link_process_up_or_down()
1172 _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; in link_down_now()
1181 r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex); in link_down_now()
1185 r = sd_rtnl_message_link_set_flags(req, 0, IFF_UP); in link_down_now()
1189 r = netlink_call_async(link->manager->rtnl, NULL, req, link_down_now_handler, in link_down_now()
1216 _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; in link_remove()
1225 r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_DELLINK, link->ifindex); in link_remove()
1229 r = netlink_call_async(link->manager->rtnl, NULL, req, link_remove_handler, in link_remove()