const gbp_subnet::type_t gbp_subnet::type_t::STITCHED_EXTERNAL(
1,
"stitched-external");
-const gbp_subnet::type_t gbp_subnet::type_t::TRANSPORT(1, "transport");
+const gbp_subnet::type_t gbp_subnet::type_t::TRANSPORT(2, "transport");
+const gbp_subnet::type_t gbp_subnet::type_t::L3_OUT(3, "l3-out");
+const gbp_subnet::type_t gbp_subnet::type_t::ANON_L3_OUT(4, "anon-l3-out");
singular_db<gbp_subnet::key_t, gbp_subnet> gbp_subnet::m_db;
, m_type(type)
, m_recirc(nullptr)
, m_epg(nullptr)
+ , m_sclass(~0)
{
}
, m_type(type_t::STITCHED_EXTERNAL)
, m_recirc(recirc.singular())
, m_epg(epg.singular())
+ , m_sclass(~0)
+{
+}
+
+gbp_subnet::gbp_subnet(const gbp_route_domain& rd,
+ const route::prefix_t& prefix,
+ sclass_t sclass,
+ const type_t& type)
+ : m_hw(false)
+ , m_rd(rd.singular())
+ , m_prefix(prefix)
+ , m_type(type)
+ , m_recirc(nullptr)
+ , m_epg()
+ , m_sclass(sclass)
{
}
, m_type(o.m_type)
, m_recirc(o.m_recirc)
, m_epg(o.m_epg)
+ , m_sclass(o.m_sclass)
{
}
gbp_subnet::operator==(const gbp_subnet& gs) const
{
return ((key() == gs.key()) && (m_type == gs.m_type) &&
- (m_recirc == gs.m_recirc) && (m_epg == gs.m_epg));
+ (m_recirc == gs.m_recirc) && (m_epg == gs.m_epg) &&
+ (m_sclass == gs.m_sclass));
}
void
HW::enqueue(new gbp_subnet_cmds::create_cmd(
m_hw, m_rd->id(), m_prefix, m_type,
(m_recirc ? m_recirc->handle() : handle_t::INVALID),
- (m_epg ? m_epg->id() : ~0)));
+ (m_epg ? m_epg->sclass() : m_sclass)));
}
}
HW::enqueue(new gbp_subnet_cmds::create_cmd(
m_hw, m_rd->id(), m_prefix, m_type,
(m_recirc ? m_recirc->handle() : handle_t::INVALID),
- (m_epg ? m_epg->id() : ~0)));
+ (m_epg ? m_epg->sclass() : m_sclass)));
} else {
if (m_type != r.m_type) {
m_epg = r.m_epg;
HW::enqueue(new gbp_subnet_cmds::create_cmd(
m_hw, m_rd->id(), m_prefix, m_type,
(m_recirc ? m_recirc->handle() : handle_t::INVALID),
- (m_epg ? m_epg->id() : ~0)));
+ (m_epg ? m_epg->sclass() : m_sclass)));
}
}
}
VOM_LOG(log_level_t::DEBUG) << "read: " << gs.to_string();
break;
}
+ case GBP_API_SUBNET_L3_OUT: {
+ gbp_subnet gs(*rd, pfx, payload.subnet.sclass);
+ OM::commit(key, gs);
+ VOM_LOG(log_level_t::DEBUG) << "read: " << gs.to_string();
+ break;
+ }
+ case GBP_API_SUBNET_ANON_L3_OUT: {
+ gbp_subnet gs(*rd, pfx, payload.subnet.sclass, type_t::ANON_L3_OUT);
+ OM::commit(key, gs);
+ VOM_LOG(log_level_t::DEBUG) << "read: " << gs.to_string();
+ break;
+ }
case GBP_API_SUBNET_STITCHED_EXTERNAL: {
std::shared_ptr<interface> itf =
interface::find(payload.subnet.sw_if_index);
std::shared_ptr<gbp_endpoint_group> epg =
- gbp_endpoint_group::find(payload.subnet.epg_id);
+ gbp_endpoint_group::find(payload.subnet.sclass);
if (itf && epg) {
std::shared_ptr<gbp_recirc> recirc = gbp_recirc::find(itf->key());