Home
last modified time | relevance | path

Searched refs:address (Results 1 – 25 of 158) sorted by relevance

1234567

/systemd-251/src/network/
Dnetworkd-ipv4acd.c12 static int static_ipv4acd_address_remove(Link *link, Address *address, bool on_conflict) { in static_ipv4acd_address_remove() argument
16 assert(address); in static_ipv4acd_address_remove()
19 address_enter_probing(address); in static_ipv4acd_address_remove()
21 if (!address_exists(address)) in static_ipv4acd_address_remove()
26 IPV4_ADDRESS_FMT_VAL(address->in_addr.in)); in static_ipv4acd_address_remove()
29 IPV4_ADDRESS_FMT_VAL(address->in_addr.in)); in static_ipv4acd_address_remove()
31 r = address_remove(address); in static_ipv4acd_address_remove()
34 IPV4_ADDRESS_FMT_VAL(address->in_addr.in)); in static_ipv4acd_address_remove()
39 static int dhcp4_address_on_conflict(Link *link, Address *address) { in dhcp4_address_on_conflict() argument
59 address_cancel_probing(address); in dhcp4_address_on_conflict()
[all …]
Dnetworkd-address.c59 _cleanup_(address_freep) Address *address = NULL; in address_new()
61 address = new(Address, 1); in address_new()
62 if (!address) in address_new()
65 *address = (Address) { in address_new()
73 *ret = TAKE_PTR(address); in address_new()
80 _cleanup_(address_freep) Address *address = NULL; in address_new_static()
92 address = ordered_hashmap_get(network->addresses_by_section, n); in address_new_static()
93 if (address) { in address_new_static()
94 *ret = TAKE_PTR(address); in address_new_static()
101 r = address_new(&address); in address_new_static()
[all …]
Dnetworkd-address.h20 typedef int (*address_ready_callback_t)(Address *address);
26 Address *address);
76 Address* address_free(Address *address);
79 int address_remove(Address *address);
90 bool link_address_is_dynamic(const Link *link, const Address *address);
91 int link_get_address(Link *link, int family, const union in_addr_union *address, unsigned char pref…
92 static inline int link_get_ipv6_address(Link *link, const struct in6_addr *address, unsigned char p… in link_get_ipv6_address() argument
93 assert(address); in link_get_ipv6_address()
94 …return link_get_address(link, AF_INET6, &(union in_addr_union) { .in6 = *address }, prefixlen, ret… in link_get_ipv6_address()
96 static inline int link_get_ipv4_address(Link *link, const struct in_addr *address, unsigned char pr… in link_get_ipv4_address() argument
[all …]
Dnetworkd-dhcp-server.c55 Address *address; in network_adjust_dhcp_server() local
58 ORDERED_HASHMAP_FOREACH(address, network->addresses_by_section) { in network_adjust_dhcp_server()
59 if (section_is_invalid(address->section)) in network_adjust_dhcp_server()
62 if (address->family != AF_INET) in network_adjust_dhcp_server()
65 if (in4_addr_is_localhost(&address->in_addr.in)) in network_adjust_dhcp_server()
68 if (in4_addr_is_link_local(&address->in_addr.in)) in network_adjust_dhcp_server()
71 if (in4_addr_is_set(&address->in_addr_peer.in)) in network_adjust_dhcp_server()
88 _cleanup_(address_freep) Address *address = NULL; in link_request_dhcp_server_address()
101 r = address_new(&address); in link_request_dhcp_server_address()
105 address->source = NETWORK_CONFIG_SOURCE_STATIC; in link_request_dhcp_server_address()
[all …]
Dnetworkd-ipv4ll.c15 _cleanup_(address_freep) Address *address = NULL; in address_new_from_ipv4ll()
27 r = address_new(&address); in address_new_from_ipv4ll()
31 address->source = NETWORK_CONFIG_SOURCE_IPV4LL; in address_new_from_ipv4ll()
32 address->family = AF_INET; in address_new_from_ipv4ll()
33 address->in_addr.in = addr; in address_new_from_ipv4ll()
34 address->prefixlen = 16; in address_new_from_ipv4ll()
35 address->scope = RT_SCOPE_LINK; in address_new_from_ipv4ll()
36 address->route_metric = IPV4LL_ROUTE_METRIC; in address_new_from_ipv4ll()
37 address_set_broadcast(address, link); in address_new_from_ipv4ll()
39 *ret = TAKE_PTR(address); in address_new_from_ipv4ll()
[all …]
Dnetworkd-ipv6-proxy-ndp.c34 struct in6_addr *address) { in ipv6_proxy_ndp_address_configure_handler() argument
55 static int ipv6_proxy_ndp_address_configure(const struct in6_addr *address, Link *link, Request *re… in ipv6_proxy_ndp_address_configure() argument
59 assert(address); in ipv6_proxy_ndp_address_configure()
74 r = sd_netlink_message_append_in6_addr(m, NDA_DST, address); in ipv6_proxy_ndp_address_configure()
81 …ic int ipv6_proxy_ndp_address_process_request(Request *req, Link *link, struct in6_addr *address) { in ipv6_proxy_ndp_address_process_request() argument
86 assert(address); in ipv6_proxy_ndp_address_process_request()
91 r = ipv6_proxy_ndp_address_configure(address, link, req); in ipv6_proxy_ndp_address_process_request()
99 struct in6_addr *address; in link_request_static_ipv6_proxy_ndp_addresses() local
107 SET_FOREACH(address, link->network->ipv6_proxy_ndp_addresses) { in link_request_static_ipv6_proxy_ndp_addresses()
109 address, NULL, in link_request_static_ipv6_proxy_ndp_addresses()
[all …]
Dnetworkd-dhcp-prefix-delegation.c131 Address *address; in dhcp_pd_get_assigned_subnet_prefix() local
133 SET_FOREACH(address, link->addresses) { in dhcp_pd_get_assigned_subnet_prefix()
134 if (address->source != NETWORK_CONFIG_SOURCE_DHCP_PD) in dhcp_pd_get_assigned_subnet_prefix()
136 assert(address->family == AF_INET6); in dhcp_pd_get_assigned_subnet_prefix()
138 … if (in6_addr_prefix_covers(pd_prefix, pd_prefix_len, &address->in_addr.in6) <= 0) in dhcp_pd_get_assigned_subnet_prefix()
142 struct in6_addr prefix = address->in_addr.in6; in dhcp_pd_get_assigned_subnet_prefix()
201 Address *address; in dhcp_pd_remove() local
203 SET_FOREACH(address, link->addresses) { in dhcp_pd_remove()
206 if (address->source != NETWORK_CONFIG_SOURCE_DHCP_PD) in dhcp_pd_remove()
208 if (only_marked && !address_is_marked(address)) in dhcp_pd_remove()
[all …]
Dnetworkd-ndisc.c85 Address *address; in ndisc_remove() local
106 SET_FOREACH(address, link->addresses) { in ndisc_remove()
107 if (address->source != NETWORK_CONFIG_SOURCE_NDISC) in ndisc_remove()
109 if (!address_is_marked(address)) in ndisc_remove()
111 if (router && !in6_addr_equal(router, &address->provider.in6)) in ndisc_remove()
114 k = address_remove(address); in ndisc_remove()
118 address_cancel_request(address); in ndisc_remove()
149 static int ndisc_address_ready_callback(Address *address) { in ndisc_address_ready_callback() argument
152 assert(address); in ndisc_address_ready_callback()
153 assert(address->link); in ndisc_address_ready_callback()
[all …]
Dnetworkd-dhcp6.c47 Address *address; in dhcp6_remove() local
69 SET_FOREACH(address, link->addresses) { in dhcp6_remove()
70 if (address->source != NETWORK_CONFIG_SOURCE_DHCP6) in dhcp6_remove()
72 if (only_marked && !address_is_marked(address)) in dhcp6_remove()
75 k = address_remove(address); in dhcp6_remove()
79 address_cancel_request(address); in dhcp6_remove()
85 static int dhcp6_address_ready_callback(Address *address) { in dhcp6_address_ready_callback() argument
88 assert(address); in dhcp6_address_ready_callback()
89 assert(address->link); in dhcp6_address_ready_callback()
91 SET_FOREACH(a, address->link->addresses) in dhcp6_address_ready_callback()
[all …]
Dnetworkd-dhcp4.c58 Address *address; in dhcp4_remove_address_and_routes() local
77 SET_FOREACH(address, link->addresses) { in dhcp4_remove_address_and_routes()
78 if (address->source != NETWORK_CONFIG_SOURCE_DHCP4) in dhcp4_remove_address_and_routes()
80 if (only_marked && !address_is_marked(address)) in dhcp4_remove_address_and_routes()
83 k = address_remove(address); in dhcp4_remove_address_and_routes()
87 address_cancel_request(address); in dhcp4_remove_address_and_routes()
94 Address *address; in dhcp4_address_get() local
98 SET_FOREACH(address, link->addresses) { in dhcp4_address_get()
99 if (address->source != NETWORK_CONFIG_SOURCE_DHCP4) in dhcp4_address_get()
101 if (address_is_marked(address)) in dhcp4_address_get()
[all …]
Dnetworkd-json.c22 static int address_build_json(Address *address, JsonVariant **ret) { in address_build_json() argument
27 assert(address); in address_build_json()
30 r = route_scope_to_string_alloc(address->scope, &scope); in address_build_json()
34 r = address_flags_to_string_alloc(address->flags, address->family, &flags); in address_build_json()
38 r = network_config_state_to_string_alloc(address->state, &state); in address_build_json()
43 JSON_BUILD_PAIR_INTEGER("Family", address->family), in address_build_json()
44 … JSON_BUILD_PAIR_IN_ADDR("Address", &address->in_addr, address->family), in address_build_json()
45 … JSON_BUILD_PAIR_IN_ADDR_NON_NULL("Peer", &address->in_addr_peer, address->family), in address_build_json()
46 JSON_BUILD_PAIR_IN4_ADDR_NON_NULL("Broadcast", &address->broadcast), in address_build_json()
47 JSON_BUILD_PAIR_UNSIGNED("PrefixLength", address->prefixlen), in address_build_json()
[all …]
/systemd-251/src/libsystemd-network/
Dsd-dhcp-server.c35 …hashmap_remove_value(lease->server->bound_leases_by_address, UINT32_TO_PTR(lease->address), lease); in dhcp_lease_free()
37 …ashmap_remove_value(lease->server->static_leases_by_address, UINT32_TO_PTR(lease->address), lease); in dhcp_lease_free()
53 const struct in_addr *address, in sd_dhcp_server_configure_pool() argument
63 assert_return(address, -EINVAL); in sd_dhcp_server_configure_pool()
64 assert_return(address->s_addr != INADDR_ANY, -EINVAL); in sd_dhcp_server_configure_pool()
70 server_off = be32toh(address->s_addr & ~netmask); in sd_dhcp_server_configure_pool()
96 …if (server->address != address->s_addr || server->netmask != netmask || server->pool_size != size … in sd_dhcp_server_configure_pool()
101 server->address = address->s_addr; in sd_dhcp_server_configure_pool()
103 server->subnet = address->s_addr & netmask; in sd_dhcp_server_configure_pool()
206 .address = htobe32(INADDR_ANY), in sd_dhcp_server_new()
[all …]
Dsd-ipv4ll.c36 be32_t address; /* the address pushed to ACD */ member
187 int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address) { in sd_ipv4ll_get_address() argument
189 assert_return(address, -EINVAL); in sd_ipv4ll_get_address()
194 address->s_addr = ll->claimed_address; in sd_ipv4ll_get_address()
215 static bool ipv4ll_address_is_valid(const struct in_addr *address) { in ipv4ll_address_is_valid() argument
216 assert(address); in ipv4ll_address_is_valid()
218 if (!in4_addr_is_link_local(address)) in ipv4ll_address_is_valid()
221 return !IN_SET(be32toh(address->s_addr) & 0x0000FF00U, 0x0000U, 0xFF00U); in ipv4ll_address_is_valid()
224 int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address) { in sd_ipv4ll_set_address() argument
228 assert_return(address, -EINVAL); in sd_ipv4ll_set_address()
[all …]
Dsd-ipv4acd.c67 struct in_addr address; member
239 r = arp_send_probe(acd->fd, acd->ifindex, &acd->address, &acd->mac_addr); in ipv4acd_on_timeout()
245 … log_ipv4acd(acd, "Probing "IPV4_ADDRESS_FMT_STR, IPV4_ADDRESS_FMT_VAL(acd->address)); in ipv4acd_on_timeout()
272 r = arp_send_announcement(acd->fd, acd->ifindex, &acd->address, &acd->mac_addr); in ipv4acd_on_timeout()
278 … log_ipv4acd(acd, "Announcing "IPV4_ADDRESS_FMT_STR, IPV4_ADDRESS_FMT_VAL(acd->address)); in ipv4acd_on_timeout()
312 if (memcmp(arp->arp_spa, &acd->address, sizeof(struct in_addr)) == 0) in ipv4acd_arp_conflict()
326 if (memcmp(arp->arp_tpa, &acd->address, sizeof(struct in_addr)) != 0) in ipv4acd_arp_conflict()
342 …cd, "Conflict on "IPV4_ADDRESS_FMT_STR" (%u)", IPV4_ADDRESS_FMT_VAL(acd->address), acd->n_conflict… in ipv4acd_on_conflict()
389 … r = arp_send_announcement(acd->fd, acd->ifindex, &acd->address, &acd->mac_addr); in ipv4acd_on_packet()
395 … log_ipv4acd(acd, "Defending "IPV4_ADDRESS_FMT_STR, IPV4_ADDRESS_FMT_VAL(acd->address)); in ipv4acd_on_packet()
[all …]
Dtest-dhcp-server.c15 static void test_pool(struct in_addr *address, unsigned size, int ret) { in test_pool() argument
20 assert_se(sd_dhcp_server_configure_pool(server, address, 8, 0, size) == ret); in test_pool()
89 be32_t address; in test_message_handler() member
94 be32_t address; in test_message_handler() member
166 test.option_requested_ip.address = htobe32(0x12345678); in test_message_handler()
170 test.option_server_id.address = htobe32(INADDR_LOOPBACK); in test_message_handler()
171 test.option_requested_ip.address = htobe32(INADDR_LOOPBACK + 3); in test_message_handler()
174 test.option_server_id.address = htobe32(0x12345678); in test_message_handler()
175 test.option_requested_ip.address = htobe32(INADDR_LOOPBACK + 3); in test_message_handler()
177 test.option_server_id.address = htobe32(INADDR_LOOPBACK); in test_message_handler()
[all …]
Dtest-ipv4ll.c77 struct in_addr address = {}; in test_public_api_setters() local
96 assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL); in test_public_api_setters()
97 address.s_addr |= htobe32(169U << 24 | 254U << 16); in test_public_api_setters()
98 assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL); in test_public_api_setters()
99 address.s_addr |= htobe32(0x00FF); in test_public_api_setters()
100 assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL); in test_public_api_setters()
101 address.s_addr |= htobe32(0xF000); in test_public_api_setters()
102 assert_se(sd_ipv4ll_set_address(ll, &address) == 0); in test_public_api_setters()
103 address.s_addr |= htobe32(0x0F00); in test_public_api_setters()
104 assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL); in test_public_api_setters()
Dtest-ndisc-ra.c58 struct in6_addr address; member
129 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 64) >= 0); in TEST()
130 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 0) < 0); in TEST()
131 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 1) < 0); in TEST()
132 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 2) < 0); in TEST()
133 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 3) >= 0); in TEST()
134 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 125) >= 0); in TEST()
135 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 128) >= 0); in TEST()
136 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 129) < 0); in TEST()
137 assert_se(sd_radv_prefix_set_prefix(p, &prefix[0].address, 255) < 0); in TEST()
[all …]
Dfuzz-dhcp-server.c31 lease->address = htobe32(UINT32_C(10) << 24 | i); in add_lease()
38 …map_ensure_put(&server->bound_leases_by_address, NULL, UINT32_TO_PTR(lease->address), lease) >= 0); in add_lease()
54 struct in_addr address = { .s_addr = htobe32(UINT32_C(10) << 24 | UINT32_C(1))}; in LLVMFuzzerTestOneInput() local
66 assert_se(sd_dhcp_server_configure_pool(server, &address, 24, 0, 0) >= 0); in LLVMFuzzerTestOneInput()
69 add_lease(server, &address, 2); in LLVMFuzzerTestOneInput()
70 add_lease(server, &address, 3); in LLVMFuzzerTestOneInput()
/systemd-251/src/shared/
Din-addr-prefix-util.c17 .address.in.s_addr = htobe32(UINT32_C(127) << 24), \
24 .address.in6 = IN6ADDR_LOOPBACK_INIT, \
31 .address.in.s_addr = htobe32((UINT32_C(169) << 24) | \
39 .address.in6.s6_addr[0] = 0xfe, \
40 .address.in6.s6_addr[1] = 0x80, \
47 .address.in.s_addr = htobe32((UINT32_C(224) << 24)), \
54 .address.in6.s6_addr[0] = 0xff, \
64 siphash24_compress(&a->address, FAMILY_ADDRESS_SIZE(a->family), state); in in_addr_prefix_hash_func()
81 return memcmp(&x->address, &y->address, FAMILY_ADDRESS_SIZE(x->family)); in in_addr_prefix_compare_func()
98 (void) in_addr_mask(copy->family, &copy->address, copy->prefixlen); in in_addr_prefix_add()
[all …]
Dlocal-addresses.c36 return memcmp(&a->address, &b->address, FAMILY_ADDRESS_SIZE(a->family)); in address_compare()
143 r = sd_netlink_message_read_in_addr(m, IFA_LOCAL, &a->address.in); in local_addresses()
145 r = sd_netlink_message_read_in_addr(m, IFA_ADDRESS, &a->address.in); in local_addresses()
152 r = sd_netlink_message_read_in6_addr(m, IFA_LOCAL, &a->address.in6); in local_addresses()
154 … r = sd_netlink_message_read_in6_addr(m, IFA_ADDRESS, &a->address.in6); in local_addresses()
201 .address = via->address, in add_local_gateway()
311 via.address = gateway; in local_gateways()
407 .sin_addr = gateways[i].address.in, in local_outbounds()
417 .sin6_addr = gateways[i].address.in6, in local_outbounds()
476 .address.in = sa.in.sin_addr, in local_outbounds()
[all …]
/systemd-251/src/resolve/
Dresolved-dns-synthesize.c154 … r = dns_resource_record_new_address(&rr, addresses[j].family, &addresses[j].address, name); in answer_add_addresses_rr()
188 if (match && !in_addr_equal(af, match, &addresses[j].address)) in answer_add_addresses_ptr()
196 … r = dns_resource_record_new_reverse(&rr, addresses[j].family, &addresses[j].address, name); in answer_add_addresses_ptr()
234 .address.in.s_addr = htobe32(0x7F000002), in synthesize_system_hostname_rr()
241 .address.in6 = in6addr_loopback, in synthesize_system_hostname_rr()
253 static int synthesize_system_hostname_ptr(Manager *m, int af, const union in_addr_union *address, i… in synthesize_system_hostname_ptr() argument
259 assert(address); in synthesize_system_hostname_ptr()
262 if (af == AF_INET && address->in.s_addr == htobe32(0x7F000002)) { in synthesize_system_hostname_ptr()
293 r = answer_add_addresses_ptr(answer, m->full_hostname, addresses, n, af, address); in synthesize_system_hostname_ptr()
299 r = answer_add_addresses_ptr(answer, m->llmnr_hostname, addresses, n, af, address); in synthesize_system_hostname_ptr()
[all …]
Dresolved-etc-hosts.c45 struct in_addr_data address = {}; in parse_line() local
58 r = in_addr_ifindex_from_string_auto(address_str, &address.family, &address.address, NULL); in parse_line()
64 r = in_addr_data_is_null(&address); in parse_line()
76 item = hashmap_get(hosts->by_address, &address); in parse_line()
87 .address = address, in parse_line()
90 r = hashmap_put(hosts->by_address, &item->address, item); in parse_line()
156 bn->addresses[bn->n_addresses++] = &item->address; in parse_line()
171 .address.in.s_addr = UINT32_C(0x0100007F), in strip_localhost()
173 .address.in.s_addr = UINT32_C(0x7F000001), in strip_localhost()
178 .address.in6 = IN6ADDR_LOOPBACK_INIT, in strip_localhost()
[all …]
/systemd-251/src/basic/
Din-addr-util.h20 union in_addr_union address; member
37 return in_addr_is_null(a->family, &a->address); in in_addr_data_is_null()
96 …refix_covers(const struct in_addr *prefix, unsigned char prefixlen, const struct in_addr *address);
97 …fix_covers(const struct in6_addr *prefix, unsigned char prefixlen, const struct in6_addr *address);
98 …y, const union in_addr_union *prefix, unsigned char prefixlen, const union in_addr_union *address);
137 #define IPV4_ADDRESS_FMT_VAL(address) \ argument
138 be32toh((address).s_addr) >> 24, \
139 (be32toh((address).s_addr) >> 16) & 0xFFu, \
140 (be32toh((address).s_addr) >> 8) & 0xFFu, \
141 be32toh((address).s_addr) & 0xFFu
/systemd-251/src/network/generator/
Dnetwork-generator.c75 static Address *address_free(Address *address) { in address_free() argument
76 if (!address) in address_free()
79 if (address->network) in address_free()
80 LIST_REMOVE(addresses, address->network->addresses, address); in address_free()
82 return mfree(address); in address_free()
87 Address *address; in address_new() local
91 address = new(Address, 1); in address_new()
92 if (!address) in address_new()
95 *address = (Address) { in address_new()
98 .address = *addr, in address_new()
[all …]
/systemd-251/src/libsystemd/sd-bus/
Dtest-bus-benchmark.c76 static void client_bisect(const char *address, const char *server_name) { in client_bisect() argument
85 r = sd_bus_set_address(b, address); in client_bisect()
150 static void client_chart(Type type, const char *address, const char *server_name, int fd) { in client_chart() argument
163 r = sd_bus_set_address(b, address); in client_chart()
216 _cleanup_free_ char *address = NULL, *server_name = NULL; in main() local
248 address = strdup(e); in main()
249 assert_se(address); in main()
264 r = sd_bus_set_address(b, address); in main()
298 client_bisect(address, server_name); in main()
302 client_chart(type, address, server_name, pair[1]); in main()

1234567