|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __VOM_DHCP_CLIENT_H__
17 #define __VOM_DHCP_CLIENT_H__
28 namespace dhcp_client_cmds {
64 std::shared_ptr<interface>
itf,
73 std::shared_ptr<interface>
itf;
151 std::shared_ptr<dhcp_client>
singular()
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;
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.
event_listener()
Constructor.
const static state_t REQUEST
The VPP Object Model (VOM) library.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
std::string to_string() const
convert to string format for debug purposes
The interface to writing objects into VPP OM.
interface::key_t key_t
typedef for the DHCP client key type
const static state_t DISCOVER
static std::shared_ptr< dhcp_client > find(const key_t &k)
Find a DHCP client from its key.
inspect command handler Handler
dhcp_client(const interface &itf, const std::string &hostname, bool set_broadcast_flag=true, const ip_dscp_t &dscp=ip_dscp_t::DSCP_CS0, event_listener *ev=nullptr)
Construct a new object matching the desried state.
boost::asio::ip::address router_address
~dhcp_client()
Destructor.
static void dump(std::ostream &os)
Dump all DHCP clients into the stream provided.
A functor class represents our desire to recieve interface events.
Class definition for listeners to OM events.
std::shared_ptr< interface > itf
bool operator==(const dhcp_client &d) const
Comparison operator - for UT.
A representation of DHCP client on an interface.
std::string to_string() const
virtual void handle_dhcp_event(std::shared_ptr< lease_t > e)=0
listener's virtual function invoked when a DHCP event is available to read
A template base class for all enum types.
A representation of an interface in VPP.
route::prefix_t host_prefix
const typedef std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
sll srl srl sll sra u16x4 i
const std::shared_ptr< lease_t > lease() const
return the current lease data
manual_print typedef address
static const state_t & from_vpp(int i)
A class that listens to DHCP Events.
Type def of a L2 address as read from VPP.
const key_t & key() const
Return the object's key.
HW::item< bool > & status()
Return the HW::item associated with this command.
Type def of a Ethernet address.
const static state_t BOUND
std::shared_ptr< dhcp_client > singular() const
Return the 'singular' of the DHCP client that matches this object.
const static ip_dscp_t DSCP_CS0
A Database to store the unique 'singular' instances of a single object type.
std::string key_t
The key for interface's key.
void event_handler(void *tls_async)
A base class for all object_base in the VPP object_base-Model.