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)
47 bridge_domain::uu_flood_mode_t::uu_flood_mode_t(
int v,
const std::string& s)
48 :
enum_base<bridge_domain::uu_flood_mode_t>(v, s)
56 bridge_domain::mac_age_mode_t::mac_age_mode_t(
int v,
const std::string& s)
57 :
enum_base<bridge_domain::mac_age_mode_t>(v, s)
66 bridge_domain::arp_term_mode_t::arp_term_mode_t(
int v,
const std::string& s)
67 :
enum_base<bridge_domain::arp_term_mode_t>(v, s)
76 bridge_domain::arp_ufwd_mode_t::arp_ufwd_mode_t(
int v,
const std::string& s)
77 :
enum_base<bridge_domain::arp_ufwd_mode_t>(v, s)
84 singular_db<uint32_t, bridge_domain> bridge_domain::m_db;
99 , m_learning_mode(lmode)
100 , m_arp_term_mode(amode)
101 , m_arp_ufwd_mode(aumode)
102 , m_flood_mode(fmode)
103 , m_uu_flood_mode(uufmode)
104 , m_mac_age_mode(mmode)
110 , m_learning_mode(o.m_learning_mode)
111 , m_arp_term_mode(o.m_arp_term_mode)
112 , m_arp_ufwd_mode(o.m_arp_ufwd_mode)
113 , m_flood_mode(o.m_flood_mode)
114 , m_uu_flood_mode(o.m_uu_flood_mode)
115 , m_mac_age_mode(o.m_mac_age_mode)
122 return (m_id.
data());
128 return (m_id.
data());
134 return ((m_learning_mode == b.m_learning_mode) &&
135 (m_flood_mode == b.m_flood_mode) &&
136 (m_uu_flood_mode == b.m_uu_flood_mode) &&
137 (m_mac_age_mode == b.m_mac_age_mode) &&
138 (m_arp_term_mode == b.m_arp_term_mode) &&
139 (m_arp_ufwd_mode == b.m_arp_ufwd_mode) &&
id() == b.
id());
143 bridge_domain::sweep()
152 bridge_domain::replay()
156 m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
157 m_uu_flood_mode, m_mac_age_mode));
166 m_db.release(m_id.
data(),
this);
172 std::ostringstream s;
173 s <<
"bridge-domain:[" << m_id.
to_string()
174 <<
" learning-mode:" << m_learning_mode.
to_string() <<
"]";
179 std::shared_ptr<bridge_domain>
182 return (m_db.find(key));
193 m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
194 m_uu_flood_mode, m_mac_age_mode));
198 std::shared_ptr<bridge_domain>
201 return (m_db.find_or_add(temp.m_id.
data(), temp));
204 std::shared_ptr<bridge_domain>
207 return find_or_add(*
this);
222 std::shared_ptr<bridge_domain_cmds::dump_cmd>
cmd =
223 std::make_shared<bridge_domain_cmds::dump_cmd>();
228 for (
auto& record : *cmd) {
229 auto& payload = record.get_payload();
249 std::shared_ptr<interface> uu_fwd_itf =
257 << payload.uu_fwd_sw_if_index;
263 for (
unsigned int ii = 0; ii < payload.n_sw_ifs; ii++) {
264 std::shared_ptr<interface> itf =
271 << payload.sw_if_details[ii].sw_if_index;
284 bridge_domain::event_handler::handle_replay()
290 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.
std::shared_ptr< bridge_domain > singular() const
Return the matchin 'singular' instance of the bridge-domain.
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.
rc_t rc() const
Get the HW return code.
static const uu_flood_mode_t OFF
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.
static const flood_mode_t ON
T & data()
Return the data read/written.
std::string to_string() const
convert to string format for debug purposes
Bridge Domain Unknown Unicast Flood mode.
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 arp_ufwd_mode_t &aumode=arp_ufwd_mode_t::OFF, const flood_mode_t &fmode=flood_mode_t::ON, const uu_flood_mode_t &uufmode=uu_flood_mode_t::ON, const mac_age_mode_t &mmode=mac_age_mode_t::OFF)
Construct a new object matching the desried state.
static const learning_mode_t OFF
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
std::string to_string(void) const
convert to string format for debug purposes
const key_t & key() const
Return the bridge domain's key.
static const mac_age_mode_t OFF
Bridge Domain ARP termination mode.
Bridge Domain Learning mode.
A base class for all object_base in the VPP object_base-Model.
const std::string & to_string() const
convert to string format for debug purposes
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.
uint32_t key_t
Key Type for Bridge Domains in the sigular DB.
Bridge Domain ARP Unicast Forward mode.
static const log_level_t ERROR
bool operator==(const bridge_domain &b) const
Comparison operator - for UT.
static const arp_ufwd_mode_t OFF
Bridge Domain flood mode.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
uint32_t id() const
Return the bridge domain's VPP ID.
A command class that creates an Bridge-Domain.
static const uu_flood_mode_t ON
static bool register_listener(listener *listener)
Register a listener of events.
A cmd class that Delete an Bridge-Domain.
static const arp_ufwd_mode_t ON
~bridge_domain()
Destructor.