23 vxlan_tunnel::event_handler vxlan_tunnel::m_evh;
33 const boost::asio::ip::address& dst,
73 <<
"src:" <<
src.to_string() <<
" dst:" <<
dst.to_string() <<
" vni:" <<
vni 88 vxlan_tunnel::mk_name(
const boost::asio::ip::address&
src,
89 const boost::asio::ip::address&
dst,
94 s << VXLAN_TUNNEL_NAME <<
"-" << src <<
"-" << dst <<
":" <<
vni;
100 const boost::asio::ip::address& dst,
105 , m_tep(src, dst, vni)
122 vxlan_tunnel::sweep()
131 vxlan_tunnel::replay()
146 m_db.release(m_tep,
this);
152 std::ostringstream s;
169 std::shared_ptr<vxlan_tunnel>
176 std::shared_ptr<vxlan_tunnel> sp;
178 sp = m_db.find_or_add(temp.m_tep, temp);
185 std::shared_ptr<vxlan_tunnel>
188 return (find_or_add(*
this));
191 std::shared_ptr<interface>
192 vxlan_tunnel::singular_i()
const 194 return find_or_add(*
this);
209 std::shared_ptr<vxlan_tunnel_cmds::dump_cmd>
cmd =
210 std::make_shared<vxlan_tunnel_cmds::dump_cmd>();
215 for (
auto& record : *cmd) {
216 auto& payload = record.get_payload();
218 boost::asio::ip::address src =
219 from_bytes(payload.is_ipv6, payload.src_address);
220 boost::asio::ip::address dst =
221 from_bytes(payload.is_ipv6, payload.dst_address);
223 std::shared_ptr<vxlan_tunnel> vt =
233 vxlan_tunnel::event_handler::event_handler()
240 vxlan_tunnel::event_handler::handle_replay()
246 vxlan_tunnel::event_handler::order()
const std::string to_string() const
Debug print function.
A representation of a VXLAN Tunnel in VPP.
void release()
release/remove an interface form the singular store
const std::string VXLAN_TUNNEL_NAME
virtual std::string to_string() const
Debug rpint function.
Combaintion of attributes that are a unique key for a VXLAN tunnel.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
boost::asio::ip::address dst
The destination IP address of the endpoint.
static void dump(std::ostream &os)
Dump all L3Configs into the stream provided.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
Tunnel or virtual interfaces next.
A Command class that creates an VXLAN tunnel.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
A functor class that creates an VXLAN tunnel.
std::shared_ptr< vxlan_tunnel > singular() const
Return the matching 'singular instance'.
A Database to store the unique 'singular' instances of a single object type.
The admin state of the interface.
A representation of an interface in VPP.
A type declaration of an interface handle in VPP.
boost::asio::ip::address from_bytes(uint8_t is_ip6, uint8_t *bytes)
Convert a VPP byte stinrg into a boost addresss.
endpoint_t()
Default constructor.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
const std::string & name() const
Return the interface type.
static void enqueue(cmd *f)
Enqueue A command for execution.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
vxlan_tunnel(const boost::asio::ip::address &src, const boost::asio::ip::address &dst, uint32_t vni)
Construct a new object matching the desried state.
bool operator<(const endpoint_t &o) const
less-than operator for map storage
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
bool operator==(const endpoint_t &o) const
Comparison operator.
uint32_t vni
The VNI of the endpoint.
boost::asio::ip::address src
The src IP address of the endpoint.
static bool register_listener(listener *listener)
Register a listener of events.
const key_t & key() const
Return the interface type.
const handle_t & handle() const
Return VPP's handle to this object.