typedef struct sd_dhcp_client sd_dhcp_client;
-extern const struct hash_ops dhcp_option_hash_ops;
-
int dhcp_client_set_state_callback(
sd_dhcp_client *client,
sd_dhcp_client_callback_t cb,
+++ /dev/null
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#pragma once
-
-/***
- Copyright © 2013 Intel Corporation. All rights reserved.
-***/
-
-#include <stdint.h>
-
-#include "sd-dhcp-client.h"
-
-#include "dhcp-client-internal.h"
-#include "dhcp-protocol.h"
-
-typedef struct sd_dhcp_option {
- unsigned n_ref;
-
- uint8_t option;
- void *data;
- size_t length;
-} sd_dhcp_option;
-
-typedef struct DHCPServerData {
- struct in_addr *addr;
- size_t size;
-} DHCPServerData;
-
-int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset, uint8_t overload,
- uint8_t code, size_t optlen, const void *optval);
-int dhcp_option_find_option(uint8_t *options, size_t length, uint8_t wanted_code, size_t *ret_offset);
-int dhcp_option_remove_option(uint8_t *options, size_t buflen, uint8_t option_code);
-
-typedef int (*dhcp_option_callback_t)(uint8_t code, uint8_t len,
- const void *option, void *userdata);
-
-int dhcp_option_parse(DHCPMessage *message, size_t len, dhcp_option_callback_t cb, void *userdata, char **ret_error_message);
-
-int dhcp_option_parse_string(const uint8_t *option, size_t len, char **ret);
-
-int dhcp_message_init(DHCPMessage *message, uint8_t op, uint32_t xid,
- uint8_t type, uint16_t arp_type, uint8_t hlen, const uint8_t *chaddr,
- size_t optlen, size_t *optoffset);
-
-uint16_t dhcp_packet_checksum(uint8_t *buf, size_t len);
-
-void dhcp_packet_append_ip_headers(DHCPPacket *packet, be32_t source_addr,
- uint16_t source, be32_t destination_addr,
- uint16_t destination, uint16_t len, int ip_service_type);
-
-int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum, uint16_t port);
#include "sd-dhcp-client.h"
#include "alloc-util.h"
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
#include "list.h"
#include "time-util.h"
#include <stdio.h>
#include "alloc-util.h"
-#include "dhcp-internal.h"
+#include "dhcp-option.h"
#include "dhcp-server-internal.h"
#include "memory-util.h"
+#include "ordered-set.h"
#include "strv.h"
#include "utf8.h"
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include <stdint.h>
+
+#include "sd-dhcp-option.h"
+
+#include "dhcp-protocol.h"
+#include "hash-funcs.h"
+
+struct sd_dhcp_option {
+ unsigned n_ref;
+
+ uint8_t option;
+ void *data;
+ size_t length;
+};
+
+extern const struct hash_ops dhcp_option_hash_ops;
+
+typedef struct DHCPServerData {
+ struct in_addr *addr;
+ size_t size;
+} DHCPServerData;
+
+int dhcp_option_append(
+ DHCPMessage *message,
+ size_t size,
+ size_t *offset,
+ uint8_t overload,
+ uint8_t code,
+ size_t optlen,
+ const void *optval);
+int dhcp_option_find_option(uint8_t *options, size_t length, uint8_t wanted_code, size_t *ret_offset);
+int dhcp_option_remove_option(uint8_t *options, size_t buflen, uint8_t option_code);
+
+typedef int (*dhcp_option_callback_t)(uint8_t code, uint8_t len, const void *option, void *userdata);
+
+int dhcp_option_parse(
+ DHCPMessage *message,
+ size_t len,
+ dhcp_option_callback_t cb,
+ void *userdata,
+ char **ret_error_message);
+
+int dhcp_option_parse_string(const uint8_t *option, size_t len, char **ret);
#include <net/if_arp.h>
#include <string.h>
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
+#include "dhcp-packet.h"
#include "memory-util.h"
#define DHCP_CLIENT_MIN_OPTIONS_SIZE 312
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "dhcp-protocol.h"
+
+int dhcp_message_init(
+ DHCPMessage *message,
+ uint8_t op,
+ uint32_t xid,
+ uint8_t type,
+ uint16_t arp_type,
+ uint8_t hlen,
+ const uint8_t *chaddr,
+ size_t optlen,
+ size_t *optoffset);
+
+uint16_t dhcp_packet_checksum(uint8_t *buf, size_t len);
+
+void dhcp_packet_append_ip_headers(
+ DHCPPacket *packet,
+ be32_t source_addr,
+ uint16_t source,
+ be32_t destination_addr,
+ uint16_t destination,
+ uint16_t len,
+ int ip_service_type);
+
+int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum, uint16_t port);
#include <netinet/udp.h>
#include <stdint.h>
+#include "sd-dhcp-protocol.h"
+
#include "macro.h"
#include "sparse-endian.h"
#include "time-util.h"
#include "sd-dhcp-server.h"
#include "sd-event.h"
-#include "dhcp-internal.h"
+#include "dhcp-option.h"
#include "network-common.h"
#include "ordered-set.h"
#include "time-util.h"
#include "alloc-util.h"
#include "device-util.h"
+#include "dhcp-client-internal.h"
#include "dhcp-identifier.h"
-#include "dhcp-internal.h"
#include "dhcp-lease-internal.h"
#include "dhcp-network.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
+#include "dhcp-packet.h"
#include "dns-domain.h"
#include "ether-addr-util.h"
#include "event-util.h"
#include "sd-dhcp-lease.h"
#include "alloc-util.h"
-#include "dhcp-internal.h"
#include "dhcp-lease-internal.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
#include "dns-domain.h"
#include "env-file.h"
#include "fd-util.h"
#include "hexdecoct.h"
#include "hostname-util.h"
#include "in-addr-util.h"
+#include "network-common.h"
#include "network-internal.h"
#include "parse-util.h"
#include "stdio-util.h"
#include "sd-id128.h"
#include "alloc-util.h"
-#include "dhcp-internal.h"
#include "dhcp-network.h"
+#include "dhcp-option.h"
+#include "dhcp-packet.h"
#include "dhcp-server-internal.h"
#include "dns-domain.h"
#include "fd-util.h"
#include "alloc-util.h"
#include "dhcp-identifier.h"
-#include "dhcp-internal.h"
#include "dhcp-network.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
+#include "dhcp-packet.h"
#include "ether-addr-util.h"
#include "fd-util.h"
#include "random-util.h"
#include <string.h>
#include "alloc-util.h"
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
+#include "dhcp-option.h"
+#include "dhcp-packet.h"
+#include "ether-addr-util.h"
#include "macro.h"
#include "memory-util.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "dhcp-identifier.h"
-#include "dhcp-client-internal.h"
+#include "dhcp-option.h"
#include "dhcp6-internal.h"
#include "escape.h"
#include "hexdecoct.h"