Lines Matching refs:lease
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()
60 if (lease->lifetime <= 0) in sd_dhcp_lease_get_lifetime()
63 *lifetime = lease->lifetime; in sd_dhcp_lease_get_lifetime()
67 int sd_dhcp_lease_get_t1(sd_dhcp_lease *lease, uint32_t *t1) { in sd_dhcp_lease_get_t1() argument
68 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_t1()
71 if (lease->t1 <= 0) in sd_dhcp_lease_get_t1()
74 *t1 = lease->t1; in sd_dhcp_lease_get_t1()
78 int sd_dhcp_lease_get_t2(sd_dhcp_lease *lease, uint32_t *t2) { in sd_dhcp_lease_get_t2() argument
79 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_t2()
82 if (lease->t2 <= 0) in sd_dhcp_lease_get_t2()
85 *t2 = lease->t2; in sd_dhcp_lease_get_t2()
89 int sd_dhcp_lease_get_mtu(sd_dhcp_lease *lease, uint16_t *mtu) { in sd_dhcp_lease_get_mtu() argument
90 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_mtu()
93 if (lease->mtu <= 0) in sd_dhcp_lease_get_mtu()
96 *mtu = lease->mtu; in sd_dhcp_lease_get_mtu()
101 sd_dhcp_lease *lease, in sd_dhcp_lease_get_servers() argument
105 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_servers()
109 if (lease->servers[what].size <= 0) in sd_dhcp_lease_get_servers()
113 *addr = lease->servers[what].addr; in sd_dhcp_lease_get_servers()
115 return (int) lease->servers[what].size; in sd_dhcp_lease_get_servers()
118 int sd_dhcp_lease_get_dns(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_dns() argument
119 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_DNS, addr); in sd_dhcp_lease_get_dns()
121 int sd_dhcp_lease_get_ntp(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_ntp() argument
122 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_NTP, addr); in sd_dhcp_lease_get_ntp()
124 int sd_dhcp_lease_get_sip(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_sip() argument
125 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_SIP, addr); in sd_dhcp_lease_get_sip()
127 int sd_dhcp_lease_get_pop3(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_pop3() argument
128 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_POP3, addr); in sd_dhcp_lease_get_pop3()
130 int sd_dhcp_lease_get_smtp(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_smtp() argument
131 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_SMTP, addr); in sd_dhcp_lease_get_smtp()
133 int sd_dhcp_lease_get_lpr(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_lpr() argument
134 return sd_dhcp_lease_get_servers(lease, SD_DHCP_LEASE_LPR, addr); in sd_dhcp_lease_get_lpr()
137 int sd_dhcp_lease_get_domainname(sd_dhcp_lease *lease, const char **domainname) { in sd_dhcp_lease_get_domainname() argument
138 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_domainname()
141 if (!lease->domainname) in sd_dhcp_lease_get_domainname()
144 *domainname = lease->domainname; in sd_dhcp_lease_get_domainname()
148 int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname) { in sd_dhcp_lease_get_hostname() argument
149 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_hostname()
152 if (!lease->hostname) in sd_dhcp_lease_get_hostname()
155 *hostname = lease->hostname; in sd_dhcp_lease_get_hostname()
159 int sd_dhcp_lease_get_root_path(sd_dhcp_lease *lease, const char **root_path) { in sd_dhcp_lease_get_root_path() argument
160 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_root_path()
163 if (!lease->root_path) in sd_dhcp_lease_get_root_path()
166 *root_path = lease->root_path; in sd_dhcp_lease_get_root_path()
170 int sd_dhcp_lease_get_router(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_router() argument
171 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_router()
174 if (lease->router_size <= 0) in sd_dhcp_lease_get_router()
177 *addr = lease->router; in sd_dhcp_lease_get_router()
178 return (int) lease->router_size; in sd_dhcp_lease_get_router()
181 int sd_dhcp_lease_get_netmask(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_netmask() argument
182 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_netmask()
185 if (!lease->have_subnet_mask) in sd_dhcp_lease_get_netmask()
188 addr->s_addr = lease->subnet_mask; in sd_dhcp_lease_get_netmask()
192 int sd_dhcp_lease_get_server_identifier(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_server_identifier() argument
193 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_server_identifier()
196 if (lease->server_address == 0) in sd_dhcp_lease_get_server_identifier()
199 addr->s_addr = lease->server_address; in sd_dhcp_lease_get_server_identifier()
203 int sd_dhcp_lease_get_next_server(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_next_server() argument
204 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_next_server()
207 if (lease->next_server == 0) in sd_dhcp_lease_get_next_server()
210 addr->s_addr = lease->next_server; in sd_dhcp_lease_get_next_server()
240 int sd_dhcp_lease_get_static_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret) { in sd_dhcp_lease_get_static_routes() argument
241 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_static_routes()
243 return dhcp_lease_get_routes(lease->static_routes, lease->n_static_routes, ret); in sd_dhcp_lease_get_static_routes()
246 int sd_dhcp_lease_get_classless_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret) { in sd_dhcp_lease_get_classless_routes() argument
247 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_classless_routes()
249 return dhcp_lease_get_routes(lease->classless_routes, lease->n_classless_routes, ret); in sd_dhcp_lease_get_classless_routes()
252 int sd_dhcp_lease_get_search_domains(sd_dhcp_lease *lease, char ***domains) { in sd_dhcp_lease_get_search_domains() argument
255 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_search_domains()
258 r = strv_length(lease->search_domains); in sd_dhcp_lease_get_search_domains()
260 *domains = lease->search_domains; in sd_dhcp_lease_get_search_domains()
268 sd_dhcp_lease *lease, in sd_dhcp_lease_get_6rd() argument
275 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_6rd()
277 if (lease->sixrd_n_br_addresses <= 0) in sd_dhcp_lease_get_6rd()
281 *ret_ipv4masklen = lease->sixrd_ipv4masklen; in sd_dhcp_lease_get_6rd()
283 *ret_prefixlen = lease->sixrd_prefixlen; in sd_dhcp_lease_get_6rd()
285 *ret_prefix = lease->sixrd_prefix; in sd_dhcp_lease_get_6rd()
287 *ret_br_addresses = lease->sixrd_br_addresses; in sd_dhcp_lease_get_6rd()
289 *ret_n_br_addresses = lease->sixrd_n_br_addresses; in sd_dhcp_lease_get_6rd()
294 int sd_dhcp_lease_get_vendor_specific(sd_dhcp_lease *lease, const void **data, size_t *data_len) { in sd_dhcp_lease_get_vendor_specific() argument
295 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_vendor_specific()
299 if (lease->vendor_specific_len <= 0) in sd_dhcp_lease_get_vendor_specific()
302 *data = lease->vendor_specific; in sd_dhcp_lease_get_vendor_specific()
303 *data_len = lease->vendor_specific_len; in sd_dhcp_lease_get_vendor_specific()
307 static sd_dhcp_lease *dhcp_lease_free(sd_dhcp_lease *lease) { in dhcp_lease_free() argument
308 assert(lease); in dhcp_lease_free()
310 while (lease->private_options) { in dhcp_lease_free()
311 struct sd_dhcp_raw_option *option = lease->private_options; in dhcp_lease_free()
313 LIST_REMOVE(options, lease->private_options, option); in dhcp_lease_free()
319 free(lease->root_path); in dhcp_lease_free()
320 free(lease->router); in dhcp_lease_free()
321 free(lease->timezone); in dhcp_lease_free()
322 free(lease->hostname); in dhcp_lease_free()
323 free(lease->domainname); in dhcp_lease_free()
326 free(lease->servers[i].addr); in dhcp_lease_free()
328 free(lease->static_routes); in dhcp_lease_free()
329 free(lease->classless_routes); in dhcp_lease_free()
330 free(lease->client_id); in dhcp_lease_free()
331 free(lease->vendor_specific); in dhcp_lease_free()
332 strv_free(lease->search_domains); in dhcp_lease_free()
333 free(lease->sixrd_br_addresses); in dhcp_lease_free()
334 return mfree(lease); in dhcp_lease_free()
484 static int lease_parse_static_routes(sd_dhcp_lease *lease, const uint8_t *option, size_t len) { in lease_parse_static_routes() argument
487 assert(lease); in lease_parse_static_routes()
513 if (!GREEDY_REALLOC(lease->static_routes, lease->n_static_routes + 1)) in lease_parse_static_routes()
516 lease->static_routes[lease->n_static_routes++] = (struct sd_dhcp_route) { in lease_parse_static_routes()
527 static int lease_parse_classless_routes(sd_dhcp_lease *lease, const uint8_t *option, size_t len) { in lease_parse_classless_routes() argument
528 assert(lease); in lease_parse_classless_routes()
558 if (!GREEDY_REALLOC(lease->classless_routes, lease->n_classless_routes + 1)) in lease_parse_classless_routes()
561 lease->classless_routes[lease->n_classless_routes++] = (struct sd_dhcp_route) { in lease_parse_classless_routes()
571 static int lease_parse_6rd(sd_dhcp_lease *lease, const uint8_t *option, size_t len) { in lease_parse_6rd() argument
577 assert(lease); in lease_parse_6rd()
582 if (lease->sixrd_n_br_addresses > 0) in lease_parse_6rd()
617 lease->sixrd_ipv4masklen = ipv4masklen; in lease_parse_6rd()
618 lease->sixrd_prefixlen = prefixlen; in lease_parse_6rd()
619 lease->sixrd_prefix = prefix; in lease_parse_6rd()
620 lease->sixrd_br_addresses = TAKE_PTR(br_addresses); in lease_parse_6rd()
621 lease->sixrd_n_br_addresses = n_br_addresses; in lease_parse_6rd()
627 sd_dhcp_lease *lease = userdata; in dhcp_lease_parse_options() local
630 assert(lease); in dhcp_lease_parse_options()
635 r = lease_parse_u32(option, len, &lease->lifetime, 1); in dhcp_lease_parse_options()
642 r = lease_parse_be32(option, len, &lease->server_address); in dhcp_lease_parse_options()
649 r = lease_parse_be32(option, len, &lease->subnet_mask); in dhcp_lease_parse_options()
653 lease->have_subnet_mask = true; in dhcp_lease_parse_options()
657 r = lease_parse_be32(option, len, &lease->broadcast); in dhcp_lease_parse_options()
661 lease->have_broadcast = true; in dhcp_lease_parse_options()
665 r = lease_parse_in_addrs(option, len, &lease->router, &lease->router_size); in dhcp_lease_parse_options()
671 …r = lease_parse_in_addrs(option, len, &lease->servers[SD_DHCP_LEASE_DNS].addr, &lease->servers[SD_… in dhcp_lease_parse_options()
677 …r = lease_parse_in_addrs(option, len, &lease->servers[SD_DHCP_LEASE_NTP].addr, &lease->servers[SD_… in dhcp_lease_parse_options()
683 …r = lease_parse_sip_server(option, len, &lease->servers[SD_DHCP_LEASE_SIP].addr, &lease->servers[S… in dhcp_lease_parse_options()
689 …r = lease_parse_in_addrs(option, len, &lease->servers[SD_DHCP_LEASE_POP3].addr, &lease->servers[SD… in dhcp_lease_parse_options()
695 …r = lease_parse_in_addrs(option, len, &lease->servers[SD_DHCP_LEASE_SMTP].addr, &lease->servers[SD… in dhcp_lease_parse_options()
701 …r = lease_parse_in_addrs(option, len, &lease->servers[SD_DHCP_LEASE_LPR].addr, &lease->servers[SD_… in dhcp_lease_parse_options()
707 r = lease_parse_static_routes(lease, option, len); in dhcp_lease_parse_options()
713 r = lease_parse_u16(option, len, &lease->mtu, 68); in dhcp_lease_parse_options()
716 if (lease->mtu < DHCP_DEFAULT_MIN_SIZE) { in dhcp_lease_parse_options()
717 … value of %" PRIu16 " too small. Using default MTU value of %d instead.", lease->mtu, DHCP_DEFAULT… in dhcp_lease_parse_options()
718 lease->mtu = DHCP_DEFAULT_MIN_SIZE; in dhcp_lease_parse_options()
724 r = lease_parse_domain(option, len, &lease->domainname); in dhcp_lease_parse_options()
733 r = dhcp_lease_parse_search_domains(option, len, &lease->search_domains); in dhcp_lease_parse_options()
739 r = lease_parse_domain(option, len, &lease->hostname); in dhcp_lease_parse_options()
748 r = lease_parse_string(option, len, &lease->root_path); in dhcp_lease_parse_options()
754 r = lease_parse_u32(option, len, &lease->t1, 1); in dhcp_lease_parse_options()
760 r = lease_parse_u32(option, len, &lease->t2, 1); in dhcp_lease_parse_options()
766 r = lease_parse_classless_routes(lease, option, len); in dhcp_lease_parse_options()
785 free_and_replace(lease->timezone, tz); in dhcp_lease_parse_options()
793 lease->vendor_specific = mfree(lease->vendor_specific); in dhcp_lease_parse_options()
801 free(lease->vendor_specific); in dhcp_lease_parse_options()
802 lease->vendor_specific = p; in dhcp_lease_parse_options()
805 lease->vendor_specific_len = len; in dhcp_lease_parse_options()
809 r = lease_parse_6rd(lease, option, len); in dhcp_lease_parse_options()
815 r = dhcp_lease_insert_private_option(lease, code, option, len); in dhcp_lease_parse_options()
918 int dhcp_lease_insert_private_option(sd_dhcp_lease *lease, uint8_t tag, const void *data, uint8_t l… in dhcp_lease_insert_private_option() argument
921 assert(lease); in dhcp_lease_insert_private_option()
923 LIST_FOREACH(options, cur, lease->private_options) { in dhcp_lease_insert_private_option()
946 LIST_INSERT_BEFORE(options, lease->private_options, before, option); in dhcp_lease_insert_private_option()
951 sd_dhcp_lease *lease; in dhcp_lease_new() local
953 lease = new0(sd_dhcp_lease, 1); in dhcp_lease_new()
954 if (!lease) in dhcp_lease_new()
957 lease->n_ref = 1; in dhcp_lease_new()
959 *ret = lease; in dhcp_lease_new()
963 int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { in dhcp_lease_save() argument
978 assert(lease); in dhcp_lease_save()
990 r = sd_dhcp_lease_get_address(lease, &address); in dhcp_lease_save()
994 r = sd_dhcp_lease_get_netmask(lease, &address); in dhcp_lease_save()
998 r = sd_dhcp_lease_get_router(lease, &addresses); in dhcp_lease_save()
1005 r = sd_dhcp_lease_get_server_identifier(lease, &address); in dhcp_lease_save()
1009 r = sd_dhcp_lease_get_next_server(lease, &address); in dhcp_lease_save()
1013 r = sd_dhcp_lease_get_broadcast(lease, &address); in dhcp_lease_save()
1017 r = sd_dhcp_lease_get_mtu(lease, &mtu); in dhcp_lease_save()
1021 r = sd_dhcp_lease_get_t1(lease, &t1); in dhcp_lease_save()
1025 r = sd_dhcp_lease_get_t2(lease, &t2); in dhcp_lease_save()
1029 r = sd_dhcp_lease_get_lifetime(lease, &lifetime); in dhcp_lease_save()
1033 r = sd_dhcp_lease_get_dns(lease, &addresses); in dhcp_lease_save()
1040 r = sd_dhcp_lease_get_ntp(lease, &addresses); in dhcp_lease_save()
1047 r = sd_dhcp_lease_get_sip(lease, &addresses); in dhcp_lease_save()
1054 r = sd_dhcp_lease_get_domainname(lease, &string); in dhcp_lease_save()
1058 r = sd_dhcp_lease_get_search_domains(lease, &search_domains); in dhcp_lease_save()
1065 r = sd_dhcp_lease_get_hostname(lease, &string); in dhcp_lease_save()
1069 r = sd_dhcp_lease_get_root_path(lease, &string); in dhcp_lease_save()
1073 r = sd_dhcp_lease_get_static_routes(lease, &routes); in dhcp_lease_save()
1078 r = sd_dhcp_lease_get_classless_routes(lease, &routes); in dhcp_lease_save()
1082 r = sd_dhcp_lease_get_timezone(lease, &string); in dhcp_lease_save()
1086 r = sd_dhcp_lease_get_client_id(lease, &client_id, &client_id_len); in dhcp_lease_save()
1096 r = sd_dhcp_lease_get_vendor_specific(lease, &data, &data_len); in dhcp_lease_save()
1106 LIST_FOREACH(options, option, lease->private_options) { in dhcp_lease_save()
1141 _cleanup_(sd_dhcp_lease_unrefp) sd_dhcp_lease *lease = NULL; in dhcp_lease_load()
1171 r = dhcp_lease_new(&lease); in dhcp_lease_load()
1193 "DOMAINNAME", &lease->domainname, in dhcp_lease_load()
1194 "HOSTNAME", &lease->hostname, in dhcp_lease_load()
1196 "ROOT_PATH", &lease->root_path, in dhcp_lease_load()
1200 "TIMEZONE", &lease->timezone, in dhcp_lease_load()
1240 r = inet_pton(AF_INET, address, &lease->address); in dhcp_lease_load()
1246 r = deserialize_in_addrs(&lease->router, router); in dhcp_lease_load()
1250 lease->router_size = r; in dhcp_lease_load()
1254 r = inet_pton(AF_INET, netmask, &lease->subnet_mask); in dhcp_lease_load()
1258 lease->have_subnet_mask = true; in dhcp_lease_load()
1262 r = inet_pton(AF_INET, server_address, &lease->server_address); in dhcp_lease_load()
1268 r = inet_pton(AF_INET, next_server, &lease->next_server); in dhcp_lease_load()
1274 r = inet_pton(AF_INET, broadcast, &lease->broadcast); in dhcp_lease_load()
1278 lease->have_broadcast = true; in dhcp_lease_load()
1282 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_DNS].addr, dns); in dhcp_lease_load()
1286 lease->servers[SD_DHCP_LEASE_DNS].size = r; in dhcp_lease_load()
1290 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_NTP].addr, ntp); in dhcp_lease_load()
1294 lease->servers[SD_DHCP_LEASE_NTP].size = r; in dhcp_lease_load()
1298 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_SIP].addr, sip); in dhcp_lease_load()
1302 lease->servers[SD_DHCP_LEASE_SIP].size = r; in dhcp_lease_load()
1306 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_POP3].addr, pop3); in dhcp_lease_load()
1310 lease->servers[SD_DHCP_LEASE_POP3].size = r; in dhcp_lease_load()
1314 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_SMTP].addr, smtp); in dhcp_lease_load()
1318 lease->servers[SD_DHCP_LEASE_SMTP].size = r; in dhcp_lease_load()
1322 r = deserialize_in_addrs(&lease->servers[SD_DHCP_LEASE_LPR].addr, lpr); in dhcp_lease_load()
1326 lease->servers[SD_DHCP_LEASE_LPR].size = r; in dhcp_lease_load()
1330 r = safe_atou16(mtu, &lease->mtu); in dhcp_lease_load()
1342 lease->search_domains = TAKE_PTR(a); in dhcp_lease_load()
1347 &lease->static_routes, in dhcp_lease_load()
1348 &lease->n_static_routes, in dhcp_lease_load()
1356 &lease->classless_routes, in dhcp_lease_load()
1357 &lease->n_classless_routes, in dhcp_lease_load()
1364 r = safe_atou32(lifetime, &lease->lifetime); in dhcp_lease_load()
1370 r = safe_atou32(t1, &lease->t1); in dhcp_lease_load()
1376 r = safe_atou32(t2, &lease->t2); in dhcp_lease_load()
1382 r = unhexmem(client_id_hex, SIZE_MAX, &lease->client_id, &lease->client_id_len); in dhcp_lease_load()
1388 … r = unhexmem(vendor_specific_hex, SIZE_MAX, &lease->vendor_specific, &lease->vendor_specific_len); in dhcp_lease_load()
1406 … r = dhcp_lease_insert_private_option(lease, SD_DHCP_OPTION_PRIVATE_BASE + i, data, len); in dhcp_lease_load()
1411 *ret = TAKE_PTR(lease); in dhcp_lease_load()
1416 int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease *lease) { in dhcp_lease_set_default_subnet_mask() argument
1420 assert(lease); in dhcp_lease_set_default_subnet_mask()
1422 if (lease->address == 0) in dhcp_lease_set_default_subnet_mask()
1425 address.s_addr = lease->address; in dhcp_lease_set_default_subnet_mask()
1432 lease->subnet_mask = mask.s_addr; in dhcp_lease_set_default_subnet_mask()
1433 lease->have_subnet_mask = true; in dhcp_lease_set_default_subnet_mask()
1438 int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const void **client_id, size_t *client_id_len… in sd_dhcp_lease_get_client_id() argument
1439 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_client_id()
1443 if (!lease->client_id) in sd_dhcp_lease_get_client_id()
1446 *client_id = lease->client_id; in sd_dhcp_lease_get_client_id()
1447 *client_id_len = lease->client_id_len; in sd_dhcp_lease_get_client_id()
1452 int dhcp_lease_set_client_id(sd_dhcp_lease *lease, const void *client_id, size_t client_id_len) { in dhcp_lease_set_client_id() argument
1453 assert_return(lease, -EINVAL); in dhcp_lease_set_client_id()
1457 lease->client_id = mfree(lease->client_id); in dhcp_lease_set_client_id()
1465 free(lease->client_id); in dhcp_lease_set_client_id()
1466 lease->client_id = p; in dhcp_lease_set_client_id()
1467 lease->client_id_len = client_id_len; in dhcp_lease_set_client_id()
1473 int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **tz) { in sd_dhcp_lease_get_timezone() argument
1474 assert_return(lease, -EINVAL); in sd_dhcp_lease_get_timezone()
1477 if (!lease->timezone) in sd_dhcp_lease_get_timezone()
1480 *tz = lease->timezone; in sd_dhcp_lease_get_timezone()