]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-dhcp-lease.h
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / systemd / sd-dhcp-lease.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
fe8db0c5
TG
2#ifndef foosddhcpleasehfoo
3#define foosddhcpleasehfoo
a6cc569e
TG
4
5/***
a6cc569e
TG
6 Copyright (C) 2013 Intel Corporation. All rights reserved.
7 Copyright (C) 2014 Tom Gundersen
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
04c01369 23#include <inttypes.h>
fe8db0c5 24#include <net/ethernet.h>
04c01369
LP
25#include <netinet/in.h>
26#include <sys/types.h>
27
28#include "_sd-common.h"
29
30_SD_BEGIN_DECLARATIONS;
a6cc569e 31
fe8db0c5 32typedef struct sd_dhcp_lease sd_dhcp_lease;
f8693fc7 33typedef struct sd_dhcp_route sd_dhcp_route;
a6cc569e 34
fe8db0c5
TG
35sd_dhcp_lease *sd_dhcp_lease_ref(sd_dhcp_lease *lease);
36sd_dhcp_lease *sd_dhcp_lease_unref(sd_dhcp_lease *lease);
74b2466e 37
fe8db0c5 38int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr);
68ceb9df 39int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime);
0339cd77
LP
40int sd_dhcp_lease_get_t1(sd_dhcp_lease *lease, uint32_t *t1);
41int sd_dhcp_lease_get_t2(sd_dhcp_lease *lease, uint32_t *t2);
42int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr);
fe8db0c5
TG
43int sd_dhcp_lease_get_netmask(sd_dhcp_lease *lease, struct in_addr *addr);
44int sd_dhcp_lease_get_router(sd_dhcp_lease *lease, struct in_addr *addr);
8e34a618 45int sd_dhcp_lease_get_next_server(sd_dhcp_lease *lease, struct in_addr *addr);
0ad853bc 46int sd_dhcp_lease_get_server_identifier(sd_dhcp_lease *lease, struct in_addr *addr);
a2ba62c7
LP
47int sd_dhcp_lease_get_dns(sd_dhcp_lease *lease, const struct in_addr **addr);
48int sd_dhcp_lease_get_ntp(sd_dhcp_lease *lease, const struct in_addr **addr);
fe8db0c5
TG
49int sd_dhcp_lease_get_mtu(sd_dhcp_lease *lease, uint16_t *mtu);
50int sd_dhcp_lease_get_domainname(sd_dhcp_lease *lease, const char **domainname);
b85bc551 51int sd_dhcp_lease_get_search_domains(sd_dhcp_lease *lease, char ***domains);
fe8db0c5 52int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname);
ce78df79 53int sd_dhcp_lease_get_root_path(sd_dhcp_lease *lease, const char **root_path);
f8693fc7 54int sd_dhcp_lease_get_routes(sd_dhcp_lease *lease, sd_dhcp_route ***routes);
0339cd77
LP
55int sd_dhcp_lease_get_vendor_specific(sd_dhcp_lease *lease, const void **data, size_t *data_len);
56int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const void **client_id, size_t *client_id_len);
8eb9058d 57int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone);
74b2466e 58
f8693fc7
BG
59int sd_dhcp_route_get_destination(sd_dhcp_route *route, struct in_addr *destination);
60int sd_dhcp_route_get_destination_prefix_length(sd_dhcp_route *route, uint8_t *length);
61int sd_dhcp_route_get_gateway(sd_dhcp_route *route, struct in_addr *gateway);
62
4afd3348
LP
63_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_lease, sd_dhcp_lease_unref);
64
04c01369
LP
65_SD_END_DECLARATIONS;
66
fe8db0c5 67#endif