16 #ifndef __VOM_DHCP_CLIENT_H__ 17 #define __VOM_DHCP_CLIENT_H__ 28 namespace dhcp_client_cmds {
48 static const state_t& from_vpp(
int i);
54 state_t(
int v,
const std::string& s);
64 std::shared_ptr<interface> itf,
67 const std::string& hostname,
70 std::string to_string()
const;
73 std::shared_ptr<interface>
itf;
95 virtual void handle_dhcp_event(std::shared_ptr<lease_t> e) = 0;
113 const std::string& hostname,
114 bool set_broadcast_flag =
true,
122 const std::string& hostname,
124 bool set_broadcast_flag =
true,
146 const key_t&
key()
const;
151 std::shared_ptr<dhcp_client> singular()
const;
156 std::string to_string()
const;
161 static void dump(std::ostream& os);
166 static std::shared_ptr<dhcp_client> find(
const key_t& k);
171 const std::shared_ptr<lease_t> lease()
const;
191 void handle_replay();
196 void show(std::ostream& os);
217 static std::shared_ptr<dhcp_client> find_or_add(
const dhcp_client& temp);
239 void lease(std::shared_ptr<lease_t> l);
246 const std::shared_ptr<interface> m_itf;
251 const std::string m_hostname;
261 const bool m_set_broadcast_flag;
282 std::shared_ptr<lease_t> m_lease;
284 std::shared_ptr<dhcp_client_cmds::events_cmd> m_event_cmd;
286 void handle_dhcp_event(std::shared_ptr<lease_t> e);
293 static std::weak_ptr<dhcp_client_cmds::events_cmd> m_s_event_cmd;
294 static std::shared_ptr<dhcp_client_cmds::events_cmd> get_event_cmd();
303 void handle_dhcp_event(std::shared_ptr<lease_t> e);
305 static dhcp_client_listener m_listener;
HW::item< bool > m_status
The HW::item associated with this command.
A template base class for all enum types.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static const state_t REQUEST
A functor class represents our desire to recieve interface events.
A representation of DHCP client on an interface.
A class that listens to DHCP Events.
Type def of a L2 address as read from VPP.
vhost_vring_state_t state
route::prefix_t host_prefix
static const state_t BOUND
static const state_t DISCOVER
A Database to store the unique 'singular' instances of a single object type.
boost::asio::ip::address router_address
interface::key_t key_t
typedef for the DHCP client key type
A representation of an interface in VPP.
std::shared_ptr< interface > itf
Class definition for listeners to OM events.
inspect command handler Handler
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
The interface to writing objects into VPP OM.
A base class for all object_base in the VPP object_base-Model.
The VPP Object Model (VOM) library.
static const ip_dscp_t DSCP_CS0
Type def of a Ethernet address.
std::string key_t
The key for interface's key.