1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #ifndef foosddhcp6leasehfoo
3 #define foosddhcp6leasehfoo
4 
5 /***
6   Copyright © 2014-2015 Intel Corporation. All rights reserved.
7 
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12 
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17 
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21 
22 #include <inttypes.h>
23 #include <netinet/in.h>
24 #include <sys/types.h>
25 
26 #include "_sd-common.h"
27 
28 _SD_BEGIN_DECLARATIONS;
29 
30 typedef struct sd_dhcp6_lease sd_dhcp6_lease;
31 
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);
34 
35 void sd_dhcp6_lease_reset_address_iter(sd_dhcp6_lease *lease);
36 int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease,
37                                struct in6_addr *addr,
38                                uint32_t *lifetime_preferred,
39                                uint32_t *lifetime_valid);
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,
42                           uint8_t *prefix_len,
43                           uint32_t *lifetime_preferred,
44                           uint32_t *lifetime_valid);
45 
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);
50 int sd_dhcp6_lease_get_fqdn(sd_dhcp6_lease *lease, const char **ret);
51 
52 sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease);
53 sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease);
54 
55 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_lease, sd_dhcp6_lease_unref);
56 
57 _SD_END_DECLARATIONS;
58 
59 #endif
60