summaryrefslogtreecommitdiff
path: root/src/systemd
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/systemd
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/systemd')
-rw-r--r--src/systemd/sd-dhcp-client.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemd/sd-dhcp-client.h b/src/systemd/sd-dhcp-client.h
index 9b19a1dc9..acfa3fac2 100644
--- a/src/systemd/sd-dhcp-client.h
+++ b/src/systemd/sd-dhcp-client.h
@@ -23,6 +23,7 @@
***/
#include <netinet/in.h>
+#include <net/ethernet.h>
typedef struct sd_dhcp_client sd_dhcp_client;
@@ -30,7 +31,10 @@ int sd_dhcp_client_set_request_option(sd_dhcp_client *client, uint8_t option);
int sd_dhcp_client_set_request_address(sd_dhcp_client *client,
const struct in_addr *last_address);
int sd_dhcp_client_set_index(sd_dhcp_client *client, int interface_index);
+int sd_dhcp_client_set_mac(sd_dhcp_client *client,
+ const struct ether_addr *addr);
+int sd_dhcp_client_start(sd_dhcp_client *client);
sd_dhcp_client *sd_dhcp_client_new(void);
#endif