Home
last modified time | relevance | path

Searched refs:link (Results 1 – 25 of 336) sorted by relevance

12345678910>>...14

/systemd-251/src/network/
Dnetworkd-link.c71 bool link_ipv4ll_enabled(Link *link) { in link_ipv4ll_enabled() argument
72 assert(link); in link_ipv4ll_enabled()
74 if (link->flags & IFF_LOOPBACK) in link_ipv4ll_enabled()
77 if (!link->network) in link_ipv4ll_enabled()
80 if (link->iftype == ARPHRD_CAN) in link_ipv4ll_enabled()
83 if (link->hw_addr.length != ETH_ALEN) in link_ipv4ll_enabled()
86 if (ether_addr_is_null(&link->hw_addr.ether)) in link_ipv4ll_enabled()
91 if (link->iftype != ARPHRD_ETHER) in link_ipv4ll_enabled()
94 if (streq_ptr(link->kind, "vrf")) in link_ipv4ll_enabled()
98 if (IN_SET(link_get_ipvlan_mode(link), NETDEV_IPVLAN_MODE_L3, NETDEV_IPVLAN_MODE_L3S)) in link_ipv4ll_enabled()
[all …]
Dnetworkd-setlink.c18 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()
24 link->master_set = true; 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
29 assert(link); in get_link_update_flag_handler()
30 assert(link->set_flags_messages > 0); in get_link_update_flag_handler()
32 link->set_flags_messages--; in get_link_update_flag_handler()
34 return get_link_default_handler(rtnl, m, link); in get_link_update_flag_handler()
[all …]
Dnetworkd-dhcp4.c30 static int dhcp4_request_address_and_routes(Link *link, bool announce);
57 static int dhcp4_remove_address_and_routes(Link *link, bool only_marked) { in dhcp4_remove_address_and_routes() argument
62 assert(link); in dhcp4_remove_address_and_routes()
64 SET_FOREACH(route, link->routes) { in dhcp4_remove_address_and_routes()
74 route_cancel_request(route, link); in dhcp4_remove_address_and_routes()
77 SET_FOREACH(address, link->addresses) { in dhcp4_remove_address_and_routes()
93 static int dhcp4_address_get(Link *link, Address **ret) { in dhcp4_address_get() argument
96 assert(link); in dhcp4_address_get()
98 SET_FOREACH(address, link->addresses) { in dhcp4_address_get()
114 assert(address->link); in dhcp4_address_ready_callback()
[all …]
Dnetworkd-dhcp6.c21 bool link_dhcp6_with_address_enabled(Link *link) { in link_dhcp6_with_address_enabled() argument
22 if (!link_dhcp6_enabled(link)) in link_dhcp6_with_address_enabled()
25 return link->network->dhcp6_use_address; in link_dhcp6_with_address_enabled()
28 static DHCP6ClientStartMode link_get_dhcp6_client_start_mode(Link *link) { in link_get_dhcp6_client_start_mode() argument
29 assert(link); in link_get_dhcp6_client_start_mode()
31 if (!link->network) in link_get_dhcp6_client_start_mode()
35 if (link->network->dhcp6_client_start_mode >= 0) in link_get_dhcp6_client_start_mode()
36 return link->network->dhcp6_client_start_mode; in link_get_dhcp6_client_start_mode()
39 if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) in link_get_dhcp6_client_start_mode()
46 static int dhcp6_remove(Link *link, bool only_marked) { in dhcp6_remove() argument
[all …]
Dnetworkd-sysctl.c14 static int link_update_ipv6_sysctl(Link *link) { in link_update_ipv6_sysctl() argument
15 assert(link); in link_update_ipv6_sysctl()
17 if (link->flags & IFF_LOOPBACK) in link_update_ipv6_sysctl()
20 if (!link_ipv6_enabled(link)) in link_update_ipv6_sysctl()
23 return sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", false); in link_update_ipv6_sysctl()
26 static int link_set_proxy_arp(Link *link) { in link_set_proxy_arp() argument
27 assert(link); in link_set_proxy_arp()
29 if (link->flags & IFF_LOOPBACK) in link_set_proxy_arp()
32 if (!link->network) in link_set_proxy_arp()
35 if (link->network->proxy_arp < 0) in link_set_proxy_arp()
[all …]
Dnetworkd-ndisc.c29 bool link_ipv6_accept_ra_enabled(Link *link) { in link_ipv6_accept_ra_enabled() argument
30 assert(link); in link_ipv6_accept_ra_enabled()
35 if (link->flags & IFF_LOOPBACK) in link_ipv6_accept_ra_enabled()
38 if (link->iftype == ARPHRD_CAN) in link_ipv6_accept_ra_enabled()
41 if (link->hw_addr.length != ETH_ALEN && !streq_ptr(link->kind, "wwan")) in link_ipv6_accept_ra_enabled()
47 if (!link->network) in link_ipv6_accept_ra_enabled()
50 if (!link_may_have_ipv6ll(link)) in link_ipv6_accept_ra_enabled()
53 assert(link->network->ipv6_accept_ra >= 0); in link_ipv6_accept_ra_enabled()
54 return link->network->ipv6_accept_ra; in link_ipv6_accept_ra_enabled()
81 static int ndisc_remove(Link *link, struct in6_addr *router) { in ndisc_remove() argument
[all …]
Dnetworkd-dhcp-prefix-delegation.c24 bool link_dhcp_pd_is_enabled(Link *link) { in link_dhcp_pd_is_enabled() argument
25 assert(link); in link_dhcp_pd_is_enabled()
27 if (!link->network) in link_dhcp_pd_is_enabled()
30 return link->network->dhcp_pd; in link_dhcp_pd_is_enabled()
33 bool dhcp_pd_is_uplink(Link *link, Link *target, bool accept_auto) { in dhcp_pd_is_uplink() argument
34 assert(link); in dhcp_pd_is_uplink()
37 if (!link_dhcp_pd_is_enabled(link)) in dhcp_pd_is_uplink()
40 if (link->network->dhcp_pd_uplink_name) in dhcp_pd_is_uplink()
41 return streq_ptr(target->ifname, link->network->dhcp_pd_uplink_name) || in dhcp_pd_is_uplink()
42 … strv_contains(target->alternative_names, link->network->dhcp_pd_uplink_name); in dhcp_pd_is_uplink()
[all …]
Dnetworkd-dhcp-server.c26 static bool link_dhcp4_server_enabled(Link *link) { in link_dhcp4_server_enabled() argument
27 assert(link); in link_dhcp4_server_enabled()
29 if (link->flags & IFF_LOOPBACK) in link_dhcp4_server_enabled()
32 if (!link->network) in link_dhcp4_server_enabled()
35 if (link->iftype == ARPHRD_CAN) in link_dhcp4_server_enabled()
38 return link->network->dhcp_server; in link_dhcp4_server_enabled()
87 int link_request_dhcp_server_address(Link *link) { in link_request_dhcp_server_address() argument
92 assert(link); in link_request_dhcp_server_address()
93 assert(link->network); in link_request_dhcp_server_address()
95 if (!link_dhcp4_server_enabled(link)) in link_request_dhcp_server_address()
[all …]
Dnetworkd-state-file.c118 Link *link; in manager_save() local
126 HASHMAP_FOREACH(link, m->links_by_index) { in manager_save()
129 if (link->flags & IFF_LOOPBACK) in manager_save()
132 operstate = MAX(operstate, link->operstate); in manager_save()
133 carrier_state = MAX(carrier_state, link->carrier_state); in manager_save()
134 address_state = MAX(address_state, link->address_state); in manager_save()
135 ipv4_address_state = MAX(ipv4_address_state, link->ipv4_address_state); in manager_save()
136 ipv6_address_state = MAX(ipv6_address_state, link->ipv6_address_state); in manager_save()
138 if (!link->network) in manager_save()
141 if (link->network->required_for_online) { in manager_save()
[all …]
Dnetworkd-ipv4ll.c14 static int address_new_from_ipv4ll(Link *link, Address **ret) { in address_new_from_ipv4ll() argument
19 assert(link); in address_new_from_ipv4ll()
20 assert(link->ipv4ll); in address_new_from_ipv4ll()
23 r = sd_ipv4ll_get_address(link->ipv4ll, &addr); in address_new_from_ipv4ll()
37 address_set_broadcast(address, link); in address_new_from_ipv4ll()
43 static int ipv4ll_address_lost(Link *link) { in ipv4ll_address_lost() argument
48 assert(link); in ipv4ll_address_lost()
50 link->ipv4ll_address_configured = false; in ipv4ll_address_lost()
52 r = address_new_from_ipv4ll(link, &address); in ipv4ll_address_lost()
58 if (address_get(link, address, &existing) < 0) in ipv4ll_address_lost()
[all …]
Dnetworkd-neighbor.c24 if (neighbor->link) in neighbor_free()
25 set_remove(neighbor->link->neighbors, neighbor); in neighbor_free()
82 dest->link = NULL; in neighbor_dup()
129 static int neighbor_get(Link *link, const Neighbor *in, Neighbor **ret) { in neighbor_get() argument
132 assert(link); in neighbor_get()
135 existing = set_get(link->neighbors, in); in neighbor_get()
144 static int neighbor_add(Link *link, Neighbor *neighbor) { in neighbor_add() argument
147 assert(link); in neighbor_add()
150 r = set_ensure_put(&link->neighbors, &neighbor_hash_ops, neighbor); in neighbor_add()
156 neighbor->link = link; in neighbor_add()
[all …]
Dnetworkd-ipv4acd.c12 static int static_ipv4acd_address_remove(Link *link, Address *address, bool on_conflict) { in static_ipv4acd_address_remove() argument
15 assert(link); in static_ipv4acd_address_remove()
25 …log_link_warning(link, "Dropping address "IPV4_ADDRESS_FMT_STR", as an address conflict was detect… in static_ipv4acd_address_remove()
28 … log_link_debug(link, "Removing address "IPV4_ADDRESS_FMT_STR", as the ACD client is stopped.", in static_ipv4acd_address_remove()
33 … return log_link_warning_errno(link, r, "Failed to remove address "IPV4_ADDRESS_FMT_STR": %m", in static_ipv4acd_address_remove()
39 static int dhcp4_address_on_conflict(Link *link, Address *address) { in dhcp4_address_on_conflict() argument
42 assert(link); in dhcp4_address_on_conflict()
43 assert(link->dhcp_client); in dhcp4_address_on_conflict()
45 r = sd_dhcp_client_send_decline(link->dhcp_client); in dhcp4_address_on_conflict()
47 log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m"); in dhcp4_address_on_conflict()
[all …]
Dnetworkd-lldp-rx.c30 static bool link_lldp_rx_enabled(Link *link) { in link_lldp_rx_enabled() argument
31 assert(link); in link_lldp_rx_enabled()
33 if (link->flags & IFF_LOOPBACK) in link_lldp_rx_enabled()
36 if (link->iftype != ARPHRD_ETHER) in link_lldp_rx_enabled()
39 if (!link->network) in link_lldp_rx_enabled()
45 if (link->kind && STR_IN_SET(link->kind, "bridge", "bond")) in link_lldp_rx_enabled()
48 return link->network->lldp_mode != LLDP_MODE_NO; in link_lldp_rx_enabled()
52 Link *link = userdata; in lldp_rx_handler() local
55 assert(link); in lldp_rx_handler()
57 (void) link_lldp_save(link); in lldp_rx_handler()
[all …]
Dnetworkd-ipv6ll.c17 bool link_ipv6ll_enabled(Link *link) { in link_ipv6ll_enabled() argument
18 assert(link); in link_ipv6ll_enabled()
23 if (link->flags & IFF_LOOPBACK) in link_ipv6ll_enabled()
26 if (!link->network) in link_ipv6ll_enabled()
29 if (link->iftype == ARPHRD_CAN) in link_ipv6ll_enabled()
32 if (STRPTR_IN_SET(link->kind, "vrf", "wireguard", "ipip", "gre", "sit", "vti", "nlmon")) in link_ipv6ll_enabled()
35 if (link->network->bond) in link_ipv6ll_enabled()
38 return link->network->link_local & ADDRESS_FAMILY_IPV6; in link_ipv6ll_enabled()
41 bool link_may_have_ipv6ll(Link *link) { in link_may_have_ipv6ll() argument
42 assert(link); in link_may_have_ipv6ll()
[all …]
Dnetworkd-wifi.c15 static int link_get_wlan_interface(Link *link) { in link_get_wlan_interface() argument
19 assert(link); in link_get_wlan_interface()
21 … r = sd_genl_message_new(link->manager->genl, NL80211_GENL_NAME, NL80211_CMD_GET_INTERFACE, &req); in link_get_wlan_interface()
23 … return log_link_debug_errno(link, r, "Failed to create generic netlink message: %m"); in link_get_wlan_interface()
25 r = sd_netlink_message_append_u32(req, NL80211_ATTR_IFINDEX, link->ifindex); in link_get_wlan_interface()
27 … return log_link_debug_errno(link, r, "Could not append NL80211_ATTR_IFINDEX attribute: %m"); in link_get_wlan_interface()
29 r = sd_netlink_call(link->manager->genl, req, 0, &reply); in link_get_wlan_interface()
31 … return log_link_debug_errno(link, r, "Failed to request information about wlan interface: %m"); in link_get_wlan_interface()
33 …log_link_debug(link, "No reply received to request for information about wifi interface, ignoring.… in link_get_wlan_interface()
37 return manager_genl_process_nl80211_config(link->manager->genl, reply, link->manager); in link_get_wlan_interface()
[all …]
Dnetworkd-sriov.c9 static int sr_iov_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, SRIOV … in sr_iov_handler() argument
13 assert(link); in sr_iov_handler()
17 log_link_message_error_errno(link, m, r, "Could not set up SR-IOV"); in sr_iov_handler()
18 link_enter_failed(link); in sr_iov_handler()
22 if (link->sr_iov_messages == 0) { in sr_iov_handler()
23 log_link_debug(link, "SR-IOV configured"); in sr_iov_handler()
24 link->sr_iov_configured = true; in sr_iov_handler()
25 link_check_ready(link); in sr_iov_handler()
31 static int sr_iov_configure(SRIOV *sr_iov, Link *link, Request *req) { in sr_iov_configure() argument
36 assert(link); in sr_iov_configure()
[all …]
Dnetworkd-address.c128 if (address->link) { in address_free()
129 set_remove(address->link->addresses, address); in address_free()
132 in6_addr_equal(&address->in_addr.in6, &address->link->ipv6ll_address)) in address_free()
133 memzero(&address->link->ipv6ll_address, sizeof(struct in6_addr)); in address_free()
161 void link_mark_addresses(Link *link, NetworkConfigSource source, const struct in6_addr *router) { in link_mark_addresses() argument
164 assert(link); in link_mark_addresses()
166 SET_FOREACH(a, link->addresses) { in link_mark_addresses()
178 static bool address_needs_to_set_broadcast(const Address *a, Link *link) { in address_needs_to_set_broadcast() argument
180 assert(link); in address_needs_to_set_broadcast()
202 return !streq_ptr(link->kind, "wireguard"); in address_needs_to_set_broadcast()
[all …]
Dnetworkd-nexthop.c32 if (nexthop->link) { in nexthop_free()
33 set_remove(nexthop->link->nexthops, nexthop); in nexthop_free()
35 if (nexthop->link->manager && nexthop->id > 0) in nexthop_free()
36 … hashmap_remove(nexthop->link->manager->nexthops_by_id, UINT32_TO_PTR(nexthop->id)); in nexthop_free()
183 dest->link = NULL; in nexthop_dup()
227 static int nexthop_get(Manager *manager, Link *link, NextHop *in, NextHop **ret) { in nexthop_get() argument
234 if (!link) in nexthop_get()
237 nexthops = link->nexthops; in nexthop_get()
276 static int nexthop_add(Manager *manager, Link *link, NextHop *nexthop) { in nexthop_add() argument
283 assert(link); in nexthop_add()
[all …]
Dnetworkd-bridge-mdb.c84 …figure_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { in bridge_mdb_configure_handler() argument
88 assert(link); in bridge_mdb_configure_handler()
91 if (r == -EINVAL && streq_ptr(link->kind, "bridge") && link->master_ifindex <= 0) { in bridge_mdb_configure_handler()
93 if (!link->manager->bridge_mdb_on_master_not_supported) { in bridge_mdb_configure_handler()
94 …log_link_warning_errno(link, r, "Kernel seems not to support bridge MDB entries on bridge master, … in bridge_mdb_configure_handler()
95 link->manager->bridge_mdb_on_master_not_supported = true; in bridge_mdb_configure_handler()
98 log_link_message_warning_errno(link, m, r, "Could not add MDB entry"); in bridge_mdb_configure_handler()
99 link_enter_failed(link); in bridge_mdb_configure_handler()
103 if (link->static_bridge_mdb_messages == 0) { in bridge_mdb_configure_handler()
104 link->static_bridge_mdb_configured = true; in bridge_mdb_configure_handler()
[all …]
Dnetworkd-radv.c54 bool link_radv_enabled(Link *link) { in link_radv_enabled() argument
55 assert(link); in link_radv_enabled()
57 if (!link_may_have_ipv6ll(link)) in link_radv_enabled()
60 if (link->hw_addr.length != ETH_ALEN) in link_radv_enabled()
63 return link->network->router_prefix_delegation; in link_radv_enabled()
180 int link_request_radv_addresses(Link *link) { in link_request_radv_addresses() argument
184 assert(link); in link_request_radv_addresses()
186 if (!link_radv_enabled(link)) in link_request_radv_addresses()
189 HASHMAP_FOREACH(p, link->network->prefixes_by_section) { in link_request_radv_addresses()
200 r = radv_generate_addresses(link, p->tokens, &p->prefix, p->prefixlen, &addresses); in link_request_radv_addresses()
[all …]
Dnetworkd-lldp-tx.c16 static bool link_lldp_tx_enabled(Link *link) { in link_lldp_tx_enabled() argument
17 assert(link); in link_lldp_tx_enabled()
19 if (link->flags & IFF_LOOPBACK) in link_lldp_tx_enabled()
22 if (link->iftype != ARPHRD_ETHER) in link_lldp_tx_enabled()
25 if (!link->network) in link_lldp_tx_enabled()
28 if (link->kind && STR_IN_SET(link->kind, "bridge", "bond")) in link_lldp_tx_enabled()
31 return link->network->lldp_multicast_mode >= 0 && in link_lldp_tx_enabled()
32 link->network->lldp_multicast_mode < _SD_LLDP_MULTICAST_MODE_MAX; in link_lldp_tx_enabled()
35 int link_lldp_tx_configure(Link *link) { in link_lldp_tx_configure() argument
38 assert(link); in link_lldp_tx_configure()
[all …]
Dnetworkd-ipv6-proxy-ndp.c33 Link *link, in ipv6_proxy_ndp_address_configure_handler() argument
39 assert(link); in ipv6_proxy_ndp_address_configure_handler()
43 …log_link_message_warning_errno(link, m, r, "Could not add IPv6 proxy ndp address entry, ignoring"); in ipv6_proxy_ndp_address_configure_handler()
45 if (link->static_ipv6_proxy_ndp_messages == 0) { in ipv6_proxy_ndp_address_configure_handler()
46 log_link_debug(link, "IPv6 proxy NDP addresses set."); in ipv6_proxy_ndp_address_configure_handler()
47 link->static_ipv6_proxy_ndp_configured = true; in ipv6_proxy_ndp_address_configure_handler()
48 link_check_ready(link); in ipv6_proxy_ndp_address_configure_handler()
55 static int ipv6_proxy_ndp_address_configure(const struct in6_addr *address, Link *link, Request *re… in ipv6_proxy_ndp_address_configure() argument
60 assert(link); in ipv6_proxy_ndp_address_configure()
61 assert(link->manager); in ipv6_proxy_ndp_address_configure()
[all …]
Dnetworkd-can.c15 int can_set_netlink_message(Link *link, sd_netlink_message *m) { in can_set_netlink_message() argument
18 assert(link); in can_set_netlink_message()
19 assert(link->network); in can_set_netlink_message()
30 r = sd_netlink_message_open_container_union(m, IFLA_INFO_DATA, link->kind); in can_set_netlink_message()
34 if (link->network->can_bitrate > 0) { in can_set_netlink_message()
36 .bitrate = link->network->can_bitrate, in can_set_netlink_message()
37 .sample_point = link->network->can_sample_point, in can_set_netlink_message()
38 .sjw = link->network->can_sync_jump_width, in can_set_netlink_message()
41 log_link_debug(link, "Setting bitrate = %d bit/s", bt.bitrate); in can_set_netlink_message()
42 if (link->network->can_sample_point > 0) in can_set_netlink_message()
[all …]
/systemd-251/src/udev/net/
Dlink-config.c359 Link *link_free(Link *link) { in link_free() argument
360 if (!link) in link_free()
363 sd_device_unref(link->device); in link_free()
364 free(link->kind); in link_free()
365 free(link->driver); in link_free()
366 return mfree(link); in link_free()
370 _cleanup_(link_freep) Link *link = NULL; in link_new()
378 link = new(Link, 1); in link_new()
379 if (!link) in link_new()
382 *link = (Link) { in link_new()
[all …]
/systemd-251/src/shared/
Dlog-link.h31 #define log_link_full_errno_zerook(link, level, error, ...) \ argument
33 const Link *_l = (link); \
37 #define log_link_full_errno(link, level, error, ...) \ argument
41 log_link_full_errno_zerook(link, level, _error, __VA_ARGS__); \
44 #define log_link_full(link, level, ...) (void) log_link_full_errno_zerook(link, level, 0, __VA_ARGS… argument
46 #define log_link_debug(link, ...) log_link_full(link, LOG_DEBUG, __VA_ARGS__) argument
47 #define log_link_info(link, ...) log_link_full(link, LOG_INFO, __VA_ARGS__) argument
48 #define log_link_notice(link, ...) log_link_full(link, LOG_NOTICE, __VA_ARGS__) argument
49 #define log_link_warning(link, ...) log_link_full(link, LOG_WARNING, __VA_ARGS__) argument
50 #define log_link_error(link, ...) log_link_full(link, LOG_ERR, __VA_ARGS__) argument
[all …]

12345678910>>...14