dhcp client: add class DHCPV4
Add class DHCPV4 for dhcp_client.
This is the class that executes the DHCP ipv4 state machine logic.
Bug: 25642025
TEST=compile
Change-Id: Ia173d3f79bf12b12feb1c7dd60d58385e085e31e
diff --git a/service.h b/service.h
index 1f3f223..6adbc12 100644
--- a/service.h
+++ b/service.h
@@ -23,6 +23,8 @@
#include <base/memory/ref_counted.h>
#include <brillo/variant_dictionary.h>
+#include "dhcp_client/dhcp.h"
+#include "dhcp_client/dhcpv4.h"
#include "dhcp_client/event_dispatcher_interface.h"
namespace dhcp_client {
@@ -37,7 +39,7 @@
const brillo::VariantDictionary& configs);
virtual ~Service();
- void Start();
+ bool Start();
void Stop();
private:
@@ -45,15 +47,19 @@
// Indentifier number of this service.
int identifier_;
EventDispatcherInterface* event_dispatcher_;
- // Name of the network interface.
+ // Interface parameters.
std::string interface_name_;
- // Type of the DHCP service.
- // It can be IPv4 only or IPv6 only or both.
- int type_;
+ std::string hardware_address_;
+ unsigned int interface_index_;
+
// Unique network/connection identifier,
// lease will persist to storage if this identifier is specified.
std::string network_id_;
+ // Type of the DHCP service.
+ // It can be IPv4 only or IPv6 only or both.
+ DHCP::ServiceType type_;
+
// DHCP IPv4 configurations:
// Request hostname from server.
bool request_hostname_;
@@ -67,6 +73,8 @@
bool request_na_;
// Request prefix delegation.
bool request_pd_;
+
+ std::unique_ptr<DHCPV4> state_machine_ipv4_;
// Parse DHCP configurations from the VariantDictionary.
void ParseConfigs(const brillo::VariantDictionary& configs);