|
OpenSDN source code
|
#include <service_chaining.h>


Public Types | |
| typedef T::RouteT | RouteT |
| typedef T::VpnRouteT | VpnRouteT |
| typedef T::PrefixT | PrefixT |
| typedef T::AddressT | AddressT |
| typedef ServiceChainRequest< T > | ServiceChainRequestT |
| typedef ServiceChainMgr< T > | ServiceChainMgrT |
| typedef std::set< BgpRoute * > | RouteList |
| typedef std::map< PrefixT, RouteList > | PrefixToRouteListMap |
| typedef std::set< BgpRoute * > | ExtConnectRouteList |
| typedef std::set< uint32_t > | ConnectedPathIdList |
Private Member Functions | |
| bool | IsMoreSpecific (BgpRoute *route, PrefixT *aggregate_match) const |
| bool | IsAggregate (BgpRoute *route) const |
| bool | IsConnectedRoute (BgpRoute *route, bool is_conn_table=false) const |
| bool | IsEvpnType5Route (BgpRoute *route) const |
| void | GetReplicationFamilyInfo (DBTablePartition *&partition, BgpRoute *&route, BgpTable *&table, PrefixT prefix, bool create) |
| void | ProcessServiceChainPath (uint32_t path_id, BgpPath *path, BgpAttrPtr attr, BgpRoute *&route, DBTablePartition *&partition, bool aggregate, BgpTable *bgptable) |
| void | UpdateServiceChainRouteInternal (const RouteT *orig_route, const ConnectedPathIdList &old_path_ids, BgpRoute *sc_route, DBTablePartition *partition, BgpTable *bgptable, bool aggregate) |
| void | DeleteServiceChainRouteInternal (BgpRoute *service_chain_route, DBTablePartition *partition, BgpTable *bgptable, bool aggregate) |
| DISALLOW_COPY_AND_ASSIGN (ServiceChain) | |
Definition at line 124 of file service_chaining.h.
| typedef T::AddressT ServiceChain< T >::AddressT |
Definition at line 129 of file service_chaining.h.
| typedef std::set<uint32_t> ServiceChain< T >::ConnectedPathIdList |
Definition at line 143 of file service_chaining.h.
| typedef std::set<BgpRoute *> ServiceChain< T >::ExtConnectRouteList |
Definition at line 140 of file service_chaining.h.
| typedef T::PrefixT ServiceChain< T >::PrefixT |
Definition at line 128 of file service_chaining.h.
| typedef std::map<PrefixT, RouteList> ServiceChain< T >::PrefixToRouteListMap |
Definition at line 137 of file service_chaining.h.
| typedef std::set<BgpRoute *> ServiceChain< T >::RouteList |
Definition at line 134 of file service_chaining.h.
| typedef T::RouteT ServiceChain< T >::RouteT |
Definition at line 126 of file service_chaining.h.
| typedef ServiceChainMgr<T> ServiceChain< T >::ServiceChainMgrT |
Definition at line 131 of file service_chaining.h.
| typedef ServiceChainRequest<T> ServiceChain< T >::ServiceChainRequestT |
Definition at line 130 of file service_chaining.h.
| typedef T::VpnRouteT ServiceChain< T >::VpnRouteT |
Definition at line 127 of file service_chaining.h.
| ServiceChain< T >::ServiceChain | ( | ServiceChainMgrT * | manager, |
| ServiceChainGroup * | group, | ||
| RoutingInstance * | src, | ||
| RoutingInstance * | dest, | ||
| RoutingInstance * | connected, | ||
| const std::vector< std::string > & | subnets, | ||
| AddressT | addr, | ||
| bool | head, | ||
| bool | retain_as_path | ||
| ) |
For EVPN, need to construct EVPN prefix from IPv4 or IPv6 subnet. Make sure AF in prefix matches service_chain AF.
Definition at line 266 of file service_chaining.cc.

| bool ServiceChain< T >::AddMoreSpecific | ( | PrefixT | aggregate, |
| BgpRoute * | more_specific | ||
| ) |
Definition at line 1089 of file service_chaining.cc.
|
inline |
Definition at line 222 of file service_chaining.h.
|
inline |
Definition at line 184 of file service_chaining.h.
| bool ServiceChain< T >::CompareServiceChainConfig | ( | const ServiceChainConfig & | config | ) |
|
inline |
Definition at line 167 of file service_chaining.h.
|
inline |
Definition at line 169 of file service_chaining.h.
| BgpTable * ServiceChain< T >::connected_table |
Definition at line 320 of file service_chaining.cc.
|
inline |
Definition at line 208 of file service_chaining.h.
| bool ServiceChain< T >::DeleteMoreSpecific | ( | PrefixT | aggregate, |
| BgpRoute * | more_specific | ||
| ) |
Definition at line 1104 of file service_chaining.cc.
| void ServiceChain< T >::DeleteServiceChainRoute | ( | PrefixT | prefix, |
| bool | aggregate | ||
| ) |
|
private |
|
inline |
Definition at line 170 of file service_chaining.h.
| BgpTable * ServiceChain< T >::dest_table |
Definition at line 325 of file service_chaining.cc.
|
inline |
Definition at line 205 of file service_chaining.h.
|
private |
|
inline |
Definition at line 218 of file service_chaining.h.
|
inline |
Definition at line 215 of file service_chaining.h.
| void ServiceChain< T >::FillServiceChainInfo | ( | ShowServicechainInfo * | info | ) | const |
|
inline |
|
inline |
Definition at line 163 of file service_chaining.h.
|
inline |
|
private |
Replicate prefix received at head-end of service chain to appropriate
EVPN INET InetTable EVPN INET6 Inet6Table INET INET EvpnTable
| partition | - Reference to DBTablePartition where the service-chain route is to be replicated |
| route | - Reference to service-chain route |
| table | - Reference to BgpTable where service-chain route is to be replicated |
| prefix | - Prefix |
| create | - when "true" indicates that route should be created if not found and |
EVPN prefix received at head end of service-chain. Replicate route to <vrf>.inet[6] table depending on whether the EVPN prefix carries inet[6] traffic.
EVPN route carrying inet prefix
Create case. Create route if not found.
EVPN route carrying inet6 prefix
Create case. Create route if not found.
INET/INET6 prefix at head end of service-chain. Replicate route to <vrf>.evpn.0 table.
Create case. Create route if not found.
Definition at line 87 of file service_chaining.cc.

|
inline |
|
inline |
Definition at line 183 of file service_chaining.h.
|
inline |
Definition at line 226 of file service_chaining.h.
|
inline |
Definition at line 223 of file service_chaining.h.
|
private |
Definition at line 554 of file service_chaining.cc.
|
private |
Check if route belongs to connected table. For EVPN, connected routes could belong to INET or INET6 AF. For routes in the destination table we can use template AF.
Non-EVPN and EVPN destination table case
Definition at line 571 of file service_chaining.cc.

| bool ServiceChain< T >::IsConnectedRouteValid |
Definition at line 533 of file service_chaining.cc.
|
private |
Check if EVPN route being re-originated is Type 5 Also make sure that the address-family of the prefix carried in the EVPN route matches the service-chain family. This will avoid the routes from being re-originated twice.
Definition at line 597 of file service_chaining.cc.

|
private |
Definition at line 538 of file service_chaining.cc.
|
inline |
Definition at line 156 of file service_chaining.h.
|
virtual |
Implements ConditionMatch.
Definition at line 373 of file service_chaining.cc.

|
inline |
Definition at line 186 of file service_chaining.h.
|
inline |
Definition at line 189 of file service_chaining.h.
|
private |
Process service-chain path and add to service-chain route if needed.
| path_id | - PathID |
| path | - Path to be processed |
| attr | - Path attribute |
| route | - Reference to Service-Chain route |
| partition | - Reference to DBTablePartition where the service-chain route is to be replicated |
| aggregate | - "true" indicates aggregate route |
| bgptable | - BgpTable the service-chain route belongs to |
If inserting into EVPN table, the label should the vxlan_id of the connected RI if non-zero and if not, the VNI.
Check if there is an existing path that can be reused.
Remove existing path, new path will be added below.
No existing path or un-usable existing path Create new path and insert into service-chain route
Definition at line 180 of file service_chaining.cc.

| void ServiceChain< T >::RemoveMatchState | ( | BgpRoute * | route, |
| ServiceChainState * | state | ||
| ) |
|
inline |
Definition at line 224 of file service_chaining.h.
|
inline |
Definition at line 171 of file service_chaining.h.
|
inline |
Definition at line 225 of file service_chaining.h.
|
inline |
Definition at line 199 of file service_chaining.h.
|
inline |
Definition at line 202 of file service_chaining.h.
|
inline |
Definition at line 227 of file service_chaining.h.
| void ServiceChain< T >::SetConnectedRoute | ( | BgpRoute * | connected | ) |
|
inline |
Definition at line 168 of file service_chaining.h.
| BgpTable * ServiceChain< T >::src_table |
Definition at line 315 of file service_chaining.cc.
|
virtual |
Implements ConditionMatch.
Definition at line 503 of file service_chaining.cc.
|
inline |
Definition at line 211 of file service_chaining.h.
| void ServiceChain< T >::UpdateServiceChainRoute | ( | PrefixT | prefix, |
| const RouteT * | orig_route, | ||
| const ConnectedPathIdList & | old_path_ids, | ||
| bool | aggregate | ||
| ) |
|
private |
Definition at line 798 of file service_chaining.cc.
|
private |
Definition at line 243 of file service_chaining.h.
|
private |
Definition at line 234 of file service_chaining.h.
|
private |
Definition at line 235 of file service_chaining.h.
|
private |
Definition at line 236 of file service_chaining.h.
|
private |
Definition at line 248 of file service_chaining.h.
|
private |
Definition at line 241 of file service_chaining.h.
|
private |
Definition at line 233 of file service_chaining.h.
|
private |
Definition at line 247 of file service_chaining.h.
|
private |
Definition at line 242 of file service_chaining.h.
|
private |
Definition at line 239 of file service_chaining.h.
|
private |
Definition at line 231 of file service_chaining.h.
|
private |
Definition at line 240 of file service_chaining.h.
|
private |
Definition at line 230 of file service_chaining.h.
|
private |
Definition at line 238 of file service_chaining.h.
|
private |
Definition at line 245 of file service_chaining.h.
|
private |
Definition at line 244 of file service_chaining.h.
|
private |
Definition at line 237 of file service_chaining.h.
|
private |
Definition at line 232 of file service_chaining.h.
|
private |
Definition at line 246 of file service_chaining.h.