/systemd-251/src/libsystemd-network/ |
D | sd-dhcp6-lease.c | 16 static void dhcp6_lease_set_timestamp(sd_dhcp6_lease *lease, const triple_timestamp *timestamp) { in dhcp6_lease_set_timestamp() argument 17 assert(lease); in dhcp6_lease_set_timestamp() 20 lease->timestamp = *timestamp; in dhcp6_lease_set_timestamp() 22 triple_timestamp_get(&lease->timestamp); in dhcp6_lease_set_timestamp() 25 int sd_dhcp6_lease_get_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret) { in sd_dhcp6_lease_get_timestamp() argument 26 assert_return(lease, -EINVAL); in sd_dhcp6_lease_get_timestamp() 31 if (!triple_timestamp_is_set(&lease->timestamp)) in sd_dhcp6_lease_get_timestamp() 34 *ret = triple_timestamp_by_clock(&lease->timestamp, clock); in sd_dhcp6_lease_get_timestamp() 42 static void dhcp6_lease_set_lifetime(sd_dhcp6_lease *lease) { in dhcp6_lease_set_lifetime() argument 45 assert(lease); in dhcp6_lease_set_lifetime() [all …]
|
D | sd-dhcp-lease.c | 34 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_address() argument 35 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_address() 38 if (lease->address == 0) in sd_dhcp_lease_get_address() 41 addr->s_addr = lease->address; in sd_dhcp_lease_get_address() 45 int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_broadcast() argument 46 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_broadcast() 49 if (!lease->have_broadcast) in sd_dhcp_lease_get_broadcast() 52 addr->s_addr = lease->broadcast; in sd_dhcp_lease_get_broadcast() 56 int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime) { in sd_dhcp_lease_get_lifetime() argument 57 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_lifetime() [all …]
|
D | fuzz-dhcp-server.c | 22 DHCPLease *lease; in add_lease() local 26 assert_se(lease = new0(DHCPLease, 1)); in add_lease() 27 lease->client_id.length = 2; in add_lease() 28 assert_se(lease->client_id.data = malloc(2)); in add_lease() 29 lease->client_id.data[0] = 2; in add_lease() 30 lease->client_id.data[1] = i; in add_lease() 31 lease->address = htobe32(UINT32_C(10) << 24 | i); in add_lease() 32 lease->gateway = server_address->s_addr; in add_lease() 33 lease->expiration = UINT64_MAX; in add_lease() 34 lease->htype = ARPHRD_ETHER; in add_lease() [all …]
|
D | dhcp6-lease-internal.h | 48 int dhcp6_lease_get_lifetime(sd_dhcp6_lease *lease, usec_t *ret_t1, usec_t *ret_t2, usec_t *ret_val… 49 int dhcp6_lease_set_clientid(sd_dhcp6_lease *lease, const uint8_t *id, size_t len); 50 int dhcp6_lease_get_clientid(sd_dhcp6_lease *lease, uint8_t **ret_id, size_t *ret_len); 51 int dhcp6_lease_set_serverid(sd_dhcp6_lease *lease, const uint8_t *id, size_t len); 52 int dhcp6_lease_get_serverid(sd_dhcp6_lease *lease, uint8_t **ret_id, size_t *ret_len); 53 int dhcp6_lease_set_preference(sd_dhcp6_lease *lease, uint8_t preference); 54 int dhcp6_lease_get_preference(sd_dhcp6_lease *lease, uint8_t *ret); 55 int dhcp6_lease_set_rapid_commit(sd_dhcp6_lease *lease); 56 int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *ret); 58 int dhcp6_lease_add_dns(sd_dhcp6_lease *lease, const uint8_t *optval, size_t optlen); [all …]
|
D | test-dhcp6-client.c | 437 _cleanup_(sd_dhcp6_lease_unrefp) sd_dhcp6_lease *lease = NULL; in TEST() 443 …6_lease_new_from_message(client, (const DHCP6Message*) msg, sizeof(msg), NULL, NULL, &lease) >= 0); in TEST() 756 sd_dhcp6_lease *lease; in test_lease_common() local 763 assert_se(sd_dhcp6_client_get_lease(client, &lease) >= 0); in test_lease_common() 765 assert_se(dhcp6_lease_get_clientid(lease, &id, &len) >= 0); in test_lease_common() 768 assert_se(sd_dhcp6_lease_get_domains(lease, &strv) == 1); in test_lease_common() 772 assert_se(sd_dhcp6_lease_get_fqdn(lease, &str) >= 0); in test_lease_common() 775 assert_se(sd_dhcp6_lease_get_dns(lease, &addrs) == 2); in test_lease_common() 779 assert_se(sd_dhcp6_lease_get_ntp_addrs(lease, &addrs) == 2); in test_lease_common() 783 assert_se(sd_dhcp6_lease_get_ntp_fqdn(lease, &strv) == 1); in test_lease_common() [all …]
|
D | sd-dhcp-client.c | 117 sd_dhcp_lease *lease; member 685 *ret = client->lease; in sd_dhcp_client_get_lease() 733 client->lease = sd_dhcp_lease_unref(client->lease); in client_initialize() 1137 4, &client->lease->server_address); in client_send_request() 1143 4, &client->lease->address); in client_send_request() 1174 request->dhcp.ciaddr = client->lease->address; in client_send_request() 1197 client->lease->server_address, in client_send_request() 1500 if (client->lease) in client_timeout_t1() 1510 _cleanup_(sd_dhcp_lease_unrefp) sd_dhcp_lease *lease = NULL; in client_handle_offer() 1513 r = dhcp_lease_new(&lease); in client_handle_offer() [all …]
|
D | sd-dhcp-server.c | 30 static DHCPLease *dhcp_lease_free(DHCPLease *lease) { in dhcp_lease_free() argument 31 if (!lease) in dhcp_lease_free() 34 if (lease->server) { in dhcp_lease_free() 35 …hashmap_remove_value(lease->server->bound_leases_by_address, UINT32_TO_PTR(lease->address), lease); in dhcp_lease_free() 36 … hashmap_remove_value(lease->server->bound_leases_by_client_id, &lease->client_id, lease); in dhcp_lease_free() 37 …hashmap_remove_value(lease->server->static_leases_by_address, UINT32_TO_PTR(lease->address), lease… in dhcp_lease_free() 38 … hashmap_remove_value(lease->server->static_leases_by_client_id, &lease->client_id, lease); in dhcp_lease_free() 41 free(lease->client_id.data); in dhcp_lease_free() 42 return mfree(lease); in dhcp_lease_free() 957 _cleanup_(dhcp_lease_freep) DHCPLease *lease = NULL; in prepare_new_lease() [all …]
|
D | sd-dhcp6-client.c | 497 if (!client->lease) in sd_dhcp6_client_get_lease() 501 *ret = client->lease; in sd_dhcp6_client_get_lease() 546 client->lease = sd_dhcp6_lease_unref(client->lease); in client_stop() 731 client->lease->serverid_len, in dhcp6_client_send_message() 732 client->lease->serverid); in dhcp6_client_send_message() 739 assert(client->lease); in dhcp6_client_send_message() 742 … client->lease->ia_na, client->lease->ia_pd); in dhcp6_client_send_message() 815 if (client->retransmit_count > 0 && client->lease) { in client_timeout_resend() 992 assert(client->lease); in client_enter_bound_state() 1002 r = dhcp6_lease_get_lifetime(client->lease, &lifetime_t1, &lifetime_t2, &lifetime_valid); in client_enter_bound_state() [all …]
|
D | meson.build | 10 'dhcp-lease-internal.h', 17 'dhcp6-lease-internal.h', 39 'sd-dhcp-lease.c', 42 'sd-dhcp6-lease.c', 66 [files('test-sd-dhcp-lease.c'),
|
D | dhcp-lease-internal.h | 86 int dhcp_lease_insert_private_option(sd_dhcp_lease *lease, uint8_t tag, const void *data, uint8_t l… 88 int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease *lease); 90 int dhcp_lease_set_client_id(sd_dhcp_lease *lease, const void *client_id, size_t client_id_len);
|
D | test-dhcp-client.c | 397 sd_dhcp_lease *lease; in test_addr_acq_acquired() local 404 assert_se(sd_dhcp_client_get_lease(client, &lease) >= 0); in test_addr_acq_acquired() 405 assert_se(lease); in test_addr_acq_acquired() 407 assert_se(sd_dhcp_lease_get_address(lease, &addr) >= 0); in test_addr_acq_acquired() 411 assert_se(sd_dhcp_lease_get_netmask(lease, &addr) >= 0); in test_addr_acq_acquired() 415 assert_se(sd_dhcp_lease_get_router(lease, &addrs) == 1); in test_addr_acq_acquired()
|
D | network-internal.h | 30 int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file);
|
D | dhcp6-internal.h | 75 struct sd_dhcp6_lease *lease; member
|
/systemd-251/src/systemd/ |
D | sd-dhcp-lease.h | 34 sd_dhcp_lease *sd_dhcp_lease_ref(sd_dhcp_lease *lease); 35 sd_dhcp_lease *sd_dhcp_lease_unref(sd_dhcp_lease *lease); 49 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr); 50 int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime); 51 int sd_dhcp_lease_get_t1(sd_dhcp_lease *lease, uint32_t *t1); 52 int sd_dhcp_lease_get_t2(sd_dhcp_lease *lease, uint32_t *t2); 53 int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr); 54 int sd_dhcp_lease_get_netmask(sd_dhcp_lease *lease, struct in_addr *addr); 55 int sd_dhcp_lease_get_router(sd_dhcp_lease *lease, const struct in_addr **addr); 56 int sd_dhcp_lease_get_next_server(sd_dhcp_lease *lease, struct in_addr *addr); [all …]
|
D | sd-dhcp6-lease.h | 32 int sd_dhcp6_lease_get_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret); 33 int sd_dhcp6_lease_get_server_address(sd_dhcp6_lease *lease, struct in6_addr *ret); 35 void sd_dhcp6_lease_reset_address_iter(sd_dhcp6_lease *lease); 36 int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease, 40 void sd_dhcp6_lease_reset_pd_prefix_iter(sd_dhcp6_lease *lease); 41 int sd_dhcp6_lease_get_pd(sd_dhcp6_lease *lease, struct in6_addr *prefix, 46 int sd_dhcp6_lease_get_dns(sd_dhcp6_lease *lease, const struct in6_addr **ret); 47 int sd_dhcp6_lease_get_domains(sd_dhcp6_lease *lease, char ***ret); 48 int sd_dhcp6_lease_get_ntp_addrs(sd_dhcp6_lease *lease, const struct in6_addr **ret); 49 int sd_dhcp6_lease_get_ntp_fqdn(sd_dhcp6_lease *lease, char ***ret); [all …]
|
D | meson.build | 23 'sd-dhcp6-lease.h', 25 'sd-dhcp-lease.h',
|
/systemd-251/src/network/ |
D | networkd-dhcp-server-static-lease.c | 116 _cleanup_(dhcp_static_lease_free_or_set_invalidp) DHCPStaticLease *lease = NULL; in config_parse_dhcp_static_lease_address() 126 r = lease_new_static(network, filename, section_line, &lease); in config_parse_dhcp_static_lease_address() 131 lease->address.s_addr = 0; in config_parse_dhcp_static_lease_address() 132 TAKE_PTR(lease); in config_parse_dhcp_static_lease_address() 148 lease->address = addr.in; in config_parse_dhcp_static_lease_address() 150 TAKE_PTR(lease); in config_parse_dhcp_static_lease_address() 166 _cleanup_(dhcp_static_lease_free_or_set_invalidp) DHCPStaticLease *lease = NULL; in config_parse_dhcp_static_lease_hwaddr() 177 r = lease_new_static(network, filename, section_line, &lease); in config_parse_dhcp_static_lease_hwaddr() 182 lease->client_id = mfree(lease->client_id); in config_parse_dhcp_static_lease_hwaddr() 183 lease->client_id_size = 0; in config_parse_dhcp_static_lease_hwaddr() [all …]
|
D | networkd-dhcp-server-bus.c | 22 DHCPLease *lease; in property_get_leases() local 39 HASHMAP_FOREACH(lease, s->bound_leases_by_client_id) { in property_get_leases() 48 … r = sd_bus_message_append_array(reply, 'y', lease->client_id.data, lease->client_id.length); in property_get_leases() 52 … r = sd_bus_message_append_array(reply, 'y', &lease->address, sizeof(lease->address)); in property_get_leases() 56 … r = sd_bus_message_append_array(reply, 'y', &lease->gateway, sizeof(lease->gateway)); in property_get_leases() 60 r = sd_bus_message_append_array(reply, 'y', &lease->chaddr, sizeof(lease->chaddr)); in property_get_leases() 64 r = sd_bus_message_append_basic(reply, 't', &lease->expiration); in property_get_leases()
|
D | networkd-dhcp-prefix-delegation.h | 16 bool dhcp4_lease_has_pd_prefix(sd_dhcp_lease *lease); 17 bool dhcp6_lease_has_pd_prefix(sd_dhcp6_lease *lease);
|
D | networkd-dhcp4.c | 958 sd_dhcp_lease *lease; in dhcp_lease_renew() local 965 r = sd_dhcp_client_get_lease(client, &lease); in dhcp_lease_renew() 970 link->dhcp_lease = sd_dhcp_lease_ref(lease); in dhcp_lease_renew() 986 sd_dhcp_lease *lease; in dhcp_lease_acquired() local 992 r = sd_dhcp_client_get_lease(client, &lease); in dhcp_lease_acquired() 997 link->dhcp_lease = sd_dhcp_lease_ref(lease); in dhcp_lease_acquired() 1003 r = sd_dhcp_lease_get_mtu(lease, &mtu); in dhcp_lease_acquired() 1018 (void) sd_dhcp_lease_get_hostname(lease, &dhcpname); in dhcp_lease_acquired() 1068 sd_dhcp_lease *lease; in dhcp_server_is_filtered() local 1076 r = sd_dhcp_client_get_lease(client, &lease); in dhcp_server_is_filtered() [all …]
|
D | networkd-dhcp-prefix-delegation.c | 54 bool dhcp4_lease_has_pd_prefix(sd_dhcp_lease *lease) { in dhcp4_lease_has_pd_prefix() argument 55 if (!lease) in dhcp4_lease_has_pd_prefix() 58 return sd_dhcp_lease_get_6rd(lease, NULL, NULL, NULL, NULL, NULL) >= 0; in dhcp4_lease_has_pd_prefix() 61 bool dhcp6_lease_has_pd_prefix(sd_dhcp6_lease *lease) { in dhcp6_lease_has_pd_prefix() argument 66 if (!lease) in dhcp6_lease_has_pd_prefix() 69 sd_dhcp6_lease_reset_pd_prefix_iter(lease); in dhcp6_lease_has_pd_prefix() 71 …return sd_dhcp6_lease_get_pd(lease, &pd_prefix, &pd_prefix_len, &lifetime_preferred_sec, &lifetime… in dhcp6_lease_has_pd_prefix()
|
D | networkd-dhcp-server-static-lease.h | 22 DHCPStaticLease *dhcp_static_lease_free(DHCPStaticLease *lease);
|
D | networkd-dhcp6.c | 305 sd_dhcp6_lease *lease; in dhcp6_lease_ip_acquired() local 311 r = sd_dhcp6_client_get_lease(client, &lease); in dhcp6_lease_ip_acquired() 316 link->dhcp6_lease = sd_dhcp6_lease_ref(lease); in dhcp6_lease_ip_acquired() 322 if (dhcp6_lease_has_pd_prefix(lease)) { in dhcp6_lease_ip_acquired()
|
D | networkd-state-file.c | 380 sd_dhcp_lease *lease, in serialize_addresses() argument 398 if (lease && conditional) { in serialize_addresses() 401 r = sd_dhcp_lease_get_servers(lease, what, &lease_addresses); in serialize_addresses()
|
/systemd-251/test/test-network/conf/ |
D | isc-dhcpd-dhcp6pd.conf | 1 default-lease-time 2592000;
|