@@ -27,12 +27,13 @@ extern sai_object_id_t gVirtualRouterId;
27
27
const request_description_t vnet_request_description = {
28
28
{ REQ_T_STRING },
29
29
{
30
- { " src_mac" , REQ_T_MAC_ADDRESS },
31
- { " vxlan_tunnel" , REQ_T_STRING },
32
- { " vni" , REQ_T_UINT },
33
- { " peer_list" , REQ_T_SET },
34
- { " guid" , REQ_T_STRING },
35
- { " scope" , REQ_T_STRING },
30
+ { " src_mac" , REQ_T_MAC_ADDRESS },
31
+ { " vxlan_tunnel" , REQ_T_STRING },
32
+ { " vni" , REQ_T_UINT },
33
+ { " peer_list" , REQ_T_SET },
34
+ { " guid" , REQ_T_STRING },
35
+ { " scope" , REQ_T_STRING },
36
+ { " advertise_prefix" , REQ_T_BOOL},
36
37
},
37
38
{ " vxlan_tunnel" , " vni" } // mandatory attributes
38
39
};
@@ -57,6 +58,7 @@ struct VNetInfo
57
58
uint32_t vni;
58
59
set<string> peers;
59
60
string scope;
61
+ bool advertise_prefix;
60
62
};
61
63
62
64
typedef map<VR_TYPE, sai_object_id_t > vrid_list_t ;
@@ -83,7 +85,8 @@ class VNetObject
83
85
tunnel_ (vnetInfo.tunnel),
84
86
peer_list_ (vnetInfo.peers),
85
87
vni_ (vnetInfo.vni),
86
- scope_ (vnetInfo.scope)
88
+ scope_ (vnetInfo.scope),
89
+ advertise_prefix_ (vnetInfo.advertise_prefix)
87
90
{ }
88
91
89
92
virtual bool updateObj (vector<sai_attribute_t >&) = 0;
@@ -113,13 +116,19 @@ class VNetObject
113
116
return scope_;
114
117
}
115
118
119
+ bool getAdvertisePrefix () const
120
+ {
121
+ return advertise_prefix_;
122
+ }
123
+
116
124
virtual ~VNetObject () noexcept (false ) {};
117
125
118
126
private:
119
127
set<string> peer_list_ = {};
120
128
string tunnel_;
121
129
uint32_t vni_;
122
130
string scope_;
131
+ bool advertise_prefix_;
123
132
};
124
133
125
134
struct nextHop
@@ -223,6 +232,11 @@ class VNetOrch : public Orch2
223
232
return vnet_table_.at (name)->getTunnelName ();
224
233
}
225
234
235
+ bool getAdvertisePrefix (const std::string& name) const
236
+ {
237
+ return vnet_table_.at (name)->getAdvertisePrefix ();
238
+ }
239
+
226
240
bool isVnetExecVrf () const
227
241
{
228
242
return (vnet_exec_ == VNET_EXEC::VNET_EXEC_VRF);
@@ -338,6 +352,8 @@ class VNetRouteOrch : public Orch2, public Subject, public Observer
338
352
void delEndpointMonitor (const string& vnet, NextHopGroupKey& nexthops);
339
353
void postRouteState (const string& vnet, IpPrefix& ipPrefix, NextHopGroupKey& nexthops);
340
354
void removeRouteState (const string& vnet, IpPrefix& ipPrefix);
355
+ void addRouteAdvertisement (IpPrefix& ipPrefix);
356
+ void removeRouteAdvertisement (IpPrefix& ipPrefix);
341
357
342
358
void updateVnetTunnel (const BfdUpdate&);
343
359
bool updateTunnelRoute (const string& vnet, IpPrefix& ipPrefix, NextHopGroupKey& nexthops, string& op);
@@ -362,6 +378,7 @@ class VNetRouteOrch : public Orch2, public Subject, public Observer
362
378
ProducerStateTable bfd_session_producer_;
363
379
shared_ptr<DBConnector> state_db_;
364
380
unique_ptr<Table> state_vnet_rt_tunnel_table_;
381
+ unique_ptr<Table> state_vnet_rt_adv_table_;
365
382
};
366
383
367
384
class VNetCfgRouteOrch : public Orch
0 commit comments