6 #include <boost/uuid/uuid_io.hpp>
7 #include <boost/foreach.hpp>
10 #include <vnc_cfg_types.h>
34 for (PriorityList::const_iterator it = priority_list_.begin();
35 it != priority_list_.end(); it++) {
36 if (bmap & (1 << *it)) {
43 if (bmap & (1 << MPLS_GRE))
45 else if (bmap & (1 << MPLS_UDP))
47 else if (bmap & (1 << VXLAN))
49 else if (bmap & (1 << NATIVE))
51 else if (bmap & (1 << MPLS_OVER_MPLS))
52 return MPLS_OVER_MPLS;
61 for (std::vector<std::string>::const_iterator it = cfg_list.begin();
62 it != cfg_list.end(); it++) {
63 if (*it ==
"MPLSoGRE")
64 l.push_back(MPLS_GRE);
65 if (*it ==
"MPLSoUDP")
66 l.push_back(MPLS_UDP);
71 bool encap_changed = (priority_list_ != l);
78 priority_list_.clear();
86 NextHopObjectLogInfo info;
88 FillObjectLog(event, info);
93 if (id_ != kInvalidIndex) {
94 static_cast<NextHopTable *
>(get_table())->FreeInterfaceId(id_);
100 type_ = nh_key->
type_;
116 if (NeedMplsLabel() && (mpls_label() == NULL)) {
119 mpls_label_ = AllocateLabel(agent, key);
130 if (NeedMplsLabel()) {
131 mpls_label_ = AllocateLabel(agent, key1);
137 req.
key = GetDBRequestKey();
139 get_table()->Enqueue(&req);
143 NextHopObjectLogInfo &info)
const {
144 string type_str, policy_str(
"Disabled"), valid_str(
"Invalid"), str;
147 type_str.assign(
"DISCARD");
151 type_str.assign(
"RECEIVE");
155 type_str.assign(
"RESOLVE");
159 type_str.assign(
"ARP");
163 type_str.assign(
"NDP");
167 type_str.assign(
"INTERFACE");
171 type_str.assign(
"VRF");
175 type_str.assign(
"TUNNEL");
179 type_str.assign(
"MIRROR");
183 type_str.assign(
"VLAN");
187 type_str.assign(
"COMPOSITE");
191 type_str.assign(
"PBB_INDIRECT");
195 type_str.assign(
"unknown");
198 policy_str.assign(
"Enabled");
201 valid_str.assign(
"Valid");
204 case AgentLogEvent::ADD:
205 str.assign(
"Addition ");
207 case AgentLogEvent::DEL:
208 str.assign(
"Deletion ");
210 case AgentLogEvent::CHANGE:
211 str.assign(
"Modification ");
213 case AgentLogEvent::RESYNC:
214 str.assign(
"Resync ");
217 str.assign(
"unknown");
220 info.set_type(type_str);
221 info.set_policy(policy_str);
222 info.set_valid(valid_str);
227 NextHopObjectLogInfo &info) {
230 switch(intf->
type()) {
232 if_type_str.assign(
"VM_INTERFACE");
235 if_type_str.assign(
"ETH");
238 if_type_str.assign(
"VIRTUAL_HOST");
241 if_type_str.assign(
"PKT");
244 if_type_str.assign(
"Invalid");
247 info.set_intf_type(if_type_str);
249 info.set_intf_name(intf->
name());
254 NextHopObjectLogInfo &info) {
256 snprintf(mstr, 32,
"%02x:%02x:%02x:%02x:%02x:%02x",
257 m[0], m[1], m[2], m[3], m[4], m[5]);
310 if (nh->
CanAdd() ==
false) {
318 return static_cast<DBEntry *
>(nh);
323 bool delcleared =
false;
334 return (ret | delcleared);
403 req.
key = std::move(key);
404 req.
data.reset(NULL);
410 VrLimitExceeded::iterator vr_limit_itr = vr_limits.find(
"vr_nexthops");
411 if (vr_limit_itr->second ==
"Normal") {
414 vr_limit_itr->second.assign(std::string(
"Exceeded"));
415 LOG(ERROR,
"Vrouter Nexthop Index Exceeded.");
417 }
else if ( vr_limit_itr->second ==
"Exceeded") {
419 vr_limit_itr->second.assign(std::string(
"TableLimit"));
420 LOG(ERROR,
"Vrouter Nexthop Table Limit Reached. Skip NH Add.");
423 vr_limit_itr->second.assign(std::string(
"Normal"));
425 }
else if ( vr_limit_itr->second ==
"TableLimit" ) {
428 vr_limit_itr->second.assign(std::string(
"Exceeded"));
429 LOG(ERROR,
"Vrouter Nexthop Index Exceeded.");
446 LOG(ERROR,
"Invalid VRF in ArpNH. Skip Add");
454 const ArpNH &a =
static_cast<const ArpNH &
>(rhs);
506 return vrf_->vrf_id();
520 NextHopObjectLogInfo info;
532 info.set_dest_ip(ip->to_string());
551 LOG(ERROR,
"Invalid VRF in NdpNH. Skip Add");
559 const NdpNH &a =
static_cast<const NdpNH &
>(rhs);
611 return vrf_->vrf_id();
625 NextHopObjectLogInfo info;
637 info.set_dest_ip(ip->to_string());
662 LOG(ERROR,
"Invalid Interface in InterfaceNH. Skip Add");
707 if (
vrf_.get() != vrf) {
736 bool policy,
const string vrf_name,
737 bool learning_enabled,
bool etree_leaf,
738 bool layer2_control_word,
const string &name) {
742 policy, flags, dmac));
744 etree_leaf, layer2_control_word));
752 const string &vrf_name,
753 bool learning_enabled,
754 const string &intf_name) {
756 learning_enabled,
false,
false, intf_name);
758 learning_enabled,
false,
false, intf_name);
763 const string &intf_name) {
770 const string &vrf_name,
771 bool learning_enabled,
773 bool layer2_control_word,
774 const string &intf_name) {
776 learning_enabled, etree_leaf, layer2_control_word, intf_name);
778 learning_enabled, etree_leaf, layer2_control_word, intf_name);
783 const string &intf_name) {
790 const string &vrf_name,
791 const string &intf_name) {
794 vrf_name,
false,
false,
false, intf_name);
799 const string &intf_name) {
807 const string &intf_name) {
812 policy, flags, mac));
813 req.
data.reset(NULL);
818 const string &vrf_name,
829 req.
data.reset(data);
843 req.
data.reset(NULL);
879 req.
data.reset(NULL);
885 NextHopObjectLogInfo info;
901 if (dynamic_cast<const VmInterface *>(itf) ||
902 dynamic_cast<const InetInterface *>(itf)) {
913 LOG(ERROR,
"Invalid VRF in VrfNH. Skip Add");
927 const VrfNH &a =
static_cast<const VrfNH &
>(rhs);
972 NextHopObjectLogInfo info;
987 NextHop(
NextHop::TUNNEL, false, policy), vrf_(vrf, this), sip_(sip),
988 dip_(dip), tunnel_type_(type), tunnel_dst_rt_(NULL), crypt_(false),
989 crypt_tunnel_available_(false), crypt_interface_(NULL), rewrite_dmac_(rewrite_dmac) {
1003 LOG(ERROR,
"Invalid VRF in TunnelNH. Skip Add");
1007 if (
dip_.to_ulong() == 0) {
1008 LOG(ERROR,
"Invalid tunnel-destination in TunnelNH");
1066 return vrf_->vrf_id();
1127 bool crypt, crypt_tunnel_available;
1129 crypt, crypt_tunnel_available);
1146 if (active_nh == NULL) {
1152 const ArpNH *arp_nh =
static_cast<const ArpNH *
>(active_nh);
1156 const NdpNH *ndp_nh =
static_cast<const NdpNH *
>(active_nh);
1179 ComponentNHList::const_iterator component_nh_it =
1182 while (component_nh_it != cnh->
end()) {
1183 const NextHop *component_nh = NULL;
1184 if (*component_nh_it) {
1185 component_nh = (*component_nh_it)->nh();
1187 const ArpNH *anh =
dynamic_cast<const ArpNH*
>(component_nh);
1219 NextHopObjectLogInfo info;
1227 info.set_source_ip(sip->to_string());
1229 info.set_dest_ip(dip->to_string());
1232 info.set_crypt_traffic(
"All");
1234 info.set_crypt_tunnel_available(
"Yes");
1248 TunnelNH(vrf, sip, dip, policy, type, rewrite_dmac), transport_mpls_label_(label) {
1287 NextHopObjectLogInfo info;
1295 info.set_source_ip(sip->to_string());
1297 info.set_dest_ip(dip->to_string());
1300 info.set_crypt_traffic(
"All");
1302 info.set_crypt_tunnel_available(
"Yes");
1315 sip_(sip), sport_(sport), dip_(dip), dport_(dport), arp_rt_(this),
1316 interface_(NULL), dmac_() {
1326 LOG(ERROR,
"Invalid VRF in mirror NH");
1340 if ((
vrf_.get() != a.
vrf_.get())) {
1352 return (
vrf_ ?
vrf_->vrf_id() : (uint32_t)-1);
1443 const ArpNH *arp_nh =
static_cast<const ArpNH *
>(active_nh);
1447 const NdpNH *ndp_nh =
static_cast<const NdpNH *
>(active_nh);
1457 if (
dmac_ != dmac) {
1481 NextHopObjectLogInfo info;
1490 info.set_source_ip(sip->to_string());
1492 info.set_dest_ip(dip->to_string());
1493 info.set_source_port((
short int)
GetSPort());
1494 info.set_dest_port((
short int)
GetDPort());
1503 LOG(ERROR,
"Invalid Interface in ReceiveNH. Skip Add");
1550 req.
data.reset(NULL);
1560 NextHopObjectLogInfo info;
1638 LOG(ERROR,
"Invalid Interface in VlanNH. Skip Add");
1680 if (
vrf_.get() != vrf) {
1704 const string &vrf_name,
const MacAddress &smac,
1713 req.
data.reset(data);
1724 req.
data.reset(NULL);
1730 const string &vrf_name,
const MacAddress &smac,
1745 req.
data.reset(NULL);
1757 NextHopObjectLogInfo info;
1778 if ((cnh.get() != NULL) &&
1791 if (
vrf_ == NULL ||
vrf_->IsDeleted()) {
1792 LOG(ERROR,
"Invalid VRF in composite NH. Skip Add");
1799 ComponentNHList::const_iterator comp_nh_it =
1802 if ((*comp_nh_it) == NULL) {
1807 return (*comp_nh_it)->nh();
1814 ComponentNHList::const_iterator comp_nh_it =
1817 if ((*comp_nh_it) == NULL) {
1823 ((*comp_nh_it)->nh());
1829 ((*comp_nh_it)->nh());
1841 ComponentNHList::const_iterator comp_nh_it =
1844 if (*comp_nh_it == NULL) {
1849 ((*comp_nh_it)->nh());
1854 ((*comp_nh_it)->nh());
1862 bool ingress)
const {
1871 if (nh != NULL && nh->
IsActive()) {
1872 return affinity_index;
1880 (ingress ==
false &&
1883 std::vector<uint32_t> active_list;
1884 for (uint32_t i = 0; i < size; i++) {
1890 if (ingress ==
false) {
1892 active_list.push_back(i);
1895 active_list.push_back(i);
1899 idx = (active_list.size()) ?
1900 active_list.at(seed % active_list.size()) :
1917 if ((*it) == NULL) {
1922 static_cast<TunnelNHKey *
>((*it)->nh_key()->Clone());
1924 std::unique_ptr<const NextHopKey> nh_key(tunnel_nh_key);
1926 std::move(nh_key)));
1927 (*it) = new_tunnel_nh;
1933 bool changed =
false;
1962 ComponentNHKeyList::const_iterator it = tmp_component_nh_key_list_.begin();
1963 for (;it != tmp_component_nh_key_list_.end(); it++) {
1964 if ((*it) == NULL) {
1967 component_nh_list.push_back(nh_key);
1975 component_nh_list.push_back(nh_key);
1981 component_nh_list.push_back(nh_key);
1986 ComponentNHList::const_iterator new_comp_nh_it =
1987 component_nh_list.begin();
1988 ComponentNHList::const_iterator old_comp_nh_it =
1990 for(;new_comp_nh_it != component_nh_list.end() &&
1992 new_comp_nh_it++, old_comp_nh_it++) {
1994 if ((*old_comp_nh_it) == NULL &&
1995 (*new_comp_nh_it) == NULL) {
2000 if ((*old_comp_nh_it) == NULL || (*new_comp_nh_it) == NULL) {
2006 if ((**old_comp_nh_it) == (**new_comp_nh_it)) {
2014 if (new_comp_nh_it == component_nh_list.end() &&
2043 NextHopObjectLogInfo info;
2048 info.set_vrf(vrf_entry->
GetName());
2051 std::vector<ComponentNHLogInfo> comp_nh_log_list;
2052 ComponentNHList::const_iterator component_nh_it =
begin();
2053 for (;component_nh_it !=
end(); component_nh_it++) {
2054 ComponentNHLogInfo component_nh_info;
2055 const ComponentNH *comp_nh = (*component_nh_it).get();
2056 if (comp_nh == NULL) {
2060 component_nh_info.set_component_nh_id(nh->
id());
2064 component_nh_info.set_type(
"Tunnel");
2065 component_nh_info.set_label(comp_nh->
label());
2066 component_nh_info.set_server_ip(tun_nh->
GetDip()->to_string());
2072 component_nh_info.set_type(
"Interface");
2073 component_nh_info.set_label(comp_nh->
label());
2076 component_nh_info.set_intf_name(intf->
name());
2081 const VlanNH *vlan_nh =
static_cast<const VlanNH *
>(nh);
2082 component_nh_info.set_type(
"Vlan");
2083 component_nh_info.set_label(comp_nh->
label());
2086 component_nh_info.set_intf_name(intf->
name());
2092 std::stringstream str;
2095 component_nh_info.set_type(str.str());
2101 comp_nh_log_list.push_back(component_nh_info);
2104 info.set_nh_list(comp_nh_log_list);
2130 ComponentNHKeyList::const_iterator left_component_nh_it =
2132 ComponentNHKeyList::const_iterator right_component_nh_it =
2137 left_component_nh_it++, right_component_nh_it++) {
2139 if (*left_component_nh_it == NULL &&
2140 *right_component_nh_it == NULL) {
2144 if ((*left_component_nh_it) == NULL ||
2145 (*right_component_nh_it) == NULL) {
2146 return (*left_component_nh_it) < (*right_component_nh_it);
2150 if ((*left_component_nh_it)->label() !=
2151 (*right_component_nh_it)->label()) {
2152 return (*left_component_nh_it)->label() <
2153 (*right_component_nh_it)->label();
2161 const NextHopKey *left_nh = (*left_component_nh_it)->nh_key();
2162 const NextHopKey *right_nh = (*right_component_nh_it)->nh_key();
2164 if (left_nh->
IsEqual(*right_nh) ==
false) {
2165 return left_nh->
IsLess(*right_nh);
2188 component_nh_key_list,
2202 if ((*it) == NULL) {
2205 const NextHop *nh = (*it)->nh();
2260 ComponentNHKeyList::iterator it = component_nh_key_list.begin();
2262 for (;it != component_nh_key_list.end(); it++) {
2264 if ((*it) == NULL) {
2280 std::unique_ptr<const NextHopKey> nh_key(composite_nh_key);
2282 std::move(nh_key)));
2283 (*it) = new_comp_nh;
2288 static_cast<TunnelNHKey *
>((*it)->nh_key()->Clone());
2290 std::unique_ptr<const NextHopKey> nh_key(tunnel_nh_key);
2292 std::move(nh_key)));
2293 (*it) = new_tunnel_nh;
2321 new_component_nh_key_list,
2324 nh_req.key.reset(comp_nh_key);
2338 if (it.get() == NULL) {
2343 if (it->nh() && component_nh.
nh()) {
2344 if (it->nh()->MatchEgressData(component_nh.
nh())) {
2346 }
else if (it->nh() == component_nh.
nh()) {
2356 const string &vrf_name) {
2362 nh_req.
key = std::move(key);
2363 nh_req.
data.reset(NULL);
2370 if (component_nh_key.get() &&
2375 req.
key.reset(component_nh_key->nh_key()->Clone());
2377 req.
data.reset(data);
2385 if (component_nh_key.get() &&
2390 req.
key.reset(component_nh_key->nh_key()->Clone());
2392 req.
data.reset(data);
2406 if (component_nh_key == NULL) {
2409 if (*component_nh_key == *new_component_nh_key) {
2417 if (new_component_nh_key == NULL) {
2422 if (
find(new_component_nh_key)) {
2426 ComponentNHKeyList::iterator it;
2430 if ((*it) == NULL) {
2431 *it = new_component_nh_key;
2439 if (nh_key_ptr==
nullptr){
2444 if (com_key_ptr==
nullptr){
2447 if (*com_key_ptr==*nh_key_ptr ){
2448 com_key_ptr.reset();
2457 comp_nh_policy =
false;
2459 if (it.get() == NULL) {
2462 component_nh_key_list.push_back(dummy_ptr);
2466 uint32_t new_label = component_nh->
label();
2470 if (new_label != label && lhs->
IsEqual(*nh_key)) {
2474 std::unique_ptr<const NextHopKey> nh_key_ptr(lhs);
2477 component_nh_key_list.push_back(component_nh_key);
2478 if (!comp_nh_policy) {
2486 bool &comp_nh_policy)
const {
2489 FindActiveEntry(cnh->nh_key()));
2495 comp_nh_policy =
false;
2496 bool made_cnh_list =
false;
2499 if (component_nh == NULL) {
2503 if (component_nh->
nh() == nh) {
2504 if (component_nh->
label() == cnh->label()) {
2510 component_nh_key_list[index] = cnh;
2511 made_cnh_list =
true;
2513 if (!comp_nh_policy) {
2517 }
else if (!comp_nh_policy) {
2520 if (comp_nh_policy && made_cnh_list) {
2526 if (made_cnh_list) {
2530 bool inserted =
false;
2532 ComponentNHKeyList::const_iterator key_it = component_nh_key_list.begin();
2533 for (;key_it != component_nh_key_list.end(); key_it++, index++) {
2536 if ((*key_it) == NULL) {
2537 component_nh_key_list[index] = cnh;
2544 if (inserted ==
false) {
2545 component_nh_key_list.push_back(cnh);
2556 bool &comp_nh_new_policy)
const {
2559 Find(cnh->nh_key(),
true));
2564 ComponentNHList::const_iterator it =
begin();
2565 comp_nh_new_policy =
false;
2566 bool removed =
false;
2568 for (;it !=
end(); it++, index++) {
2571 if ((*it) && ((*it)->label() == cnh->label() && (*it)->nh() == nh)) {
2572 component_nh_key_list[index] = dummy_ptr;
2579 if ((*it) && (*it)->nh() && !comp_nh_new_policy) {
2584 comp_nh_new_policy = (*it)->nh()->NexthopToInterfacePolicy();
2587 if (removed && comp_nh_new_policy) {
2606 ComponentNHKeyList::const_iterator key_it =
begin();
2607 ComponentNHKeyList::const_iterator rhs_key_it = comp_rhs->
begin();
2608 for (;key_it !=
end() && rhs_key_it != comp_rhs->
end();
2609 key_it++, rhs_key_it++) {
2611 const ComponentNHKey *rhs_component_nh_ptr = (*rhs_key_it).get();
2612 if (lhs_component_nh_ptr == NULL &&
2613 rhs_component_nh_ptr == NULL) {
2617 if (lhs_component_nh_ptr == NULL ||
2618 rhs_component_nh_ptr == NULL) {
2619 return lhs_component_nh_ptr < rhs_component_nh_ptr;
2622 if (lhs_component_nh_ptr->
label() !=
2623 rhs_component_nh_ptr->
label()) {
2624 return lhs_component_nh_ptr->
label() < rhs_component_nh_ptr->
label();
2629 if (left_nh_key->
IsEqual(*right_nh_key) ==
false) {
2633 return left_nh_key->
IsLess(*right_nh_key);
2637 if (key_it ==
end() && rhs_key_it == comp_rhs->
end()) {
2641 if (key_it ==
end()) {
2657 if (component_nh_key.get() &&
2661 component_nh_key->nh_key());
2664 label = component_nh_key->label();
2667 erase(component_nh_key);
2680 if (component_nh_key.get() &&
2718 bool comp_nh_new_policy =
false;
2720 if (it.get() == NULL) {
2729 std::unique_ptr<const NextHopKey> nh_key_ptr(nh_key);
2732 insert(component_nh_key);
2733 if (!comp_nh_new_policy) {
2737 return comp_nh_new_policy;
2741 uint32_t label,
const NextHop *nh) {
2768 std::unique_ptr<const NextHopKey> nh_key_ptr(nh_key);
2772 std::move(nh_key_ptr)));
2773 if (
find(component_nh_key)) {
2778 erase(component_nh_key);
2779 insert(component_nh_key);
2791 if (component_nh_key != NULL &&
2792 find(component_nh_key) ==
false) {
2793 composite_nh_key->
erase(component_nh_key);
2800 if (component_nh_key != NULL) {
2801 composite_nh_key->
insert(component_nh_key);
2811 label_(label), nh_key_(new
CompositeNHKey(type, policy, component_nh_list,
2816 NextHop(
NextHop::PBB, true, false), vrf_(vrf, this), dest_bmac_(dest_bmac),
2817 isid_(isid), label_(
MplsTable::kInvalidLabel), child_nh_(NULL){
2825 LOG(ERROR,
"Invalid VRF in PBBNH. Skip Add");
2830 LOG(ERROR,
"Invalid tunnel-destination in PBBNH");
2843 const PBBNH &a =
static_cast<const PBBNH &
>(rhs);
2871 return vrf_->vrf_id();
2919 NextHopObjectLogInfo info;
2923 info.set_vrf(
vrf_->GetName());
2933 std::vector<McastData> &list)
2935 for (ComponentNHList::const_iterator it = comp_nh->
begin();
2936 it != comp_nh->
end(); it++) {
2939 if (component_nh == NULL) {
2940 sdata.set_type(
"NULL");
2941 list.push_back(sdata);
2944 switch (component_nh->
nh()->
GetType()) {
2946 sdata.set_type(
"Interface");
2950 sdata.set_label(component_nh->
label());
2952 list.push_back(sdata);
2956 sdata.set_type(
"Tunnel");
2958 static_cast<const TunnelNH *
>(component_nh->
nh());
2959 sdata.set_dip(tnh->
GetDip()->to_string());
2960 sdata.set_sip(tnh->
GetSip()->to_string());
2961 sdata.set_label(component_nh->
label());
2962 list.push_back(sdata);
2966 sdata.set_type(
"Vlan");
2968 static_cast<const VlanNH *
>(component_nh->
nh());
2971 list.push_back(sdata);
2975 sdata.set_type(
"Composite");
2978 std::vector<McastData> comp_list;
2980 list.insert(list.begin(), comp_list.begin(), comp_list.end());
2984 std::stringstream s;
2985 s <<
"UNKNOWN<" << component_nh->
nh()->
GetType()
2987 sdata.set_type(s.str());
2988 list.push_back(sdata);
2995 L2CompositeData &data)
2997 std::stringstream str;
2998 str <<
"L2 Composite, subnh count : "
3000 data.set_type(str.str());
3003 std::vector<McastData> data_list;
3005 data.set_mc_list(data_list);
3009 L3CompositeData &data)
3011 std::stringstream str;
3012 str <<
"L3 Composite, subnh count : "
3014 data.set_type(str.str());
3017 std::vector<McastData> data_list;
3019 data.set_mc_list(data_list);
3023 NhSandeshData &data)
3025 std::stringstream str;
3026 str <<
"Multi Proto Composite, subnh count : "
3028 data.set_type(str.str());
3031 for (ComponentNHList::const_iterator it = comp_nh->
begin();
3032 it != comp_nh->
end(); it++) {
3034 if (component_nh == NULL) {
3040 L2CompositeData l2_data;
3042 data.set_l2_comp(l2_data);
3045 L3CompositeData l3_data;
3047 data.set_l3_comp(l3_data);
3053 NhSandeshData &data)
3055 stringstream comp_str;
3058 comp_str <<
"evpn Composite" <<
" sub nh count: "
3060 data.set_type(comp_str.str());
3063 std::vector<McastData> data_list;
3065 data.set_mc_list(data_list);
3069 comp_str <<
"TOR Composite" <<
" sub nh count: "
3071 data.set_type(comp_str.str());
3074 std::vector<McastData> data_list;
3076 data.set_mc_list(data_list);
3080 comp_str <<
"fabric Composite" <<
" sub nh count: "
3082 data.set_type(comp_str.str());
3085 std::vector<McastData> data_list;
3087 data.set_mc_list(data_list);
3091 comp_str <<
"L3 Fabric Composite" <<
" sub nh count: "
3093 data.set_type(comp_str.str());
3096 std::vector<McastData> data_list;
3098 data.set_mc_list(data_list);
3102 comp_str <<
"L3 Composite" <<
" sub nh count: "
3104 data.set_type(comp_str.str());
3107 std::vector<McastData> data_list;
3109 data.set_mc_list(data_list);
3113 comp_str <<
"L2 Composite" <<
" sub nh count: "
3115 data.set_type(comp_str.str());
3118 std::vector<McastData> data_list;
3120 data.set_mc_list(data_list);
3124 comp_str <<
"L2 interface Composite" <<
" sub nh count: "
3126 data.set_type(comp_str.str());
3129 std::vector<McastData> data_list;
3131 data.set_mc_list(data_list);
3135 comp_str <<
"L3 interface Composite" <<
" sub nh count: "
3137 data.set_type(comp_str.str());
3140 std::vector<McastData> data_list;
3142 data.set_mc_list(data_list);
3146 comp_str <<
"Multiproto Composite" <<
" sub nh count: "
3148 data.set_type(comp_str.str());
3155 comp_str <<
"ECMP Composite" <<
" sub nh count: "
3157 data.set_type(comp_str.str());
3158 std::vector<McastData> data_list;
3160 data.set_mc_list(data_list);
3166 data.set_type(comp_str.str());
3173 data.set_nh_index(
id());
3174 data.set_vxlan_flag(
false);
3175 data.set_intf_flags(0);
3178 data.set_type(
"discard");
3181 data.set_type(
"l2-receive");
3184 data.set_type(
"receive");
3189 data.set_itf(
"<NULL>");
3194 data.set_type(
"resolve");
3197 data.set_type(
"arp");
3198 const ArpNH *arp =
static_cast<const ArpNH *
>(
this);
3199 data.set_sip(arp->
GetIp()->to_string());
3207 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3208 m[0], m[1], m[2], m[3], m[4], m[5]);
3209 std::string mac(mstr);
3210 data.set_mac(std::vector<std::string>(1, mac));
3214 data.set_type(
"ndp");
3215 const NdpNH *ndp =
static_cast<const NdpNH *
>(
this);
3216 data.set_sip(ndp->
GetIp()->to_string());
3224 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3225 m[0], m[1], m[2], m[3], m[4], m[5]);
3226 std::string mac(mstr);
3227 data.set_mac(std::vector<std::string>(1, mac));
3231 data.set_type(
"vrf");
3232 const VrfNH *vrf =
static_cast<const VrfNH *
>(
this);
3240 data.set_type(
"interface");
3245 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3246 m[0], m[1], m[2], m[3], m[4], m[5]);
3247 std::string mac(mstr);
3248 data.set_mac(std::vector<std::string>(1, mac));
3250 data.set_mcast(
"enabled");
3252 data.set_mcast(
"disabled");
3255 data.set_intf_flags(itf->
GetFlags());
3259 data.set_type(
"tunnel");
3261 data.set_sip(tun->
GetSip()->to_string());
3262 data.set_dip(tun->
GetDip()->to_string());
3270 const ArpNH *arp_nh =
static_cast<const ArpNH *
>(nh);
3273 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3274 m[0], m[1], m[2], m[3], m[4], m[5]);
3275 std::string mac(mstr);
3276 data.set_mac(std::vector<std::string>(1, mac));
3278 const NdpNH *ndp_nh =
static_cast<const NdpNH *
>(nh);
3281 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3282 m[0], m[1], m[2], m[3], m[4], m[5]);
3283 std::string mac(mstr);
3284 data.set_mac(std::vector<std::string>(1, mac));
3287 ComponentNHList::const_iterator component_nh_it =
3289 std::vector<std::string> mac_list;
3290 while (component_nh_it != cnh->
end()) {
3291 const NextHop *component_nh = NULL;
3292 if (*component_nh_it) {
3293 component_nh = (*component_nh_it)->nh();
3295 const ArpNH *arp_nh =
dynamic_cast<const ArpNH*
>(component_nh);
3298 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3299 m[0], m[1], m[2], m[3], m[4], m[5]);
3300 std::string mac(mstr);
3301 mac_list.push_back(mac);
3306 data.set_mac(mac_list);
3310 data.set_crypt_all_traffic(tun->
GetCrypt());
3316 data.set_vxlan_flag(
true);
3322 data.set_type(
"Mirror");
3324 data.set_sip(mir_nh->
GetSip()->to_string());
3325 data.set_dip(mir_nh->
GetDip()->to_string());
3327 data.set_sport(mir_nh->
GetSPort());
3328 data.set_dport(mir_nh->
GetDPort());
3334 const ArpNH *arp_nh =
static_cast<const ArpNH *
>(nh);
3338 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3339 m[0], m[1], m[2], m[3], m[4], m[5]);
3340 std::string mac(mstr);
3341 data.set_mac(std::vector<std::string>(1, mac));
3343 const NdpNH *ndp_nh =
static_cast<const NdpNH *
>(nh);
3347 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3348 m[0], m[1], m[2], m[3], m[4], m[5]);
3349 std::string mac(mstr);
3350 data.set_mac(std::vector<std::string>(1, mac));
3356 ComponentNHList::const_iterator component_nh_it =
3358 std::vector<std::string> mac_list;
3359 while (component_nh_it != cnh->
end()) {
3360 const NextHop *component_nh = NULL;
3361 if (*component_nh_it) {
3362 component_nh = (*component_nh_it)->nh();
3364 const ArpNH *arp_nh =
dynamic_cast<const ArpNH*
>(component_nh);
3367 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3368 m[0], m[1], m[2], m[3], m[4], m[5]);
3369 std::string mac(mstr);
3370 mac_list.push_back(mac);
3375 data.set_mac(mac_list);
3390 data.set_type(
"PBB Tunnel");
3391 const PBBNH *pbb_nh =
static_cast<const PBBNH *
>(
this);
3394 data.set_isid(pbb_nh->
isid());
3395 std::vector<McastData> data_list;
3400 sdata.set_type(
"Tunnel");
3401 sdata.set_dip(tnh->
GetDip()->to_string());
3402 sdata.set_sip(tnh->
GetSip()->to_string());
3403 sdata.set_label(pbb_nh->
label());
3404 data_list.push_back(sdata);
3406 data.set_mc_list(data_list);
3411 data.set_type(
"vlan");
3417 snprintf(mstr, 32,
"%x:%x:%x:%x:%x:%x",
3418 m[0], m[1], m[2], m[3], m[4], m[5]);
3419 std::string mac(mstr);
3420 data.set_mac(std::vector<std::string>(1, mac));
3426 data.set_type(
"invalid");
3430 data.set_valid(
"true");
3432 data.set_valid(
"false");
3439 data.set_policy(
"enabled");
3441 data.set_policy(
"disabled");
3456 NhListResp *resp =
static_cast<NhListResp *
>(sresp);
3460 std::vector<NhSandeshData> &list =
3461 const_cast<std::vector<NhSandeshData>&
>(resp->get_nh_list());
3462 list.push_back(data);
3467 void NhListReq::HandleRequest()
const {
3469 get_nh_index(), get_policy_enabled()));
3470 sand->DoSandesh(sand);
3474 const std::string &context) {
uint32_t PickMember(uint32_t seed, uint32_t affinity_index, bool ingress) const
EntryType At(size_t index) const
static PriorityList priority_list_
static const MacAddress & ZeroMac()
uint32_t const GetTransportLabel() const
static void FillL2CompositeNextHop(const CompositeNH *comp_nh, L2CompositeData &data)
static void FillObjectLogMac(const unsigned char *m, NextHopObjectLogInfo &info)
const NextHop * nh() const
virtual bool ChangeEntry(const DBRequest *req)
const Interface * GetInterface() const
virtual void SetKey(const DBRequestKey *key)
virtual bool CanAdd() const
bool IsEqual(const NextHopKey &rhs) const
Interface * FindInterface(const InterfaceKey &key) const
virtual KeyPtr GetDBRequestKey() const
const VnListType & dest_vn_list() const
void ReplaceLocalNexthop(const ComponentNHKeyList &new_comp_nh)
virtual bool NextHopIsLess(const DBEntry &rhs) const
const Interface * GetFirstLocalEcmpMemberInterface() const
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_
void Process(DBClient *client, DBRequest *req)
const VrfEntry * GetVrf() const
virtual bool ChangeEntry(const DBRequest *req)
CompositeNHKey(COMPOSITETYPE type, bool policy, const ComponentNHKeyList &component_nh_key_list, const std::string &vrf_name)
static Agent * GetInstance()
static void CreateReq(const InterfaceKey *intf, bool policy)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
static Type default_type_
const TagList & tag_list() const
NextHop * FindNextHop(size_t index)
const uint32_t vrf_id() const
static const uint32_t kInvalidComponentNHIdx
bool layer2_control_word_
InetUnicastRouteEntry * FindLPM(const IpAddress &ip)
COMPOSITETYPE composite_nh_type_
virtual bool CanAdd() const
virtual void Add(Agent *agent, const DBRequest *req)
static void DeleteReq(const boost::uuids::uuid &intf_uuid, uint16_t vlan_tag)
void set_id(uint32_t index)
virtual bool ChangeEntry(const DBRequest *req)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
std::string GetString(const std::string &key) const
const boost::uuids::uuid & GetUuid() const
MplsLabel * AllocateLabel(Agent *agent, const NextHopKey *key)
virtual bool CanAdd() const
const VrfEntry * GetVrf() const
NextHopTable * nexthop_table() const
DBTableBase * get_table() const
const MacAddress & GetMac() const
virtual bool NextHopIsLess(const DBEntry &rhs) const
static void AddArpReq(const string &route_vrf_name, const Ip4Address &ip, const string &nh_vrf_name, const Interface *intf, bool policy, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list)
virtual bool CanAdd() const
void EnqueueResync() const
void CryptAvailability(const std::string &remote_ip, bool &crypt_traffic, bool &crypt_path_available)
virtual bool Delete(DBEntry *entry, const DBRequest *req)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual void SetKey(const DBRequestKey *key)
bool layer2_control_word_
const MacAddress & GetDMac() const
virtual bool NextHopKeyIsLess(const NextHopKey &rhs) const
void CreateTunnelNHReq(Agent *agent)
const Interface * GetInterface() const
const NextHop * nexthop() const
const IpAddress * GetIp() 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
boost::asio::ip::address IpAddress
virtual NextHop * AllocEntry() const
virtual NextHop * AllocEntry() const
boost::scoped_ptr< const InterfaceKey > intf_key_
const VrfEntry * GetVrf() const
bool layer2_control_word() const
uint32_t transport_mpls_label_
virtual bool TunnelNextHopIsLess(const DBEntry &rhs) const
virtual void SetKey(const DBRequestKey *key)
IntrusivePtrRef< VrfEntry > VrfEntryRef
std::map< std::string, std::string > VrLimitExceeded
const MacAddress & GetMac() const
bool IsVxlanRouting() const
std::unique_ptr< DBRequestData > data
virtual void SetKey(const DBRequestKey *key)
TunnelNH(VrfEntry *vrf, const Ip4Address &sip, const Ip4Address &dip, bool policy, TunnelType type, const MacAddress &rewrite_dmac)
const AgentRoute * GetRt() const
void CreateComponentNH(Agent *agent, TunnelType::Type type) const
InetUnicastAgentRouteTable * GetInet4UnicastRouteTable() const
uint32_t GetRefCount() const
const NextHop * GetLocalNextHop() const
virtual void SetKey(const DBRequestKey *key)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
InterfaceTable * interface_table() const
bool Enqueue(DBRequest *req)
virtual bool CanAdd() const
const Ip4Address * GetDip() const
static TypeBmap MplsType()
static void DeleteMulticastVmInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, const std::string &intf_name)
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)
friend class LabelledTunnelNH
boost::shared_ptr< const ComponentNHKey > ComponentNHKeyPtr
InetUnicastAgentRouteTable * GetInet6UnicastRouteTable() const
const string & GetName() const
static void CreateInetInterfaceNextHop(const string &ifname, const string &vrf_name, const MacAddress &mac)
bool NexthopToInterfacePolicy() const
AddressList vhost_default_gateway() const
void insert(ComponentNHKeyPtr nh_key)
static std::string UuidToString(const boost::uuids::uuid &id)
float vr_limit_high_watermark()
uint16_t GetVlanTag() const
bool GetCryptTunnelAvailable() const
static void FillMultiProtoCompositeNextHop(const CompositeNH *comp_nh, NhSandeshData &data)
MplsTable * mpls_table() const
virtual NextHop * AllocEntry() const
std::unique_ptr< DBRequestKey > KeyPtr
void SetNHSandeshData(NhSandeshData &data) const
const VrfEntry * vrf() const
virtual KeyPtr GetDBRequestKey() const
BridgeRouteEntry * FindRouteNoLock(const MacAddress &mac)
virtual bool CanAdd() const
uint32_t GetRefCount() const
virtual CompositeNHKey * Clone() const
virtual NextHop * AllocEntry() const
float vr_limit_low_watermark()
const uint32_t vrf_id() const
bool layer2_control_word_
virtual ~LabelledTunnelNH()
std::vector< ComponentNHKeyPtr > ComponentNHKeyList
virtual bool OnChange(DBEntry *entry, const DBRequest *req)
std::string ToString() const
static bool EncapPrioritySync(const std::vector< std::string > &cfg_list)
virtual bool ChangeEntry(const DBRequest *req)
static NextHopTable * nexthop_table_
void AddWithoutAlloc(DBEntry *entry)
const Ip4Address * GetIp() const
const Interface * GetInterface() const
virtual bool ChangeEntry(const DBRequest *req)
TunnelType::Type const GetTransportTunnelType() const
ComponentNHKey(int label, std::unique_ptr< const NextHopKey > key)
uint32_t vrouter_max_nexthops() const
virtual KeyPtr GetDBRequestKey() const
NextHop::Type GetType() const
virtual void SetKey(const DBRequestKey *key)
virtual bool TunnelNextHopIsLess(const DBEntry &rhs) const
static NextHopTable * GetInstance()
const std::string & fabric_vrf_name() const
boost::scoped_ptr< InterfaceKey > intf_key_
virtual bool CanAdd() const
static void FillL3CompositeNextHop(const CompositeNH *comp_nh, L3CompositeData &data)
const AgentPath * GetActivePath() const
size_t Insert(EntryType entry)
virtual void SetKey(const DBRequestKey *key)
ComponentNHKeyList component_nh_key_list_
virtual NextHop * AllocEntry() const =0
uint32_t transport_mpls_label_
virtual void SetKey(const DBRequestKey *key)
const boost::uuids::uuid & GetIfUuid() const
const uint16_t GetSPort() const
boost::scoped_ptr< InterfaceKey > intf_key_
ComponentNHKeyList::const_iterator end() const
static void AddInterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &dmac, uint8_t flags, bool policy, const string vrf_name, bool learning_enabled, bool etree_leaf, bool layer2_control_word, const string &name)
std::list< Type > PriorityList
virtual bool ChangeEntry(const DBRequest *req)
virtual KeyPtr GetDBRequestKey() const
static void DeletePriorityList()
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)
const uint32_t vrf_id() const
MplsLabel * AllocLabel(const NextHopKey *nh_key)
virtual bool NextHopIsLess(const DBEntry &rhs) const
static void Create(NextHopTable *table, const Interface *intf, bool policy)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual bool NextHopIsLess(const DBEntry &rhs) const
const TunnelType & GetTunnelType() const
virtual NextHop * AllocEntry() const
const NextHop * child_nh() const
virtual bool ChangeEntry(const DBRequest *req)
const NextHop * GetActiveNextHop() const
InetUnicastAgentRouteTable * GetRouteTable()
InterfaceConstRef crypt_interface_
NextHop * AllocWithKey(const DBRequestKey *k) const
int CompareTo(const MacAddress &rhs, int len=0) const
static void ExpandCompositeNextHop(const CompositeNH *comp_nh, NhSandeshData &data)
std::unique_ptr< DBRequestKey > key
virtual NextHop * AllocEntry() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual KeyPtr GetDBRequestKey() const
std::string ToString() const
static void FillObjectLogIntf(const Interface *intf, NextHopObjectLogInfo &info)
void RemoveWithoutDelete(DBEntry *entry)
bool IsEqual(const VrfKey &rhs) const
virtual bool CanAdd() const
virtual NextHop * AllocEntry() const
bool IsLess(const NextHopKey &rhs) const
void ChangeComponentNHKeyTunnelType(ComponentNHKeyList &component_nh_list, TunnelType::Type type) const
virtual NextHop * AllocEntry() const
virtual void SetKey(const DBRequestKey *key)
const uint32_t isid() const
void RemoveWithoutDelete(DBEntry *entry)
const VrfEntry * GetVrf() const
ComponentNHKeyList DeleteComponentNHKey(ComponentNHKeyPtr component_nh_key, bool &comp_nh_new_policy) const
const Interface * GetInterface() const
virtual bool CanAdd() const
static void Create(const InterfaceKey *intf, bool policy)
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
#define OPER_TRACE_ENTRY(obj, table,...)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
bool policy_enabled() const
const Ip4Address * GetSip() const
AgentDBEntry * Find(const DBEntry *key, bool ret_del)
CryptTunnelTable * crypt_tunnel_table() const
COMPOSITETYPE composite_nh_type() const
COMPOSITETYPE composite_nh_type() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual NextHop * AllocEntry() const
virtual bool NextHopIsLess(const DBEntry &rhs) const
EncapDataList encap_list_
virtual bool Resync(DBEntry *entry, const DBRequest *req)
bool HasVmInterface(const VmInterface *vmi) const
virtual void SetKey(const DBRequestKey *key)
virtual KeyPtr GetDBRequestKey() const =0
virtual bool ChangeEntry(const DBRequest *req)
EcmpHashFields comp_ecmp_hash_fields_
ComponentNHList component_nh_list_
bool Compare(const TunnelType &rhs) const
static Type ComputeType(TypeBmap bmap)
void CreateTunnelNH(Agent *agent)
bool crypt_tunnel_available_
const MacAddress & rewrite_dmac() const
virtual void Change(const DBRequest *req)
boost::asio::ip::address_v4 Ip4Address
const AgentRoute * GetRt() const
DependencyRef< NextHop, AgentRoute > arp_rt_
virtual bool ChangeEntry(const DBRequest *req)=0
bool flood_unknown_unicast_
const IpAddress * GetSip() const
static const uint32_t kInvalidLabel
static void DeleteNH(const boost::uuids::uuid &intf_uuid, bool policy, uint8_t flags, const MacAddress &mac, const std::string &intf_name)
VrfTable * vrf_table() const
static void FillComponentNextHop(const CompositeNH *comp_nh, std::vector< McastData > &list)
virtual KeyPtr GetDBRequestKey() const =0
ComponentNHList::const_iterator begin() const
virtual KeyPtr GetDBRequestKey() const
boost::scoped_ptr< InterfaceKey > intf_key_
virtual DBTablePartBase * GetTablePartition(const DBRequestKey *key)
virtual std::unique_ptr< DBEntry > GetEntry(const DBRequestKey *key) const
void set_vr_limits_exceeded_map(VrLimitExceeded &vr_limit_exceed_map)
MirrorNH(const VrfKey &vkey, const IpAddress &sip, uint16_t sport, const IpAddress &dip, uint16_t dport)
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
void set_tunnel_type(TunnelType tunnel_type)
bool layer2_control_word_
bool ExpandLocalCompositeNH(Agent *agent)
PBBNH(VrfEntry *vrf, const MacAddress &dmac, uint32_t isid)
virtual NextHop * AllocEntry() const
virtual NextHop * AllocEntry() const
static void DeletePhysicalInterfaceNh(const string &ifname, const MacAddress &mac)
virtual bool NextHopIsLess(const DBEntry &rhs) const
TunnelType::Type transport_tunnel_type_
const MacAddress & GetDMac() const
static void CreatePacketInterfaceNh(Agent *agent, const string &ifname)
const uint16_t GetDPort() const
static void CreatePhysicalInterfaceNh(const string &ifname, const MacAddress &mac)
LabelledTunnelNH(VrfEntry *vrf, const Ip4Address &sip, const Ip4Address &dip, bool policy, TunnelType type, const MacAddress &rewrite_dmac, uint32_t label)
const Interface * crypt_interface() const
bool IsLess(const TunnelType &rhs) const
void RemoveUnresolvedNH(const NextHop *)
virtual bool CanAdd() const
static void DeleteInetInterfaceNextHop(const string &ifname, const MacAddress &mac)
IndexVector< NextHop * > index_table_
const VrfEntry * GetVrf() const
void Process(DBRequest &req)
bool layer2_control_word_
ComponentNHKeyList::const_iterator begin() const
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
VrLimitExceeded & get_vr_limits_exceeded_map()
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
void FillObjectLog(AgentLogEvent::type event, NextHopObjectLogInfo &info) const
virtual bool CanAdd() const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
virtual KeyPtr GetDBRequestKey() const
const boost::uuids::uuid & GetIfUuid() const
bool IsFieldsInUseChanged()
VrfEntry * forwarding_vrf() const
bool Reorder(Agent *agent, uint32_t label, const NextHop *nh)
#define LOG(_Level, _Msg)
CompositeNH * ChangeTunnelType(Agent *agent, TunnelType::Type type) const
void AddWithoutAlloc(DBEntry *entry)
virtual bool CanAdd() const =0
MplsLabel * FindMplsLabel(uint32_t label)
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
void FreeInterfaceId(size_t index)
virtual void OnZeroRefCount()
bool layer2_control_word_
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
boost::shared_ptr< EncapData > EncapDataPtr
const std::string & name() const
const uint8_t * GetData() const
bool GetIndex(ComponentNH &nh, uint32_t &idx) const
const Interface * get_interface() const
static const MacAddress & pkt_interface_mac()
const uint32_t vrf_id() const
NextHopConstRef child_nh_
bool PolicyEnabled() const
void erase(ComponentNHKeyPtr nh_key)
const NextHopKey * nh_key() const
std::vector< ComponentNHPtr > ComponentNHList
void ChangeTunnelType(TunnelType::Type tunnel_type)
void SetPolicy(bool policy)
static void DeleteL3InterfaceNH(const boost::uuids::uuid &intf_uuid, const MacAddress &mac, const std::string &intf_name)
ComponentNHKeyList component_nh_key_list_
const NextHop * GetNH(uint32_t idx) const
bool find(ComponentNHKeyPtr nh_key)
ComponentNHList::const_iterator end() const
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
const VrfEntry * vrf() const
void reset(ObjectType *ptr)
void AddUnresolvedNH(const NextHop *)
virtual void OnZeroRefcount(AgentDBEntry *e)
boost::scoped_ptr< InterfaceKey > intf_key_
InterfaceConstRef interface_
boost::shared_ptr< const ComponentNH > ComponentNHPtr
virtual KeyPtr GetDBRequestKey() const
const IpAddress * GetDip() const
const Interface * GetInterface() const
const ComponentNHKeyList & component_nh_key_list() const
virtual bool ChangeEntry(const DBRequest *req)
bool is_multicastNH() const
VrfEntry * FindVrfEntry(const VrfKey &key) const
virtual void SendObjectLog(const NextHopTable *table, AgentLogEvent::type event) const
COMPOSITETYPE composite_nh_type_
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
virtual bool NextHopIsLess(const DBEntry &rhs) const
const Interface * GetCryptInterface() const
AgentRoute * tunnel_dst_rt_
void SetHashFieldstoUse()
void CheckVrNexthopLimit()
virtual bool NeedMplsLabel()
const MacAddress dest_bmac() const
virtual bool DeleteOnZeroRefCount() const
virtual NextHop * AllocEntry() const
boost::scoped_ptr< InterfaceKey > intf_key_
const SecurityGroupList & sg_list() 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 ChangeEntry(const DBRequest *req)
bool flood_unknown_unicast() const
const boost::uuids::uuid & GetIfUuid() const
virtual KeyPtr GetDBRequestKey() const
virtual bool CanAdd() const
virtual uint32_t GetActiveLabel() const
const ComponentNHKeyList & component_nh_key_list() const
virtual void SetKey(const DBRequestKey *key)