Lines Matching defs:lease
30 #include "dhcp6-lease-internal.h"
55 struct sd_dhcp6_lease *lease;
272 if (!client->lease)
276 *ret = client->lease;
286 static void client_set_lease(sd_dhcp6_client *client, sd_dhcp6_lease *lease) {
287 if (client->lease) {
288 dhcp6_lease_clear_timers(&client->lease->ia);
289 sd_dhcp6_lease_unref(client->lease);
291 client->lease = lease;
382 client->lease->serverid_len,
383 client->lease->serverid);
387 r = dhcp6_option_append_ia(&opt, &optlen, &client->lease->ia);
396 r = dhcp6_option_append_ia(&opt, &optlen, &client->lease->ia);
447 assert_return(client->lease, -EINVAL);
449 client->lease->ia.timeout_t2 =
450 sd_event_source_unref(client->lease->ia.timeout_t2);
465 assert_return(client->lease, -EINVAL);
467 client->lease->ia.timeout_t1 =
468 sd_event_source_unref(client->lease->ia.timeout_t1);
529 if (client->retransmit_count && client->lease) {
561 r = dhcp6_lease_ia_rebind_expire(&client->lease->ia,
674 sd_dhcp6_lease *lease) {
707 r = dhcp6_lease_get_serverid(lease, &id, &id_len);
714 r = dhcp6_lease_set_serverid(lease, optval, optlen);
724 r = dhcp6_lease_set_preference(lease, *optval);
752 &lease->ia);
756 r = dhcp6_lease_get_iaid(lease, &iaid_lease);
769 r = dhcp6_lease_set_rapid_commit(lease);
776 r = dhcp6_lease_set_dns(lease, optval, optlen);
783 r = dhcp6_lease_set_domains(lease, optval, optlen);
790 r = dhcp6_lease_set_ntp(lease, optval, optlen);
797 r = dhcp6_lease_set_sntp(lease, optval, optlen);
816 r = dhcp6_lease_get_serverid(lease, &id, &id_len);
827 _cleanup_(sd_dhcp6_lease_unrefp) sd_dhcp6_lease *lease = NULL;
833 r = dhcp6_lease_new(&lease);
837 r = client_parse_message(client, reply, len, lease);
842 r = dhcp6_lease_get_rapid_commit(lease, &rapid_commit);
850 client_set_lease(client, lease);
851 lease = NULL;
858 _cleanup_(sd_dhcp6_lease_unrefp) sd_dhcp6_lease *lease = NULL;
864 r = dhcp6_lease_new(&lease);
868 r = client_parse_message(client, advertise, len, lease);
872 r = dhcp6_lease_get_preference(lease, &pref_advertise);
876 r = dhcp6_lease_get_preference(client->lease, &pref_lease);
879 client_set_lease(client, lease);
880 lease = NULL;
1054 if (client->lease->ia.lifetime_t1 == 0xffffffff ||
1055 client->lease->ia.lifetime_t2 == 0xffffffff) {
1058 be32toh(client->lease->ia.lifetime_t1),
1059 be32toh(client->lease->ia.lifetime_t2));
1064 timeout = client_timeout_compute_random(be32toh(client->lease->ia.lifetime_t1) * USEC_PER_SEC);
1070 &client->lease->ia.timeout_t1,
1077 r = sd_event_source_set_priority(client->lease->ia.timeout_t1,
1082 r = sd_event_source_set_description(client->lease->ia.timeout_t1, "dhcp6-t1-timeout");
1086 timeout = client_timeout_compute_random(be32toh(client->lease->ia.lifetime_t2) * USEC_PER_SEC);
1092 &client->lease->ia.timeout_t2,
1099 r = sd_event_source_set_priority(client->lease->ia.timeout_t2,
1104 r = sd_event_source_set_description(client->lease->ia.timeout_t2, "dhcp6-t2-timeout");