1:255.16-alt1
[systemd_ALT.git] / src / systemd / sd-dhcp6-lease.h
blobe18d57817fff4e41adcce40f06f399bd86f95a76
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #ifndef foosddhcp6leasehfoo
3 #define foosddhcp6leasehfoo
5 /***
6 Copyright © 2014-2015 Intel Corporation. All rights reserved.
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.
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.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <https://www.gnu.org/licenses/>.
20 ***/
22 #include <inttypes.h>
23 #include <netinet/in.h>
24 #include <sys/types.h>
26 #include "sd-dhcp6-option.h"
28 #include "_sd-common.h"
30 _SD_BEGIN_DECLARATIONS;
32 typedef struct sd_dhcp6_lease sd_dhcp6_lease;
34 int sd_dhcp6_lease_get_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret);
35 int sd_dhcp6_lease_get_t1(sd_dhcp6_lease *lease, uint64_t *ret);
36 int sd_dhcp6_lease_get_t1_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret);
37 int sd_dhcp6_lease_get_t2(sd_dhcp6_lease *lease, uint64_t *ret);
38 int sd_dhcp6_lease_get_t2_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret);
39 int sd_dhcp6_lease_get_valid_lifetime(sd_dhcp6_lease *lease, uint64_t *ret);
40 int sd_dhcp6_lease_get_valid_lifetime_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret);
41 int sd_dhcp6_lease_get_server_address(sd_dhcp6_lease *lease, struct in6_addr *ret);
43 int sd_dhcp6_lease_address_iterator_reset(sd_dhcp6_lease *lease);
44 int sd_dhcp6_lease_address_iterator_next(sd_dhcp6_lease *lease);
45 int sd_dhcp6_lease_get_address(
46 sd_dhcp6_lease *lease,
47 struct in6_addr *ret);
48 int sd_dhcp6_lease_get_address_lifetime(
49 sd_dhcp6_lease *lease,
50 uint64_t *ret_lifetime_preferred,
51 uint64_t *ret_lifetime_valid);
52 int sd_dhcp6_lease_get_address_lifetime_timestamp(
53 sd_dhcp6_lease *lease,
54 clockid_t clock,
55 uint64_t *ret_lifetime_preferred,
56 uint64_t *ret_lifetime_valid);
57 int sd_dhcp6_lease_has_address(sd_dhcp6_lease *lease);
59 int sd_dhcp6_lease_pd_iterator_reset(sd_dhcp6_lease *lease);
60 int sd_dhcp6_lease_pd_iterator_next(sd_dhcp6_lease *lease);
61 int sd_dhcp6_lease_get_pd_prefix(
62 sd_dhcp6_lease *lease,
63 struct in6_addr *ret_prefix,
64 uint8_t *ret_prefix_length);
65 int sd_dhcp6_lease_get_pd_lifetime(
66 sd_dhcp6_lease *lease,
67 uint64_t *ret_lifetime_preferred,
68 uint64_t *ret_lifetime_valid);
69 int sd_dhcp6_lease_get_pd_lifetime_timestamp(
70 sd_dhcp6_lease *lease,
71 clockid_t clock,
72 uint64_t *ret_lifetime_preferred,
73 uint64_t *ret_lifetime_valid);
74 int sd_dhcp6_lease_has_pd_prefix(sd_dhcp6_lease *lease);
76 int sd_dhcp6_lease_get_dns(sd_dhcp6_lease *lease, const struct in6_addr **ret);
77 int sd_dhcp6_lease_get_domains(sd_dhcp6_lease *lease, char ***ret);
78 int sd_dhcp6_lease_get_ntp_addrs(sd_dhcp6_lease *lease, const struct in6_addr **ret);
79 int sd_dhcp6_lease_get_ntp_fqdn(sd_dhcp6_lease *lease, char ***ret);
80 int sd_dhcp6_lease_get_fqdn(sd_dhcp6_lease *lease, const char **ret);
81 int sd_dhcp6_lease_get_captive_portal(sd_dhcp6_lease *lease, const char **ret);
82 int sd_dhcp6_lease_get_vendor_options(sd_dhcp6_lease *lease, sd_dhcp6_option ***ret);
84 sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease);
85 sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease);
87 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_lease, sd_dhcp6_lease_unref);
89 _SD_END_DECLARATIONS;
91 #endif