2020-11-09 07:23:58 +03:00
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2014-06-19 16:39:35 +04:00
# pragma once
/***
2018-06-12 18:15:23 +03:00
Copyright © 2014 - 2015 Intel Corporation . All rights reserved .
2014-06-19 16:39:35 +04:00
* * */
# include <stdint.h>
# include "sd-dhcp6-lease.h"
2015-11-19 00:46:33 +03:00
2014-06-19 16:39:35 +04:00
# include "dhcp6-internal.h"
struct sd_dhcp6_lease {
2015-08-26 22:05:53 +03:00
unsigned n_ref ;
2014-06-19 16:39:35 +04:00
uint8_t * serverid ;
size_t serverid_len ;
uint8_t preference ;
2014-06-25 17:54:30 +04:00
bool rapid_commit ;
2021-10-14 22:19:59 +03:00
triple_timestamp timestamp ;
2021-11-01 04:31:31 +03:00
struct in6_addr server_address ;
2014-06-19 16:39:35 +04:00
DHCP6IA ia ;
2018-01-04 16:11:46 +03:00
DHCP6IA pd ;
2014-06-19 16:39:45 +04:00
DHCP6Address * addr_iter ;
2018-01-04 16:11:54 +03:00
DHCP6Address * prefix_iter ;
2015-04-02 10:50:16 +03:00
struct in6_addr * dns ;
size_t dns_count ;
2015-04-02 15:34:12 +03:00
char * * domains ;
2015-04-10 15:59:00 +03:00
struct in6_addr * ntp ;
size_t ntp_count ;
char * * ntp_fqdn ;
2021-09-24 09:00:43 +03:00
struct in6_addr * sntp ;
size_t sntp_count ;
2020-07-28 08:48:11 +03:00
char * fqdn ;
2014-06-19 16:39:35 +04:00
} ;
2014-06-25 16:37:58 +04:00
int dhcp6_lease_ia_rebind_expire ( const DHCP6IA * ia , uint32_t * expire ) ;
2014-06-19 16:39:35 +04:00
DHCP6IA * dhcp6_lease_free_ia ( DHCP6IA * ia ) ;
int dhcp6_lease_set_serverid ( sd_dhcp6_lease * lease , const uint8_t * id ,
size_t len ) ;
int dhcp6_lease_get_serverid ( sd_dhcp6_lease * lease , uint8_t * * id , size_t * len ) ;
int dhcp6_lease_set_preference ( sd_dhcp6_lease * lease , uint8_t preference ) ;
int dhcp6_lease_get_preference ( sd_dhcp6_lease * lease , uint8_t * preference ) ;
2014-06-25 17:54:30 +04:00
int dhcp6_lease_set_rapid_commit ( sd_dhcp6_lease * lease ) ;
int dhcp6_lease_get_rapid_commit ( sd_dhcp6_lease * lease , bool * rapid_commit ) ;
2021-09-24 15:03:24 +03:00
int dhcp6_lease_add_dns ( sd_dhcp6_lease * lease , const uint8_t * optval , size_t optlen ) ;
2021-09-24 08:16:44 +03:00
int dhcp6_lease_add_domains ( sd_dhcp6_lease * lease , const uint8_t * optval , size_t optlen ) ;
2021-09-24 08:09:14 +03:00
int dhcp6_lease_add_ntp ( sd_dhcp6_lease * lease , const uint8_t * optval , size_t optlen ) ;
2021-09-24 09:00:43 +03:00
int dhcp6_lease_add_sntp ( sd_dhcp6_lease * lease , const uint8_t * optval , size_t optlen ) ;
2020-07-28 08:48:11 +03:00
int dhcp6_lease_set_fqdn ( sd_dhcp6_lease * lease , const uint8_t * optval , size_t optlen ) ;
2015-04-10 15:59:00 +03:00
2014-06-19 16:39:35 +04:00
int dhcp6_lease_new ( sd_dhcp6_lease * * ret ) ;