]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
3fb2c570 PF |
2 | #pragma once |
3 | ||
4 | /*** | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright (C) 2014 Tom Gundersen | |
7bd8e95d | 8 | Copyright (C) 2014-2015 Intel Corporation. All rights reserved. |
3fb2c570 PF |
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 | ||
3fb2c570 | 26 | #include "sd-dhcp6-lease.h" |
71d35b6b | 27 | |
3fb2c570 PF |
28 | #include "dhcp6-internal.h" |
29 | ||
30 | struct sd_dhcp6_lease { | |
3733eec3 | 31 | unsigned n_ref; |
3fb2c570 PF |
32 | |
33 | uint8_t *serverid; | |
34 | size_t serverid_len; | |
35 | uint8_t preference; | |
ed6ee219 | 36 | bool rapid_commit; |
3fb2c570 PF |
37 | |
38 | DHCP6IA ia; | |
ea3b3a75 PF |
39 | |
40 | DHCP6Address *addr_iter; | |
7bd8e95d PF |
41 | |
42 | struct in6_addr *dns; | |
43 | size_t dns_count; | |
44 | size_t dns_allocated; | |
5da1b97f PF |
45 | char **domains; |
46 | size_t domains_count; | |
6599680e PF |
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; | |
3fb2c570 PF |
52 | }; |
53 | ||
54 | int dhcp6_lease_clear_timers(DHCP6IA *ia); | |
709d6710 | 55 | int dhcp6_lease_ia_rebind_expire(const DHCP6IA *ia, uint32_t *expire); |
3fb2c570 PF |
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); | |
ed6ee219 PF |
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 | ||
3fb2c570 PF |
66 | int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid); |
67 | ||
7bd8e95d | 68 | int dhcp6_lease_set_dns(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen); |
5da1b97f PF |
69 | int dhcp6_lease_set_domains(sd_dhcp6_lease *lease, uint8_t *optval, |
70 | size_t optlen); | |
6599680e | 71 | int dhcp6_lease_set_ntp(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen); |
41e4615d PF |
72 | int dhcp6_lease_set_sntp(sd_dhcp6_lease *lease, uint8_t *optval, |
73 | size_t optlen) ; | |
6599680e | 74 | |
3fb2c570 | 75 | int dhcp6_lease_new(sd_dhcp6_lease **ret); |