]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/dhcp-server-internal.h
b30be7e5b2d6e4b0173a2b2d6417ef60b18875d4
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright © 2013 Intel Corporation. All rights reserved.
8 #include "sd-dhcp-server.h"
11 #include "dhcp-internal.h"
14 #include "time-util.h"
16 typedef struct DHCPClientId
{
21 typedef struct DHCPLease
{
22 DHCPClientId client_id
;
30 struct sd_dhcp_server
{
35 sd_event_source
*receive_message
;
48 struct in_addr
*ntp
, *dns
;
49 unsigned n_ntp
, n_dns
;
53 Hashmap
*leases_by_client_id
;
54 DHCPLease
**bound_leases
;
55 DHCPLease invalid_lease
;
57 uint32_t max_lease_time
, default_lease_time
;
60 typedef struct DHCPRequest
{
61 /* received message */
65 DHCPClientId client_id
;
72 #define log_dhcp_server(client, fmt, ...) log_internal(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "DHCP SERVER: " fmt, ##__VA_ARGS__)
73 #define log_dhcp_server_errno(client, error, fmt, ...) log_internal(LOG_DEBUG, error, __FILE__, __LINE__, __func__, "DHCP SERVER: " fmt, ##__VA_ARGS__)
75 int dhcp_server_handle_message(sd_dhcp_server
*server
, DHCPMessage
*message
,
77 int dhcp_server_send_packet(sd_dhcp_server
*server
,
78 DHCPRequest
*req
, DHCPPacket
*packet
,
79 int type
, size_t optoffset
);
81 void client_id_hash_func(const DHCPClientId
*p
, struct siphash
*state
);
82 int client_id_compare_func(const DHCPClientId
*a
, const DHCPClientId
*b
);