29 bridge_domain::learning_mode_t::learning_mode_t(
int v,
const std::string& s)
30 : enum_base<bridge_domain::learning_mode_t>(v, s)
37 bridge_domain::flood_mode_t::flood_mode_t(
int v,
const std::string& s)
38 :
enum_base<bridge_domain::flood_mode_t>(v, s)
46 bridge_domain::mac_age_mode_t::mac_age_mode_t(
int v,
const std::string& s)
47 :
enum_base<bridge_domain::mac_age_mode_t>(v, s)
56 bridge_domain::arp_term_mode_t::arp_term_mode_t(
int v,
const std::string& s)
57 :
enum_base<bridge_domain::arp_term_mode_t>(v, s)
64 singular_db<uint32_t, bridge_domain> bridge_domain::m_db;
77 , m_learning_mode(lmode)
78 , m_arp_term_mode(amode)
80 , m_mac_age_mode(mmode)
86 , m_learning_mode(o.m_learning_mode)
87 , m_arp_term_mode(o.m_arp_term_mode)
88 , m_flood_mode(o.m_flood_mode)
89 , m_mac_age_mode(o.m_mac_age_mode)
102 return (m_id.
data());
108 return ((m_learning_mode == b.m_learning_mode) &&
109 (m_flood_mode == b.m_flood_mode) &&
110 (m_mac_age_mode == b.m_mac_age_mode) &&
111 (m_arp_term_mode == b.m_arp_term_mode) &&
id() == b.
id());
115 bridge_domain::sweep()
124 bridge_domain::replay()
128 m_id, m_learning_mode, m_arp_term_mode, m_flood_mode, m_mac_age_mode));
137 m_db.release(m_id.
data(),
this);
143 std::ostringstream s;
144 s <<
"bridge-domain:[" << m_id.
to_string()
145 <<
" learning-mode:" << m_learning_mode.
to_string() <<
"]";
150 std::shared_ptr<bridge_domain>
153 return (m_db.find(key));
164 m_id, m_learning_mode, m_arp_term_mode, m_flood_mode, m_mac_age_mode));
168 std::shared_ptr<bridge_domain>
171 return (m_db.find_or_add(temp.m_id.
data(), temp));
174 std::shared_ptr<bridge_domain>
177 return find_or_add(*
this);
192 std::shared_ptr<bridge_domain_cmds::dump_cmd>
cmd =
193 std::make_shared<bridge_domain_cmds::dump_cmd>();
198 for (
auto& record : *cmd) {
199 auto& payload = record.get_payload();
212 std::shared_ptr<interface> uu_fwd_itf =
220 << payload.uu_fwd_sw_if_index;
226 for (
unsigned int ii = 0; ii < payload.n_sw_ifs; ii++) {
227 std::shared_ptr<interface> itf =
234 << payload.sw_if_details[ii].sw_if_index;
247 bridge_domain::event_handler::handle_replay()
253 bridge_domain::event_handler::order()
const A Clas representing the binding of an L2 interface to a bridge-domain and the properties of that bind...
Bridge Domain MAC aging mode.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
static const arp_term_mode_t OFF
static const flood_mode_t OFF
static const learning_mode_t ON
static const arp_term_mode_t ON
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
static std::shared_ptr< bridge_domain > find(const key_t &key)
Static function to find the bridge_domain in the model.
static void dump(std::ostream &os)
Dump all bridge-doamin into the stream provided.
std::string to_string() const
convert to string format for debug purposes
static const flood_mode_t ON
T & data()
Return the data read/written.
rc_t rc() const
Get the HW return code.
static const learning_mode_t OFF
std::string to_string(void) const
convert to string format for debug purposes
enum_base(int value, const std::string desc)
Constructor of an enum - takes value and string description.
static const l2_port_type_t L2_PORT_TYPE_UU_FWD
static const mac_age_mode_t ON
uint32_t id() const
Return the bridge domain's VPP ID.
static const mac_age_mode_t OFF
Bridge Domain ARP termination mode.
const key_t & key() const
Return the bridge domain's key.
Bridge Domain Learning mode.
A base class for all object_base in the VPP object_base-Model.
bool operator==(const bridge_domain &b) const
Comparison operator - for UT.
Tables in which entries are added, e.g bridge/route-domains.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
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 ...
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
bridge_domain(uint32_t id, const learning_mode_t &lmode=learning_mode_t::ON, const arp_term_mode_t &amode=arp_term_mode_t::ON, const flood_mode_t &fmode=flood_mode_t::ON, const mac_age_mode_t &mmode=mac_age_mode_t::OFF)
Construct a new object matching the desried state.
uint32_t key_t
Key Type for Bridge Domains in the sigular DB.
static const log_level_t ERROR
std::shared_ptr< bridge_domain > singular() const
Return the matchin 'singular' instance of the bridge-domain.
Bridge Domain Learning mode.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
A command class that creates an Bridge-Domain.
const std::string & to_string() const
convert to string format for debug purposes
static bool register_listener(listener *listener)
Register a listener of events.
A cmd class that Delete an Bridge-Domain.
~bridge_domain()
Destructor.