]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-network/dhcp6-lease-internal.h
dhcp6-option: Add helper function for uncompressed domain names
[thirdparty/systemd.git] / src / libsystemd-network / dhcp6-lease-internal.h
CommitLineData
3fb2c570
PF
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3#pragma once
4
5/***
6 This file is part of systemd.
7
8 Copyright (C) 2014 Tom Gundersen
9 Copyright (C) 2014 Intel Corporation. All rights reserved.
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23***/
24
25#include <stdint.h>
26
27#include "refcnt.h"
28
29#include "sd-dhcp6-lease.h"
30#include "dhcp6-internal.h"
31
32struct sd_dhcp6_lease {
33 RefCount n_ref;
34
35 uint8_t *serverid;
36 size_t serverid_len;
37 uint8_t preference;
ed6ee219 38 bool rapid_commit;
3fb2c570
PF
39
40 DHCP6IA ia;
ea3b3a75
PF
41
42 DHCP6Address *addr_iter;
3fb2c570
PF
43};
44
45int dhcp6_lease_clear_timers(DHCP6IA *ia);
709d6710 46int dhcp6_lease_ia_rebind_expire(const DHCP6IA *ia, uint32_t *expire);
3fb2c570
PF
47DHCP6IA *dhcp6_lease_free_ia(DHCP6IA *ia);
48
49int dhcp6_lease_set_serverid(sd_dhcp6_lease *lease, const uint8_t *id,
50 size_t len);
51int dhcp6_lease_get_serverid(sd_dhcp6_lease *lease, uint8_t **id, size_t *len);
52int dhcp6_lease_set_preference(sd_dhcp6_lease *lease, uint8_t preference);
53int dhcp6_lease_get_preference(sd_dhcp6_lease *lease, uint8_t *preference);
ed6ee219
PF
54int dhcp6_lease_set_rapid_commit(sd_dhcp6_lease *lease);
55int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *rapid_commit);
56
3fb2c570
PF
57int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid);
58
59int dhcp6_lease_new(sd_dhcp6_lease **ret);
60
61DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp6_lease*, sd_dhcp6_lease_unref);
62#define _cleanup_dhcp6_lease_free_ _cleanup_(sd_dhcp6_lease_unrefp)