]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/sd-dhcp6-lease.h
8f56ce8be3947b92e05b49e4a672fbfc1913a40f
[thirdparty/systemd.git] / src / systemd / sd-dhcp6-lease.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #ifndef foosddhcp6leasehfoo
3 #define foosddhcp6leasehfoo
4
5 /***
6 Copyright (C) 2014 Tom Gundersen
7 Copyright (C) 2014-2015 Intel Corporation. All rights reserved.
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 ***/
22
23 #include <inttypes.h>
24 #include <netinet/in.h>
25
26 #include "_sd-common.h"
27
28 _SD_BEGIN_DECLARATIONS;
29
30 typedef struct sd_dhcp6_lease sd_dhcp6_lease;
31
32 void sd_dhcp6_lease_reset_address_iter(sd_dhcp6_lease *lease);
33 int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease,
34 struct in6_addr *addr,
35 uint32_t *lifetime_preferred,
36 uint32_t *lifetime_valid);
37 void sd_dhcp6_lease_reset_pd_prefix_iter(sd_dhcp6_lease *lease);
38 int sd_dhcp6_lease_get_pd(sd_dhcp6_lease *lease, struct in6_addr *prefix,
39 uint8_t *prefix_len,
40 uint32_t *lifetime_preferred,
41 uint32_t *lifetime_valid);
42
43 int sd_dhcp6_lease_get_dns(sd_dhcp6_lease *lease, struct in6_addr **addrs);
44 int sd_dhcp6_lease_get_domains(sd_dhcp6_lease *lease, char ***domains);
45 int sd_dhcp6_lease_get_ntp_addrs(sd_dhcp6_lease *lease,
46 struct in6_addr **addrs);
47 int sd_dhcp6_lease_get_ntp_fqdn(sd_dhcp6_lease *lease, char ***ntp_fqdn);
48
49 sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease);
50 sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease);
51
52 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_lease, sd_dhcp6_lease_unref);
53
54 _SD_END_DECLARATIONS;
55
56 #endif