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:19 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-12 11:43:34 -0500
commit46a66b794a00e0f34981ac25dbf2eae2423b6215 (patch)
treea7015981a327512cb35688e2ab432d33f699d7c6 /src/libsystemd-dhcp/dhcp-protocol.h
parent8b4a96932de0c56048fbd7f7386090dc202704f7 (diff)
dhcp: Add DHCP discover sending
On starting the client, use the supplied interface mac address and create a transaction id. Puzzle together an IP/UDP/DHCP Discover message, compute checksums and send it out as a raw packet. Create an additional function that constructs default options common to all DHCP messages. Set the DHCP Client ID option as noticed by Grant Erickson in ConnMan commit b18d9798b3a0ae46ed87d6d2be8d5a474bf3ab1e: "Some Internet gateways and Wi-Fi access points are unhappy when the DHCPv4 client-id option (61) is missing and will refuse to issue a DHCP lease."
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 d37546721a..fa077fbf40 100644
--- a/src/libsystemd-dhcp/dhcp-protocol.h
+++ b/src/libsystemd-dhcp/dhcp-protocol.h
@@ -55,6 +55,11 @@ struct DHCPPacket {
typedef struct DHCPPacket DHCPPacket;
+enum {
+ DHCP_PORT_SERVER = 67,
+ DHCP_PORT_CLIENT = 68,
+};
+
enum DHCPState {
DHCP_STATE_INIT = 0,
DHCP_STATE_SELECTING = 1,
@@ -100,5 +105,6 @@ enum {
DHCP_OPTION_OVERLOAD = 52,
DHCP_OPTION_MESSAGE_TYPE = 53,
DHCP_OPTION_PARAMETER_REQUEST_LIST = 55,
+ DHCP_OPTION_CLIENT_IDENTIFIER = 61,
DHCP_OPTION_END = 255,
};