]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/dhcp6-lease-internal.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / libsystemd-network / dhcp6-lease-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright (C) 2014 Tom Gundersen
8 Copyright (C) 2014-2015 Intel Corporation. All rights reserved.
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 ***/
23
24 #include <stdint.h>
25
26 #include "sd-dhcp6-lease.h"
27
28 #include "dhcp6-internal.h"
29
30 struct sd_dhcp6_lease {
31 unsigned n_ref;
32
33 uint8_t *serverid;
34 size_t serverid_len;
35 uint8_t preference;
36 bool rapid_commit;
37
38 DHCP6IA ia;
39
40 DHCP6Address *addr_iter;
41
42 struct in6_addr *dns;
43 size_t dns_count;
44 size_t dns_allocated;
45 char **domains;
46 size_t domains_count;
47 struct in6_addr *ntp;
48 size_t ntp_count;
49 size_t ntp_allocated;
50 char **ntp_fqdn;
51 size_t ntp_fqdn_count;
52 };
53
54 int dhcp6_lease_clear_timers(DHCP6IA *ia);
55 int dhcp6_lease_ia_rebind_expire(const DHCP6IA *ia, uint32_t *expire);
56 DHCP6IA *dhcp6_lease_free_ia(DHCP6IA *ia);
57
58 int dhcp6_lease_set_serverid(sd_dhcp6_lease *lease, const uint8_t *id,
59 size_t len);
60 int dhcp6_lease_get_serverid(sd_dhcp6_lease *lease, uint8_t **id, size_t *len);
61 int dhcp6_lease_set_preference(sd_dhcp6_lease *lease, uint8_t preference);
62 int dhcp6_lease_get_preference(sd_dhcp6_lease *lease, uint8_t *preference);
63 int dhcp6_lease_set_rapid_commit(sd_dhcp6_lease *lease);
64 int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *rapid_commit);
65
66 int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid);
67
68 int dhcp6_lease_set_dns(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen);
69 int dhcp6_lease_set_domains(sd_dhcp6_lease *lease, uint8_t *optval,
70 size_t optlen);
71 int dhcp6_lease_set_ntp(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen);
72 int dhcp6_lease_set_sntp(sd_dhcp6_lease *lease, uint8_t *optval,
73 size_t optlen) ;
74
75 int dhcp6_lease_new(sd_dhcp6_lease **ret);