5 #ifndef vnsw_agent_nexthop_hpp
6 #define vnsw_agent_nexthop_hpp
8 #include <netinet/in.h>
9 #include <net/ethernet.h>
12 #include <agent_types.h>
21 template <
typename Member>
32 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
39 typedef typename std::vector<Member *>::iterator
iterator;
52 Member *entry =
new Member(mbr);
59 bool remove(
const Member &mbr) {
77 bool remove(uint32_t index) {
92 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
121 typename std::vector<Member>::const_iterator it = list.begin();
122 while (it != list.end()) {
132 while (mbr_list_iterator !=
end()) {
133 const Member *member = *mbr_list_iterator;
139 while (it != list.end()) {
140 const Member *latest_member = &(*it);
141 if (latest_member && *latest_member == *member) {
146 if (it == list.end()) {
155 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
178 Member*
Find(
const Member &mem)
const {
179 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
187 Member*
Find(
const Member &mem, uint32_t &index)
const{
188 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
197 const Member*
Get(uint32_t idx)
const {
206 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
217 for (uint32_t i = 0; i <
mbr_list_.size(); i++) {
279 std::ostringstream tunnel_type;
281 tunnel_type <<
"MPLSoGRE ";
285 tunnel_type <<
"MPLSoUDP ";
288 if (type & ( 1 <<
VXLAN)) {
289 tunnel_type <<
"VxLAN";
292 if (type & (1 <<
NATIVE)) {
293 tunnel_type <<
"Underlay";
297 tunnel_type <<
"MPLSoMPLS";
300 return tunnel_type.str();
368 virtual std::string
ToString()
const {
return "NH";}
377 virtual bool CanAdd()
const = 0;
430 NextHopObjectLogInfo &info);
432 NextHopObjectLogInfo &info);
445 NextHopObjectLogInfo &info)
const;
551 virtual std::string
ToString()
const {
return "DISCARD"; };
557 virtual bool CanAdd()
const;
605 virtual std::string
ToString()
const {
return "L2-Receive"; };
611 virtual bool CanAdd()
const;
663 virtual std::string
ToString()
const {
return "Local Receive"; };
669 virtual bool CanAdd()
const;
681 static void CreateReq(
const string &interface);
734 virtual std::string
ToString()
const {
return "Resolve"; };
739 virtual bool CanAdd()
const;
745 boost::scoped_ptr<InterfaceKey> intf_key(
746 static_cast<InterfaceKey *>(
interface_->GetDBRequestKey().release()));
834 virtual bool CanAdd()
const;
839 const uint32_t
vrf_id()
const;
848 const ArpNH *arp_nh =
dynamic_cast<const ArpNH *
>(nh);
923 virtual bool CanAdd()
const;
928 const uint32_t
vrf_id()
const;
937 const NdpNH *ndp_nh =
dynamic_cast<const NdpNH *
>(nh);
1036 uint32_t label = 3) :
1143 virtual bool CanAdd()
const;
1145 const uint32_t
vrf_id()
const;
1156 const PBBNH *pbb_nh =
dynamic_cast<const PBBNH *
>(nh);
1255 bool layer2_control_word):
1281 return "InterfaceNH : " +
interface_->name();
1288 virtual bool CanAdd()
const;
1306 const string &vrf_name,
1307 const string &intf_name);
1310 const std::string &intf_name);
1313 const string &vrf_name,
1317 const std::string &intf_name);
1320 const std::string &intf_name);
1323 const string &vrf_name,
1325 const std::string &intf_name);
1328 const std::string &intf_name);
1330 bool policy, uint8_t
flags,
1331 const MacAddress &mac,
const std::string &intf_name);
1334 const string &vrf_name,
1378 VrfNHKey(
const string &vrf_name,
bool policy,
bool bridge_nh) :
1413 VrfNHData(
bool flood_unknown_unicast,
bool learning_enabled,
1414 bool layer2_control_word):
1429 NextHop(
VRF, true, policy),
vrf_(vrf, this), bridge_nh_(bridge_nh_),
1433 virtual std::string
ToString()
const {
return "VrfNH"; };
1442 virtual bool CanAdd()
const;
1454 const VrfNH *vrf_nh =
dynamic_cast<const VrfNH *
>(nh);
1455 if (vrf_nh &&
vrf_ == vrf_nh->
vrf_) {
1541 virtual bool CanAdd()
const;
1552 const std::string &vrf_name,
const MacAddress &smac,
1556 const std::string &vrf_name,
const MacAddress &smac,
1561 const VlanNH *vlan_nh =
dynamic_cast<const VlanNH *
>(nh);
1600 #define COMPOSITETYPE Composite::Type
1620 return nh_->ToString();
1648 const ComponentNHKeyList &component_nh_list,
1649 const std::string &vrf_name);
1655 false, flags, mac)) {
1688 const std::string &vrf_name) :
1698 const std::string &vrf_name) :
1711 ComponentNHKeyList::const_iterator
begin()
const {
1715 ComponentNHKeyList::const_iterator
end()
const {
1733 void insert(ComponentNHKeyPtr nh_key);
1734 void erase(ComponentNHKeyPtr nh_key);
1735 bool find(ComponentNHKeyPtr nh_key);
1797 virtual std::string
ToString()
const {
return "Composite NH"; };
1803 virtual bool CanAdd()
const;
1807 ComponentNHList::const_iterator
begin()
const {
1811 ComponentNHList::const_iterator
end()
const {
1820 uint32_t active_count = 0;
1827 return active_count;
1830 uint32_t
PickMember(uint32_t seed, uint32_t affinity_index,
1831 bool ingress)
const;
1863 bool &comp_nh_policy)
const;
1866 bool &comp_nh_new_policy)
const;
1878 uint32_t
hash(uint32_t seed,
bool ingress)
const {
1883 uint32_t idx = seed % size;
1887 (ingress ==
false &&
1889 idx = (idx + 1) % size;
1890 if (idx == seed % size) {
1956 const std::string &context);
1993 #endif // vnsw_agent_nexthop_hpp
uint32_t PickMember(uint32_t seed, uint32_t affinity_index, bool ingress) const
virtual std::string ToString() const
static PriorityList priority_list_
virtual std::string ToString() const
const ComponentNH * Get(uint32_t idx) const
static void FillObjectLogMac(const unsigned char *m, NextHopObjectLogInfo &info)
const NextHop * nh() const
const Interface * GetInterface() const
virtual bool ChangeEntry(const DBRequest *req)
virtual void SetKey(const DBRequestKey *key)
ArpNH(VrfEntry *vrf, const Ip4Address &ip)
virtual std::string ToString() const
bool IsEqual(const NextHopKey &rhs) const
virtual bool MatchEgressData(const NextHop *nh) const
const bool & GetBridgeNh() const
Interface * FindInterface(const InterfaceKey &key) const
virtual KeyPtr GetDBRequestKey() const
void ReplaceLocalNexthop(const ComponentNHKeyList &new_comp_nh)
bool GetOldNH(const CompositeNHData *data, ComponentNH &)
virtual bool NextHopIsLess(const DBEntry &rhs) const
NdpNH(VrfEntry *vrf, const IpAddress &ip)
DISALLOW_COPY_AND_ASSIGN(ReceiveNH)
const Interface * GetFirstLocalEcmpMemberInterface() const
virtual void SetKey(const DBRequestKey *key)
static void CreateReq(const boost::uuids::uuid &intf_uuid, uint16_t vlan_tag, const std::string &vrf_name, const MacAddress &smac, const MacAddress &dmac)
NextHopTable(DB *db, const std::string &name)
void UpdateEcmpHashFieldsUponRouteDelete(Agent *agent, const string &vrf_name)
virtual KeyPtr GetDBRequestKey() const
ComponentNHKeyList component_nh_key_list_
const VrfEntry * GetVrf() const
virtual bool MatchEgressData(const NextHop *nh) const
DISALLOW_COPY_AND_ASSIGN(VrfNH)
VlanNHKey(InterfaceKey *key, uint16_t vlan_tag)
virtual bool ChangeEntry(const DBRequest *req)
CompositeNHKey(COMPOSITETYPE type, bool policy, const ComponentNHKeyList &component_nh_key_list, const std::string &vrf_name)
const Ip4Address & dip() const
void AllocateEcmpFields()
virtual void Delete(const DBRequest *req)
DISALLOW_COPY_AND_ASSIGN(ComponentNH)
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
virtual bool NeedMplsLabel()
ComponentNH(uint32_t label, const NextHop *nh)
void set_flags(uint8_t flags)
static void CreateReq(const InterfaceKey *intf, bool policy)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
const MacAddress & GetSMac() const
uint32_t GetRefCount() const
static Type default_type_
bool learning_enabled() const
NextHop * FindNextHop(size_t index)
const uint32_t vrf_id() const
static const uint32_t kInvalidComponentNHIdx
const VrfEntry * GetVrf() const
bool layer2_control_word_
virtual bool MatchEgressData(const NextHop *nh) const
COMPOSITETYPE composite_nh_type_
virtual bool ChangeEntry(const DBRequest *req)
virtual bool CanAdd() const
virtual void Add(Agent *agent, const DBRequest *req)
DISALLOW_COPY_AND_ASSIGN(VlanNHData)
static void DeleteReq(const boost::uuids::uuid &intf_uuid, uint16_t vlan_tag)
virtual bool MatchEgressData(const NextHop *nh) const =0
virtual bool DeleteOnZeroRefCount() const
CompositeNHData(const ComponentNHKeyList &component_nh_key_list)
void set_id(uint32_t index)
virtual bool ChangeEntry(const DBRequest *req)
static std::string GetString(uint32_t type)
NextHop * l2_receive_nh() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
InterfaceNH(Interface *intf, bool policy, const MacAddress &mac)
virtual bool NextHopIsLess(const DBEntry &rhs) const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
MplsLabel * AllocateLabel(Agent *agent, const NextHopKey *key)
virtual bool CanAdd() const
DISALLOW_COPY_AND_ASSIGN(ArpNH)
const VrfEntry * GetVrf() const
DISALLOW_COPY_AND_ASSIGN(NextHopData)
const MacAddress & GetMac() const
static TypeBmap MPLSType()
virtual bool NextHopIsLess(const DBEntry &rhs) const
virtual KeyPtr GetDBRequestKey() const
void SetType(TunnelType::Type type)
uint8_t HashFieldsToUse() const
virtual bool CanAdd() const
DISALLOW_COPY_AND_ASSIGN(InterfaceNH)
void EnqueueResync() const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
virtual NextHopKey * Clone() const
virtual bool Delete(DBEntry *entry, const DBRequest *req)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual void SetKey(const DBRequestKey *key)
DISALLOW_COPY_AND_ASSIGN(PBBNH)
bool layer2_control_word_
const MacAddress & GetDMac() const
bool GetResolveState() const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
void CreateTunnelNHReq(Agent *agent)
const Interface * GetInterface() const
DISALLOW_COPY_AND_ASSIGN(VlanNH)
bool validate_mcast_src() const
const IpAddress * GetIp() const
virtual bool MatchEgressData(const NextHop *nh) const
bool flood_unknown_unicast_
const boost::uuids::uuid & GetIfUuid() const
static DBTableBase * CreateTable(DB *db, const std::string &name)
bool NextHopIsLess(const DBEntry &rhs) const
DISALLOW_COPY_AND_ASSIGN(LabelledTunnelNHData)
boost::asio::ip::address IpAddress
virtual NextHop * AllocEntry() const
virtual NextHop * AllocEntry() const
boost::scoped_ptr< const InterfaceKey > intf_key_
VlanNHData(const string vrf_name, const MacAddress &smac, const MacAddress &dmac)
DISALLOW_COPY_AND_ASSIGN(LabelledTunnelNHKey)
ArpNHData(const MacAddress &mac, InterfaceKey *intf_key, bool resolved)
void set_etree_leaf(bool val)
const VrfEntry * GetVrf() const
bool layer2_control_word() const
uint32_t transport_mpls_label_
virtual bool NextHopIsLess(const DBEntry &rhs) const
virtual void SetKey(const DBRequestKey *key)
const MacAddress & GetMac() const
bool IsVxlanRouting() const
DISALLOW_COPY_AND_ASSIGN(PBBNHData)
DISALLOW_COPY_AND_ASSIGN(L2ReceiveNH)
virtual void SetKey(const DBRequestKey *key)
virtual void SetKey(const DBRequestKey *key)
DISALLOW_COPY_AND_ASSIGN(NextHopKey)
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
int insert(const Member &mbr)
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
void CreateComponentNH(Agent *agent, TunnelType::Type type) const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
const boost::uuids::uuid & GetUuid() const
virtual bool DeleteOnZeroRefCount() const
DISALLOW_COPY_AND_ASSIGN(NdpNHData)
uint32_t GetRefCount() const
virtual bool MatchEgressData(const NextHop *nh) const
virtual bool NextHopIsLess(const DBEntry &rhs) const
virtual bool NeedMplsLabel()
virtual void Delete(const DBRequest *req)
const NextHop * GetLocalNextHop() const
virtual void SetKey(const DBRequestKey *key)
virtual bool CanAdd() const
virtual bool ChangeEntry(const DBRequest *req)
virtual bool NeedMplsLabel()
virtual ~L2ReceiveNHData()
TunnelNHKey(const string &vrf_name, const Ip4Address &sip, const Ip4Address &dip, bool policy, TunnelType type, const MacAddress &rewrite_dmac=MacAddress())
static TypeBmap MplsType()
static void DeleteMulticastVmInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, const std::string &intf_name)
InterfaceNHKey(InterfaceKey *intf, bool policy, uint8_t flags, const MacAddress &mac)
bool layer2_control_word() const
virtual bool NextHopIsLess(const DBEntry &rhs) const
static VlanNH * Find(const boost::uuids::uuid &intf_uuid, uint16_t vlan_tag)
virtual DBEntry * Add(const DBRequest *req)
virtual ~InterfaceNHData()
uint32_t hash(size_t hash) const
boost::shared_ptr< const ComponentNHKey > ComponentNHKeyPtr
virtual void Delete(const DBRequest *req)
static void CreateInetInterfaceNextHop(const string &ifname, const string &vrf_name, const MacAddress &mac)
bool NexthopToInterfacePolicy() const
void insert(ComponentNHKeyPtr nh_key)
CompositeNH(COMPOSITETYPE type, bool policy, const ComponentNHKeyList &component_nh_key_list, VrfEntry *vrf)
std::vector< Member * > mbr_list_
DISALLOW_COPY_AND_ASSIGN(ResolveNH)
uint16_t GetVlanTag() const
virtual ~CompositeNHKey()
virtual void Delete(const DBRequest *req)
const Member * Get(uint32_t idx) const
uint8_t EcmpHashFieldInUse() const
size_t HashTableSize() const
virtual std::string ToString() const
virtual NextHopKey * Clone() const
virtual KeyPtr GetDBRequestKey() const
virtual NextHop * AllocEntry() const
std::unique_ptr< DBRequestKey > KeyPtr
const_iterator end() const
virtual bool DeleteOnZeroRefCount() const
void SetNHSandeshData(NhSandeshData &data) const
const VrfEntry * vrf() const
virtual KeyPtr GetDBRequestKey() const
virtual NextHopKey * Clone() const
virtual bool CanAdd() const
const std::string & name() const
ArpNHKey(const string &vrf_name, const Ip4Address &ip, bool policy)
virtual CompositeNHKey * Clone() const
virtual NextHop * AllocEntry() const
const uint32_t vrf_id() const
bool layer2_control_word_
Member * Find(const Member &mem, uint32_t &index) const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
static Type DefaultMplsComputeType()
static const uint32_t kInvalidIndex
std::vector< ComponentNHKeyPtr > ComponentNHKeyList
virtual bool OnChange(DBEntry *entry, const DBRequest *req)
void set_discard_nh(NextHop *nh)
DISALLOW_COPY_AND_ASSIGN(CompositeNHKey)
std::string ToString() const
virtual bool NeedMplsLabel()=0
static bool EncapPrioritySync(const std::vector< std::string > &cfg_list)
static NextHopTable * nexthop_table_
static TypeBmap MplsoMplsType()
void AddWithoutAlloc(DBEntry *entry)
const Ip4Address * GetIp() const
const Interface * GetInterface() const
virtual bool ChangeEntry(const DBRequest *req)
ComponentNHKey(int label, std::unique_ptr< const NextHopKey > key)
virtual KeyPtr GetDBRequestKey() const
virtual std::string ToString()
InterfaceNH(Interface *intf, bool policy, uint8_t flags, const MacAddress &mac)
NextHop::Type GetType() const
void Remove(size_t index)
virtual bool DeleteOnZeroRefCount() const
static NextHopTable * GetInstance()
const std::string & name() const
boost::scoped_ptr< InterfaceKey > intf_key_
virtual bool CanAdd() const
virtual std::string ToString() const
ComponentNHKeyList component_nh_key_list_
virtual bool NeedMplsLabel()
virtual NextHop * AllocEntry() const =0
virtual std::string ToString() const
const boost::uuids::uuid & GetUuid() const
DISALLOW_COPY_AND_ASSIGN(NdpNHKey)
virtual void SetKey(const DBRequestKey *key)
virtual KeyPtr GetDBRequestKey() const
const boost::uuids::uuid & GetIfUuid() const
static const uint32_t kRpfDiscardIndex
bool validate_mcast_src() const
PBBNHKey(const string &vrf_name, const MacAddress &dest_bmac, uint32_t isid)
boost::scoped_ptr< InterfaceKey > intf_key_
ComponentNHKeyList::const_iterator end() const
const InterfaceKey * intf_key() const
std::list< Type > PriorityList
virtual bool ChangeEntry(const DBRequest *req)
virtual size_t Hash(const DBRequestKey *key) const
static void CreateReq(const string &interface)
VlanNHKey(const boost::uuids::uuid &vm_port_uuid, uint16_t vlan_tag)
virtual KeyPtr GetDBRequestKey() const
static void DeletePriorityList()
NextHopKey(NextHop::Type type, bool policy)
void set_validate_mcast_src(bool validate_mcast_src)
boost::intrusive_ptr< MplsLabel > MplsLabelRef
virtual KeyPtr GetDBRequestKey() const
virtual bool ChangeEntry(const DBRequest *req)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
static void CreateMulticastVmInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, const string &vrf_name, const string &intf_name)
DISALLOW_COPY_AND_ASSIGN(ResolveNHKey)
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
virtual bool NextHopIsLess(const DBEntry &rhs) const
static void Create(NextHopTable *table, const Interface *intf, bool policy)
virtual bool NextHopIsLess(const DBEntry &rhs) const
virtual ~LabelledTunnelNHData()
virtual NextHop * AllocEntry() const
const NextHop * child_nh() const
static const uint32_t kRpfDisableIndex
virtual bool ChangeEntry(const DBRequest *req)
void set_l2_receive_nh(NextHop *nh)
const_iterator begin() const
NextHop * AllocWithKey(const DBRequestKey *k) const
virtual bool NeedMplsLabel()
virtual void Delete(const DBRequest *req)
DISALLOW_COPY_AND_ASSIGN(ArpNHData)
virtual NextHop * AllocEntry() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
DISALLOW_COPY_AND_ASSIGN(ReceiveNHKey)
virtual bool MatchEgressData(const NextHop *nh) const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual KeyPtr GetDBRequestKey() const
void set_learning_flag(bool val)
std::string ToString() const
virtual bool DeleteOnZeroRefCount() const
virtual bool NeedMplsLabel()
virtual bool MatchEgressData(const NextHop *nh) const
static void FillObjectLogIntf(const Interface *intf, NextHopObjectLogInfo &info)
void RemoveWithoutDelete(DBEntry *entry)
bool IsEqual(const VrfKey &rhs) const
virtual bool CanAdd() const
void replace(std::vector< Member > list)
bool IsLess(const NextHopKey &rhs) const
void ChangeComponentNHKeyTunnelType(ComponentNHKeyList &component_nh_list, TunnelType::Type type) const
DISALLOW_COPY_AND_ASSIGN(ComponentNHKey)
virtual NextHop * AllocEntry() const
static TypeBmap AllType()
virtual void SetKey(const DBRequestKey *key)
virtual bool NextHopIsLess(const DBEntry &rhs) const
InterfaceNHData(const string vrf_name)
const uint32_t isid() const
EcmpHashFields & CompEcmpHashFields()
boost::intrusive_ptr< const Interface > InterfaceConstRef
ComponentNHKeyList DeleteComponentNHKey(ComponentNHKeyPtr component_nh_key, bool &comp_nh_new_policy) const
const Interface * GetInterface() const
virtual void Delete(const DBRequest *req)
virtual bool CanAdd() const
static void Create(const InterfaceKey *intf, bool policy)
DISALLOW_COPY_AND_ASSIGN(PBBNHKey)
const ComponentNHList & component_nh_list() const
bool UpdateComponentNHKey(uint32_t label, NextHopKey *nh_key, ComponentNHKeyList &component_nh_key_list, bool &comp_nh_policy) const
virtual NextHop * AllocEntry() const
virtual bool NeedMplsLabel()
DISALLOW_COPY_AND_ASSIGN(InterfaceNHData)
DISALLOW_COPY_AND_ASSIGN(ReceiveNHData)
ReceiveNH(Interface *intf, bool policy)
NdpNHData(InterfaceKey *intf_key)
NextHop * discard_nh() const
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
virtual NextHopKey * Clone() const
virtual bool NextHopIsLess(const DBEntry &rhs) const =0
virtual NextHopKey * Clone() const
const std::string & name() const
virtual std::string ToString() const
ComponentNH(uint32_t label, NextHop *nh)
const std::string & GetVrfName() const
bool operator==(const ComponentNHKey &rhs) const
COMPOSITETYPE composite_nh_type() const
COMPOSITETYPE composite_nh_type() const
virtual NextHopKey * Clone() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual NextHop * AllocEntry() const
virtual bool Resync(DBEntry *entry, const DBRequest *req)
bool HasVmInterface(const VmInterface *vmi) const
DISALLOW_COPY_AND_ASSIGN(VlanNHKey)
virtual void OnZeroRefCount()
DISALLOW_COPY_AND_ASSIGN(TunnelNHKey)
InterfaceNHData(const string vrf_name, bool learning_enabled, bool etree_leaf, bool layer2_control_word)
CompositeNHData(bool pbb_nh, bool learning_enabled, bool layer2_control_word)
virtual void SetKey(const DBRequestKey *key)
virtual bool ChangeEntry(const DBRequest *req)
EcmpHashFields comp_ecmp_hash_fields_
ComponentNHList component_nh_list_
Member * Find(const Member &mem) const
bool Compare(const TunnelType &rhs) const
static TypeBmap NativeType()
static Type ComputeType(TypeBmap bmap)
void CreateTunnelNH(Agent *agent)
static TypeBmap UDPType()
virtual void Change(const DBRequest *req)
boost::asio::ip::address_v4 Ip4Address
virtual NextHopKey * Clone() const
VlanNH(Interface *intf, uint32_t vlan_tag)
DISALLOW_COPY_AND_ASSIGN(VrfNHData)
virtual bool ChangeEntry(const DBRequest *req)=0
virtual bool MatchEgressData(const NextHop *nh) const
bool flood_unknown_unicast_
static void DeleteNH(const boost::uuids::uuid &intf_uuid, bool policy, uint8_t flags, const MacAddress &mac, const std::string &intf_name)
DISALLOW_COPY_AND_ASSIGN(L2ReceiveNHKey)
ComponentNHList::const_iterator begin() const
boost::scoped_ptr< InterfaceKey > intf_key_
VrfNHData(bool flood_unknown_unicast, bool learning_enabled, bool layer2_control_word)
const MacAddress dest_bmac() const
virtual std::unique_ptr< DBEntry > GetEntry(const DBRequestKey *key) const
virtual void Delete(const DBRequest *req)
ArpNHData(InterfaceKey *intf_key)
std::unique_ptr< const NextHopKey > nh_key_
virtual bool CanAdd() const
static void DeleteL2InterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &mac, const std::string &intf_name)
virtual NextHop * AllocEntry() const
VrfNH(VrfEntry *vrf, bool policy, bool bridge_nh_)
void set_tunnel_type(TunnelType tunnel_type)
virtual ~L2ReceiveNHKey()
bool layer2_control_word_
virtual bool MatchEgressData(const NextHop *nh) const
bool ExpandLocalCompositeNH(Agent *agent)
PBBNH(VrfEntry *vrf, const MacAddress &dmac, uint32_t isid)
ResolveNH(const Interface *intf, bool policy)
uint32_t hash(uint32_t seed, bool ingress) const
virtual NextHop * AllocEntry() const
virtual NextHop * AllocEntry() const
static void DeletePhysicalInterfaceNh(const string &ifname, const MacAddress &mac)
virtual bool NextHopIsLess(const DBEntry &rhs) const
ResolveNHKey(const InterfaceKey *intf_key, bool policy)
const MacAddress & GetDMac() const
DISALLOW_COPY_AND_ASSIGN(DiscardNHKey)
virtual void SetKey(const DBRequestKey *key)
bool IsLess(const VrfKey &rhs) const
static void CreatePacketInterfaceNh(Agent *agent, const string &ifname)
static void CreatePhysicalInterfaceNh(const string &ifname, const MacAddress &mac)
bool IsLess(const TunnelType &rhs) const
virtual NextHopKey * Clone() const
static TypeBmap GREType()
virtual bool CanAdd() const
virtual NextHopKey * Clone() const
static void DeleteInetInterfaceNextHop(const string &ifname, const MacAddress &mac)
IndexVector< NextHop * > index_table_
const VrfEntry * GetVrf() const
void UpdateFreeIndex(uint32_t index)
void Process(DBRequest &req)
boost::intrusive_ptr< const NextHop > NextHopConstRef
bool layer2_control_word_
ComponentNHKeyList::const_iterator begin() const
std::vector< Member * >::iterator iterator
ComponentNHKeyList AddComponentNHKey(ComponentNHKeyPtr component_nh_key, bool &comp_nh_policy) const
virtual void Delete(const DBRequest *req)
static void CreateL2VmInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, const string &vrf_name, bool learning_enabled, bool etree_leaf, bool layer2_control_word, const std::string &intf_name)
size_t ComponentNHCount() const
NextHop(Type type, bool valid, bool policy)
virtual NextHopKey * Clone() const
void FillObjectLog(AgentLogEvent::type event, NextHopObjectLogInfo &info) const
DISALLOW_COPY_AND_ASSIGN(NdpNH)
uint32_t ActiveComponentNHCount() const
bool operator==(const ComponentNH &rhs) const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
std::vector< uint32_t > hash_table_
const boost::uuids::uuid & GetIfUuid() const
virtual bool MatchEgressData(const NextHop *nh) const
virtual bool ChangeEntry(const DBRequest *req)
CompositeNHKey(COMPOSITETYPE type, bool validate_mcast_src, bool policy, const ComponentNHKeyList &component_nh_key_list, const std::string &vrf_name)
NextHop(Type type, bool policy)
bool Reorder(Agent *agent, uint32_t label, const NextHop *nh)
virtual std::string ToString()
InterfaceConstRef interface_
DISALLOW_COPY_AND_ASSIGN(NextHop)
CompositeNH * ChangeTunnelType(Agent *agent, TunnelType::Type type) const
virtual bool CanAdd() const =0
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
void FreeInterfaceId(size_t index)
virtual bool DeleteOnZeroRefCount() const
virtual void OnZeroRefCount()
const MacAddress & rewrite_dmac()
bool layer2_control_word_
virtual void Delete(const DBRequest *req)
virtual std::string ToString() const
virtual std::string ToString() const
static void CreateL3VmInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, const string &vrf_name, bool learning_enabled, const std::string &intf_name)
bool layer2_control_word() const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
CompositeNH(COMPOSITETYPE type, bool validate_mcast_src, bool policy, const ComponentNHKeyList &component_nh_key_list, VrfEntry *vrf)
NextHopData(bool learning_enabled, bool etree_leaf)
bool GetIndex(ComponentNH &nh, uint32_t &idx) const
const Interface * get_interface() const
NextHopConstRef child_nh_
static void SetDefaultType(Type type)
VrfNHKey(const string &vrf_name, bool policy, bool bridge_nh)
virtual bool NeedMplsLabel()
DISALLOW_COPY_AND_ASSIGN(L2ReceiveNHData)
bool PolicyEnabled() const
void erase(ComponentNHKeyPtr nh_key)
const NextHopKey * nh_key() const
DISALLOW_COPY_AND_ASSIGN(NextHopTable)
boost::intrusive_ptr< Interface > InterfaceRef
virtual NextHopKey * Clone() const
std::vector< ComponentNHPtr > ComponentNHList
virtual void Delete(const DBRequest *req)
void ChangeTunnelType(TunnelType::Type tunnel_type)
NdpNHData(const MacAddress &mac, InterfaceKey *intf_key, bool resolved)
void SetPolicy(bool policy)
static void DeleteL3InterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &mac, const std::string &intf_name)
const uint8_t & flags() const
ComponentNHKeyList component_nh_key_list_
const Interface::Type & intf_type() const
static const uint32_t kInvalidIndex
const NextHop * GetNH(uint32_t idx) const
ComponentNHList::const_iterator end() const
bool find(ComponentNHKeyPtr nh_key)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
bool delete_on_zero_refcount_
const VrfEntry * vrf() const
static TypeBmap GetTunnelBmap(TunnelType::Type type)
LabelledTunnelNHKey(const string &vrf_name, const Ip4Address &sip, const Ip4Address &dip, bool policy, TunnelType type, const MacAddress &rewrite_dmac=MacAddress(), uint32_t label=3)
virtual bool NeedMplsLabel()
void set_delete_on_zero_refcount(bool val)
virtual void OnZeroRefcount(AgentDBEntry *e)
boost::scoped_ptr< InterfaceKey > intf_key_
ComponentNHKey(int label, const boost::uuids::uuid &intf_uuid, uint8_t flags, const MacAddress &mac)
ComponentNHKey(int label, const string &vrf_name, const Ip4Address &sip, const Ip4Address &dip, bool policy, TunnelType::TypeBmap bmap)
boost::shared_ptr< const ComponentNH > ComponentNHPtr
virtual ~ComponentNHKey()
DISALLOW_COPY_AND_ASSIGN(DiscardNHData)
ReceiveNHKey(InterfaceKey *intf_key, bool policy)
const Interface * GetInterface() const
std::vector< Member * >::const_iterator const_iterator
virtual ~LabelledTunnelNHKey()
const ComponentNHKeyList & component_nh_key_list() const
bool is_multicastNH() const
VrfEntry * FindVrfEntry(const VrfKey &key) const
virtual bool MatchEgressData(const NextHop *nh) const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
ComponentNHKey(int label, uint8_t tag, const boost::uuids::uuid &intf_uuid)
DISALLOW_COPY_AND_ASSIGN(ResolveNHData)
COMPOSITETYPE composite_nh_type_
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
virtual NextHopKey * Clone() const =0
DISALLOW_COPY_AND_ASSIGN(CompositeNH)
static TypeBmap VxlanType()
DISALLOW_COPY_AND_ASSIGN(TunnelNHData)
void CheckVrNexthopLimit()
bool GetResolveState() const
DISALLOW_COPY_AND_ASSIGN(CompositeNHData)
virtual bool NeedMplsLabel()
const MacAddress dest_bmac() const
DISALLOW_COPY_AND_ASSIGN(DiscardNH)
virtual bool DeleteOnZeroRefCount() const
NdpNHKey(const string &vrf_name, const IpAddress &ip, bool policy)
static TypeBmap DefaultTypeBmap()
virtual NextHop * AllocEntry() const
boost::scoped_ptr< InterfaceKey > intf_key_
DISALLOW_COPY_AND_ASSIGN(ArpNHKey)
const uint16_t vlan_tag() const
virtual bool IsLess(const DBEntry &rhs) const
virtual size_t Hash(const DBEntry *entry) const
const uint32_t vrf_id() const
static void Create(const boost::uuids::uuid &intf_uuid, uint16_t vlan_tag, const std::string &vrf_name, const MacAddress &smac, const MacAddress &dmac)
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
DISALLOW_COPY_AND_ASSIGN(VrfNHKey)
bool flood_unknown_unicast() const
virtual bool NeedMplsLabel()
const MacAddress & dmac() const
const boost::uuids::uuid & GetIfUuid() const
virtual KeyPtr GetDBRequestKey() const
virtual bool DeleteOnZeroRefCount() const
const MplsLabel * mpls_label() const
virtual bool CanAdd() const
virtual NextHopKey * Clone() const
static Type DefaultType()
const ComponentNHKeyList & component_nh_key_list() const
virtual void SetKey(const DBRequestKey *key)
virtual ~InterfaceNHKey()