Lines Matching refs:network
32 if (!link->network) in link_dhcp4_server_enabled()
38 return link->network->dhcp_server; in link_dhcp4_server_enabled()
41 void network_adjust_dhcp_server(Network *network) { in network_adjust_dhcp_server() argument
42 assert(network); in network_adjust_dhcp_server()
44 if (!network->dhcp_server) in network_adjust_dhcp_server()
47 if (network->bond) { in network_adjust_dhcp_server()
49 network->filename); in network_adjust_dhcp_server()
50 network->dhcp_server = false; in network_adjust_dhcp_server()
54 if (!in4_addr_is_set(&network->dhcp_server_address)) { in network_adjust_dhcp_server()
58 ORDERED_HASHMAP_FOREACH(address, network->addresses_by_section) { in network_adjust_dhcp_server()
80 network->filename); in network_adjust_dhcp_server()
81 network->dhcp_server = false; in network_adjust_dhcp_server()
93 assert(link->network); in link_request_dhcp_server_address()
98 if (!in4_addr_is_set(&link->network->dhcp_server_address)) in link_request_dhcp_server_address()
107 address->in_addr.in = link->network->dhcp_server_address; in link_request_dhcp_server_address()
108 address->prefixlen = link->network->dhcp_server_address_prefixlen; in link_request_dhcp_server_address()
125 assert(link->network); in link_find_dhcp_server_address()
128 if (in4_addr_is_set(&link->network->dhcp_server_address)) in link_find_dhcp_server_address()
129 return link_get_ipv4_address(link, &link->network->dhcp_server_address, in link_find_dhcp_server_address()
130 link->network->dhcp_server_address_prefixlen, ret); in link_find_dhcp_server_address()
157 if (link->network->dhcp_server_uplink_name) in dhcp_server_find_uplink()
158 return link_get_by_name(link->manager, link->network->dhcp_server_uplink_name, ret); in dhcp_server_find_uplink()
160 if (link->network->dhcp_server_uplink_index > 0) in dhcp_server_find_uplink()
161 … return link_get_by_index(link->manager, link->network->dhcp_server_uplink_index, ret); in dhcp_server_find_uplink()
163 if (link->network->dhcp_server_uplink_index == UPLINK_INDEX_AUTO) { in dhcp_server_find_uplink()
185 if (!link->network) in link_push_uplink_to_dhcp_server()
187 assert(link->network); in link_push_uplink_to_dhcp_server()
197 for (unsigned i = 0; i < link->network->n_dns; i++) { in link_push_uplink_to_dhcp_server()
201 if (link->network->dns[i]->family != AF_INET) in link_push_uplink_to_dhcp_server()
204 ia = link->network->dns[i]->address.in; in link_push_uplink_to_dhcp_server()
216 use_dhcp_lease_data = link->network->dhcp_use_dns; in link_push_uplink_to_dhcp_server()
223 STRV_FOREACH(i, link->network->ntp) { in link_push_uplink_to_dhcp_server()
239 use_dhcp_lease_data = link->network->dhcp_use_ntp; in link_push_uplink_to_dhcp_server()
246 use_dhcp_lease_data = link->network->dhcp_use_sip; in link_push_uplink_to_dhcp_server()
399 … link->network->dhcp_server_pool_offset, link->network->dhcp_server_pool_size); in dhcp4_server_configure()
403 if (link->network->dhcp_server_max_lease_time_usec > 0) { in dhcp4_server_configure()
405 … DIV_ROUND_UP(link->network->dhcp_server_max_lease_time_usec, USEC_PER_SEC)); in dhcp4_server_configure()
410 if (link->network->dhcp_server_default_lease_time_usec > 0) { in dhcp4_server_configure()
412 … DIV_ROUND_UP(link->network->dhcp_server_default_lease_time_usec, USEC_PER_SEC)); in dhcp4_server_configure()
417 …r = sd_dhcp_server_set_boot_server_address(link->dhcp_server, &link->network->dhcp_server_boot_ser… in dhcp4_server_configure()
421 …r = sd_dhcp_server_set_boot_server_name(link->dhcp_server, link->network->dhcp_server_boot_server_… in dhcp4_server_configure()
425 … r = sd_dhcp_server_set_boot_filename(link->dhcp_server, link->network->dhcp_server_boot_filename); in dhcp4_server_configure()
431 if (!link->network->dhcp_server_emit[type].emit) in dhcp4_server_configure()
434 if (link->network->dhcp_server_emit[type].n_addresses > 0) in dhcp4_server_configure()
439 link->network->dhcp_server_emit[type].addresses, in dhcp4_server_configure()
440 link->network->dhcp_server_emit[type].n_addresses); in dhcp4_server_configure()
448 if (uplink && uplink->network) in dhcp4_server_configure()
466 if (link->network->dhcp_server_emit_router) { in dhcp4_server_configure()
467 … r = sd_dhcp_server_set_router(link->dhcp_server, &link->network->dhcp_server_router); in dhcp4_server_configure()
472 … r = sd_dhcp_server_set_relay_target(link->dhcp_server, &link->network->dhcp_server_relay_target); in dhcp4_server_configure()
476 …ace = sd_dhcp_server_is_in_relay_mode(link->dhcp_server) ? false : link->network->dhcp_server_bind… in dhcp4_server_configure()
481 …lay_agent_information(link->dhcp_server, link->network->dhcp_server_relay_agent_circuit_id, link->… in dhcp4_server_configure()
485 if (link->network->dhcp_server_emit_timezone) { in dhcp4_server_configure()
489 if (link->network->dhcp_server_timezone) in dhcp4_server_configure()
490 tz = link->network->dhcp_server_timezone; in dhcp4_server_configure()
506 ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_send_options) { in dhcp4_server_configure()
514 ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_send_vendor_options) { in dhcp4_server_configure()
522 HASHMAP_FOREACH(static_lease, link->network->dhcp_static_leases_by_section) { in dhcp4_server_configure()
542 if (!link->network) in dhcp_server_is_ready_to_configure()
566 if (uplink && !uplink->network) in dhcp_server_is_ready_to_configure()
714 Network *network = ASSERT_PTR(userdata); in config_parse_dhcp_server_address() local
724 network->dhcp_server_address = (struct in_addr) {}; in config_parse_dhcp_server_address()
725 network->dhcp_server_address_prefixlen = 0; in config_parse_dhcp_server_address()
742 network->dhcp_server_address = a.in; in config_parse_dhcp_server_address()
743 network->dhcp_server_address_prefixlen = prefixlen; in config_parse_dhcp_server_address()