]>
git.proxmox.com Git - systemd.git/blob - src/libsystemd-network/dhcp-lease-internal.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright (C) 2013 Intel Corporation. All rights reserved.
9 Copyright (C) 2014 Tom Gundersen
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.
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.
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/>.
26 #include <linux/if_packet.h>
32 #include "dhcp-protocol.h"
34 #include "sd-dhcp-client.h"
36 struct sd_dhcp_route
{
37 struct in_addr dst_addr
;
38 struct in_addr gw_addr
;
39 unsigned char dst_prefixlen
;
42 struct sd_dhcp_raw_option
{
43 LIST_FIELDS(struct sd_dhcp_raw_option
, options
);
50 struct sd_dhcp_lease
{
57 uint32_t mtu_aging_timeout
;
59 be32_t server_address
;
68 struct in_addr
*policy_filter
;
69 size_t policy_filter_size
;
70 struct sd_dhcp_route
*static_route
;
71 size_t static_route_size
;
72 size_t static_route_allocated
;
73 uint16_t boot_file_size
;
78 bool ip_forward_non_local
;
84 uint8_t *vendor_specific
;
85 size_t vendor_specific_len
;
86 LIST_HEAD(struct sd_dhcp_raw_option
, private_options
);
89 int dhcp_lease_new(sd_dhcp_lease
**ret
);
90 int dhcp_lease_parse_options(uint8_t code
, uint8_t len
, const uint8_t *option
,
92 int dhcp_lease_insert_private_option(sd_dhcp_lease
*lease
, uint8_t tag
,
93 const uint8_t *data
, uint8_t len
);
95 int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease
*lease
);
97 int dhcp_lease_set_client_id(sd_dhcp_lease
*lease
, const uint8_t *client_id
,
98 size_t client_id_len
);
100 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp_lease
*, sd_dhcp_lease_unref
);
101 #define _cleanup_dhcp_lease_unref_ _cleanup_(sd_dhcp_lease_unrefp)