]>
Commit | Line | Data |
---|---|---|
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ | |
2 | #ifndef foosddhcpleasehfoo | |
3 | #define foosddhcpleasehfoo | |
4 | ||
5 | /*** | |
6 | Copyright © 2013 Intel Corporation. All rights reserved. | |
7 | systemd is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU Lesser General Public License as published by | |
9 | the Free Software Foundation; either version 2.1 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | systemd is distributed in the hope that it will be useful, but | |
13 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | Lesser General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU Lesser General Public License | |
18 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
19 | ***/ | |
20 | ||
21 | #include <inttypes.h> | |
22 | #include <net/ethernet.h> | |
23 | #include <netinet/in.h> | |
24 | #include <sys/types.h> | |
25 | ||
26 | #include "_sd-common.h" | |
27 | ||
28 | _SD_BEGIN_DECLARATIONS; | |
29 | ||
30 | typedef struct sd_dhcp_lease sd_dhcp_lease; | |
31 | typedef struct sd_dhcp_route sd_dhcp_route; | |
32 | ||
33 | sd_dhcp_lease *sd_dhcp_lease_ref(sd_dhcp_lease *lease); | |
34 | sd_dhcp_lease *sd_dhcp_lease_unref(sd_dhcp_lease *lease); | |
35 | ||
36 | typedef enum sd_dhcp_lease_server_type { | |
37 | SD_DHCP_LEASE_DNS, | |
38 | SD_DHCP_LEASE_NTP, | |
39 | SD_DHCP_LEASE_SIP, | |
40 | SD_DHCP_LEASE_POP3, | |
41 | SD_DHCP_LEASE_SMTP, | |
42 | SD_DHCP_LEASE_LPR, | |
43 | _SD_DHCP_LEASE_SERVER_TYPE_MAX, | |
44 | _SD_DHCP_LEASE_SERVER_TYPE_INVALID = -1, | |
45 | } sd_dhcp_lease_server_type; | |
46 | ||
47 | int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr); | |
48 | int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime); | |
49 | int sd_dhcp_lease_get_t1(sd_dhcp_lease *lease, uint32_t *t1); | |
50 | int sd_dhcp_lease_get_t2(sd_dhcp_lease *lease, uint32_t *t2); | |
51 | int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr); | |
52 | int sd_dhcp_lease_get_netmask(sd_dhcp_lease *lease, struct in_addr *addr); | |
53 | int sd_dhcp_lease_get_router(sd_dhcp_lease *lease, const struct in_addr **addr); | |
54 | int sd_dhcp_lease_get_next_server(sd_dhcp_lease *lease, struct in_addr *addr); | |
55 | int sd_dhcp_lease_get_server_identifier(sd_dhcp_lease *lease, struct in_addr *addr); | |
56 | int sd_dhcp_lease_get_servers(sd_dhcp_lease *lease, sd_dhcp_lease_server_type what, const struct in_addr **addr); | |
57 | int sd_dhcp_lease_get_dns(sd_dhcp_lease *lease, const struct in_addr **addr); | |
58 | int sd_dhcp_lease_get_ntp(sd_dhcp_lease *lease, const struct in_addr **addr); | |
59 | int sd_dhcp_lease_get_sip(sd_dhcp_lease *lease, const struct in_addr **addr); | |
60 | int sd_dhcp_lease_get_pop3(sd_dhcp_lease *lease, const struct in_addr **addr); | |
61 | int sd_dhcp_lease_get_smtp(sd_dhcp_lease *lease, const struct in_addr **addr); | |
62 | int sd_dhcp_lease_get_lpr(sd_dhcp_lease *lease, const struct in_addr **addr); | |
63 | int sd_dhcp_lease_get_mtu(sd_dhcp_lease *lease, uint16_t *mtu); | |
64 | int sd_dhcp_lease_get_domainname(sd_dhcp_lease *lease, const char **domainname); | |
65 | int sd_dhcp_lease_get_search_domains(sd_dhcp_lease *lease, char ***domains); | |
66 | int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname); | |
67 | int sd_dhcp_lease_get_root_path(sd_dhcp_lease *lease, const char **root_path); | |
68 | int sd_dhcp_lease_get_routes(sd_dhcp_lease *lease, sd_dhcp_route ***routes); | |
69 | int sd_dhcp_lease_get_vendor_specific(sd_dhcp_lease *lease, const void **data, size_t *data_len); | |
70 | int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const void **client_id, size_t *client_id_len); | |
71 | int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone); | |
72 | ||
73 | int sd_dhcp_route_get_destination(sd_dhcp_route *route, struct in_addr *destination); | |
74 | int sd_dhcp_route_get_destination_prefix_length(sd_dhcp_route *route, uint8_t *length); | |
75 | int sd_dhcp_route_get_gateway(sd_dhcp_route *route, struct in_addr *gateway); | |
76 | int sd_dhcp_route_get_option(sd_dhcp_route *route); | |
77 | ||
78 | _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_lease, sd_dhcp_lease_unref); | |
79 | ||
80 | _SD_END_DECLARATIONS; | |
81 | ||
82 | #endif |