summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/dhcp-server-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-network/dhcp-server-internal.h')
-rw-r--r--src/libsystemd-network/dhcp-server-internal.h33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/libsystemd-network/dhcp-server-internal.h b/src/libsystemd-network/dhcp-server-internal.h
index da9e56b..0b2fa96 100644
--- a/src/libsystemd-network/dhcp-server-internal.h
+++ b/src/libsystemd-network/dhcp-server-internal.h
@@ -8,6 +8,7 @@
#include "sd-dhcp-server.h"
#include "sd-event.h"
+#include "dhcp-client-id-internal.h"
#include "dhcp-option.h"
#include "network-common.h"
#include "ordered-set.h"
@@ -24,25 +25,6 @@ typedef enum DHCPRawOption {
_DHCP_RAW_OPTION_DATA_INVALID,
} DHCPRawOption;
-typedef struct DHCPClientId {
- size_t length;
- uint8_t *data;
-} DHCPClientId;
-
-typedef struct DHCPLease {
- sd_dhcp_server *server;
-
- DHCPClientId client_id;
-
- uint8_t htype; /* e.g. ARPHRD_ETHER */
- uint8_t hlen; /* e.g. ETH_ALEN */
- be32_t address;
- be32_t gateway;
- uint8_t chaddr[16];
- usec_t expiration;
- char *hostname;
-} DHCPLease;
-
struct sd_dhcp_server {
unsigned n_ref;
@@ -93,6 +75,9 @@ struct sd_dhcp_server {
char *agent_circuit_id;
char *agent_remote_id;
+
+ int lease_dir_fd;
+ char *lease_file;
};
typedef struct DHCPRequest {
@@ -100,7 +85,7 @@ typedef struct DHCPRequest {
DHCPMessage *message;
/* options */
- DHCPClientId client_id;
+ sd_dhcp_client_id client_id;
size_t max_optlen;
be32_t server_id;
be32_t requested_ip;
@@ -113,20 +98,12 @@ typedef struct DHCPRequest {
triple_timestamp timestamp;
} DHCPRequest;
-extern const struct hash_ops dhcp_lease_hash_ops;
-
int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message,
size_t length, const triple_timestamp *timestamp);
int dhcp_server_send_packet(sd_dhcp_server *server,
DHCPRequest *req, DHCPPacket *packet,
int type, size_t optoffset);
-void client_id_hash_func(const DHCPClientId *p, struct siphash *state);
-int client_id_compare_func(const DHCPClientId *a, const DHCPClientId *b);
-
-DHCPLease *dhcp_lease_free(DHCPLease *lease);
-DEFINE_TRIVIAL_CLEANUP_FUNC(DHCPLease*, dhcp_lease_free);
-
#define log_dhcp_server_errno(server, error, fmt, ...) \
log_interface_prefix_full_errno( \
"DHCPv4 server: ", \