]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/dhcp-protocol.h
2230e094d0622bc9afeedb5bc3469f3d09d298e2
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright (C) 2013 Intel Corporation. All rights reserved.
10 #include <netinet/ip.h>
11 #include <netinet/udp.h>
15 #include "sparse-endian.h"
36 typedef struct DHCPMessage DHCPMessage
;
44 typedef struct DHCPPacket DHCPPacket
;
46 #define DHCP_IP_SIZE (int32_t)(sizeof(struct iphdr))
47 #define DHCP_IP_UDP_SIZE (int32_t)(sizeof(struct udphdr) + DHCP_IP_SIZE)
48 #define DHCP_MESSAGE_SIZE (int32_t)(sizeof(DHCPMessage))
49 #define DHCP_DEFAULT_MIN_SIZE 576 /* the minimum internet hosts must be able to receive */
50 #define DHCP_MIN_OPTIONS_SIZE (DHCP_DEFAULT_MIN_SIZE - DHCP_IP_UDP_SIZE - DHCP_MESSAGE_SIZE)
51 #define DHCP_MAGIC_COOKIE (uint32_t)(0x63825363)
54 DHCP_PORT_SERVER
= 67,
55 DHCP_PORT_CLIENT
= 68,
60 DHCP_STATE_SELECTING
= 1,
61 DHCP_STATE_INIT_REBOOT
= 2,
62 DHCP_STATE_REBOOTING
= 3,
63 DHCP_STATE_REQUESTING
= 4,
65 DHCP_STATE_RENEWING
= 6,
66 DHCP_STATE_REBINDING
= 7,
67 DHCP_STATE_STOPPED
= 8,
70 typedef enum DHCPState DHCPState
;
90 DHCP_OVERLOAD_FILE
= 1,
91 DHCP_OVERLOAD_SNAME
= 2,
94 #define DHCP_MAX_FQDN_LENGTH 255
97 DHCP_FQDN_FLAG_S
= (1 << 0),
98 DHCP_FQDN_FLAG_O
= (1 << 1),
99 DHCP_FQDN_FLAG_E
= (1 << 2),
100 DHCP_FQDN_FLAG_N
= (1 << 3),