summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp/dhcp-protocol.h
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-12-09 23:43:26 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-12 11:43:34 -0500
commit8c00042c939938818365753023ff2d50f984dec6 (patch)
treeafffca11004c504d8c6e98ca3efea1d8911e8f13 /src/libsystemd-dhcp/dhcp-protocol.h
parentd3d8ac2f2bac721d99f893c0a0128d21db636d4c (diff)
dhcp: Handle received DHCP Offer message
Create a function for handling the full IP, UDP and DHCP packet and tie it to the main loop. Verify IP and UDP headers and checksum. Creat a new lease structure with using the values supplied in the DHCP message. Free the lease structure when client is stopped. Split out socket handling into a creation and a sending part. As a result modify the test code.
Diffstat (limited to 'src/libsystemd-dhcp/dhcp-protocol.h')
-rw-r--r--src/libsystemd-dhcp/dhcp-protocol.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-dhcp/dhcp-protocol.h b/src/libsystemd-dhcp/dhcp-protocol.h
index fa077fbf40..95c4f4ea66 100644
--- a/src/libsystemd-dhcp/dhcp-protocol.h
+++ b/src/libsystemd-dhcp/dhcp-protocol.h
@@ -55,6 +55,10 @@ struct DHCPPacket {
typedef struct DHCPPacket DHCPPacket;
+#define DHCP_IP_SIZE (int32_t)(sizeof(struct iphdr))
+#define DHCP_IP_UDP_SIZE (int32_t)(sizeof(struct udphdr) + DHCP_IP_SIZE)
+#define DHCP_MESSAGE_SIZE (int32_t)(sizeof(DHCPMessage))
+
enum {
DHCP_PORT_SERVER = 67,
DHCP_PORT_CLIENT = 68,
@@ -102,8 +106,10 @@ enum {
DHCP_OPTION_DOMAIN_NAME = 15,
DHCP_OPTION_NTP_SERVER = 42,
DHCP_OPTION_REQUESTED_IP_ADDRESS = 50,
+ DHCP_OPTION_IP_ADDRESS_LEASE_TIME = 51,
DHCP_OPTION_OVERLOAD = 52,
DHCP_OPTION_MESSAGE_TYPE = 53,
+ DHCP_OPTION_SERVER_IDENTIFIER = 54,
DHCP_OPTION_PARAMETER_REQUEST_LIST = 55,
DHCP_OPTION_CLIENT_IDENTIFIER = 61,
DHCP_OPTION_END = 255,