namespace VOM {
+const gbp_bridge_domain::flags_t gbp_bridge_domain::flags_t::NONE(0, "none");
+const gbp_bridge_domain::flags_t gbp_bridge_domain::flags_t::DO_NOT_LEARN(
+ 0,
+ "do-not-learn");
+
+gbp_bridge_domain::flags_t::flags_t(int v, const std::string& s)
+ : enum_base<gbp_bridge_domain::flags_t>(v, s)
+{
+}
+
/**
* A DB of al the interfaces, key on the name
*/
* Construct a new object matching the desried state
*/
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
- const interface& bvi)
+ const interface& bvi,
+ const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
+ , m_flags(flags)
{
}
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
- const interface& uu_fwd)
+ const interface& uu_fwd,
+ const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
, m_uu_fwd(uu_fwd.singular())
+ , m_flags(flags)
{
}
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const std::shared_ptr<interface> bvi,
- const std::shared_ptr<interface> uu_fwd)
+ const std::shared_ptr<interface> uu_fwd,
+ const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi->singular())
, m_uu_fwd(uu_fwd->singular())
+ , m_flags(flags)
{
}
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
- const std::shared_ptr<interface> uu_fwd)
+ const std::shared_ptr<interface> uu_fwd,
+ const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
, m_uu_fwd(uu_fwd->singular())
+ , m_flags(flags)
{
}
, m_bd(bd.m_bd)
, m_bvi(bd.m_bvi)
, m_uu_fwd(bd.m_uu_fwd)
+ , m_flags(bd.m_flags)
{
}
}
const std::shared_ptr<bridge_domain>
-gbp_bridge_domain::get_bridge_domain()
+gbp_bridge_domain::get_bridge_domain() const
{
return m_bd;
}
const std::shared_ptr<interface>
-gbp_bridge_domain::get_bvi()
+gbp_bridge_domain::get_bvi() const
{
return m_bvi;
}
if (rc_t::OK == m_id.rc()) {
HW::enqueue(new gbp_bridge_domain_cmds::create_cmd(
m_id, (m_bvi ? m_bvi->handle() : handle_t::INVALID),
- (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID)));
+ (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID), m_flags));
}
}
if (rc_t::OK != m_id.rc()) {
HW::enqueue(new gbp_bridge_domain_cmds::create_cmd(
m_id, (m_bvi ? m_bvi->handle() : handle_t::INVALID),
- (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID)));
+ (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID), m_flags));
}
}
*/
typedef bridge_domain::key_t key_t;
+ struct flags_t : enum_base<flags_t>
+ {
+ const static flags_t NONE;
+ const static flags_t DO_NOT_LEARN;
+
+ static const flags_t& from_vpp(int i);
+
+ private:
+ flags_t(int v, const std::string& s);
+ flags_t();
+ };
+
/**
* Construct a GBP bridge_domain
*/
- gbp_bridge_domain(const bridge_domain& bd, const interface& bvi);
gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
- const interface& uu_fwd);
+ const flags_t& flags = flags_t::NONE);
+ gbp_bridge_domain(const bridge_domain& bd,
+ const interface& bvi,
+ const interface& uu_fwd,
+ const flags_t& flags = flags_t::NONE);
gbp_bridge_domain(const bridge_domain& bd,
const std::shared_ptr<interface> bvi,
- const std::shared_ptr<interface> uu_fwd);
+ const std::shared_ptr<interface> uu_fwd,
+ const flags_t& flags = flags_t::NONE);
gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
- const std::shared_ptr<interface> uu_fwd);
+ const std::shared_ptr<interface> uu_fwd,
+ const flags_t& flags = flags_t::NONE);
/**
* Copy Construct
*/
std::string to_string() const;
- const std::shared_ptr<bridge_domain> get_bridge_domain();
- const std::shared_ptr<interface> get_bvi();
+ const std::shared_ptr<bridge_domain> get_bridge_domain() const;
+ const std::shared_ptr<interface> get_bvi() const;
private:
/**
std::shared_ptr<bridge_domain> m_bd;
std::shared_ptr<interface> m_bvi;
std::shared_ptr<interface> m_uu_fwd;
+ const flags_t& m_flags;
/**
* A map of all bridge_domains
create_cmd::create_cmd(HW::item<uint32_t>& item,
const handle_t bvi,
- const handle_t uu_fwd)
+ const handle_t uu_fwd,
+ const gbp_bridge_domain::flags_t& flags)
: rpc_cmd(item)
, m_bvi(bvi)
, m_uu_fwd(uu_fwd)
+ , m_flags(flags)
{
}
create_cmd::operator==(const create_cmd& other) const
{
return ((m_hw_item.data() == other.m_hw_item.data()) &&
- (m_bvi == other.m_bvi) && (m_uu_fwd == other.m_uu_fwd));
+ (m_bvi == other.m_bvi) && (m_uu_fwd == other.m_uu_fwd) &&
+ (m_flags == other.m_flags));
}
rc_t
payload.bd.bvi_sw_if_index = m_bvi.value();
payload.bd.uu_fwd_sw_if_index = m_uu_fwd.value();
+ payload.bd.flags = GBP_BD_API_FLAG_NONE;
+ if (gbp_bridge_domain::flags_t::DO_NOT_LEARN == m_flags)
+ payload.bd.flags = GBP_BD_API_FLAG_DO_NOT_LEARN;
+
VAPI_CALL(req.execute());
return (wait());
*/
create_cmd(HW::item<uint32_t>& item,
const handle_t bvi,
- const handle_t uu_fwd);
+ const handle_t uu_fwd,
+ const gbp_bridge_domain::flags_t& flags);
/**
* Issue the command to VPP/HW
private:
const handle_t m_bvi;
const handle_t m_uu_fwd;
+ const gbp_bridge_domain::flags_t& m_flags;
};
/**
}
const std::shared_ptr<gbp_route_domain>
-gbp_endpoint_group::get_route_domain()
+gbp_endpoint_group::get_route_domain() const
{
return m_rd;
}
const std::shared_ptr<gbp_bridge_domain>
-gbp_endpoint_group::get_bridge_domain()
+gbp_endpoint_group::get_bridge_domain() const
{
return m_bd;
}
*/
epg_id_t id() const;
- const std::shared_ptr<gbp_route_domain> get_route_domain();
- const std::shared_ptr<gbp_bridge_domain> get_bridge_domain();
+ const std::shared_ptr<gbp_route_domain> get_route_domain() const;
+ const std::shared_ptr<gbp_bridge_domain> get_bridge_domain() const;
private:
/**
}
const std::shared_ptr<route_domain>
-gbp_route_domain::get_route_domain()
+gbp_route_domain::get_route_domain() const
{
return m_rd;
}
*/
std::string to_string() const;
- const std::shared_ptr<route_domain> get_route_domain();
+ const std::shared_ptr<route_domain> get_route_domain() const;
private:
/**