16 #ifndef __VOM_DHCP_CLIENT_H__ 17 #define __VOM_DHCP_CLIENT_H__ 28 namespace dhcp_client_cmds {
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,
121 const std::string& hostname,
123 bool set_broadcast_flag =
true,
144 const key_t& key()
const;
149 std::shared_ptr<dhcp_client> singular()
const;
154 std::string to_string()
const;
159 static void dump(std::ostream& os);
164 static std::shared_ptr<dhcp_client> find(
const key_t& k);
169 const std::shared_ptr<lease_t> lease()
const;
189 void handle_replay();
194 void show(std::ostream& os);
215 static std::shared_ptr<dhcp_client> find_or_add(
const dhcp_client& temp);
237 void lease(std::shared_ptr<lease_t> l);
244 const std::shared_ptr<interface> m_itf;
249 const std::string m_hostname;
259 const bool m_set_broadcast_flag;
275 std::shared_ptr<lease_t> m_lease;
277 std::shared_ptr<dhcp_client_cmds::events_cmd> m_event_cmd;
279 void handle_dhcp_event(std::shared_ptr<lease_t> e);
286 static std::weak_ptr<dhcp_client_cmds::events_cmd> m_s_event_cmd;
287 static std::shared_ptr<dhcp_client_cmds::events_cmd> get_event_cmd();
296 void handle_dhcp_event(std::shared_ptr<lease_t> e);
298 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.
route::path from_vpp(const vapi_type_fib_path &p, const nh_proto_t &nhp)
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.
Type def of a Ethernet address.
std::string key_t
The key for interface's key.