OpenSDN source code
ServiceChainMgr< T > Class Template Reference

#include <service_chaining.h>

Inheritance diagram for ServiceChainMgr< T >:
Collaboration diagram for ServiceChainMgr< T >:

Classes

class  DeleteActor
 
struct  PendingChainState
 

Public Types

typedef T::RouteT RouteT
 
typedef T::PrefixT PrefixT
 
typedef T::AddressT AddressT
 
typedef ServiceChain< T > ServiceChainT
 
typedef ServiceChainRequest< T > ServiceChainRequestT
 

Public Member Functions

 ServiceChainMgr (BgpServer *server)
 
virtual ~ServiceChainMgr ()
 
void Terminate ()
 
void ManagedDelete ()
 
bool MayDelete () const
 
void RetryDelete ()
 
virtual bool LocateServiceChain (RoutingInstance *rtinstance, const ServiceChainConfig &config)
 
virtual void StopServiceChain (RoutingInstance *rtinstance)
 
virtual void UpdateServiceChain (RoutingInstance *rtinstance, bool group_oper_state_up)
 
void UpdateServiceChainGroup (ServiceChainGroup *group)
 
virtual size_t PendingQueueSize () const
 
virtual size_t ResolvedQueueSize () const
 
virtual uint32_t GetDownServiceChainCount () const
 
virtual bool IsQueueEmpty () const
 
virtual bool ServiceChainIsPending (RoutingInstance *rtinstance, std::string *reason=NULL) const
 
virtual bool ServiceChainIsUp (RoutingInstance *rtinstance) const
 
Address::Family GetFamily () const
 
Address::Family GetConnectedFamily () const
 
SCAddress::Family GetSCFamily () const
 
void Enqueue (ServiceChainRequestT *req)
 
virtual bool FillServiceChainInfo (RoutingInstance *rtinstance, ShowServicechainInfo *info) const
 
virtual BgpConditionListenerGetListener ()
 
Address::Family GetFamily () const
 
Address::Family GetFamily () const
 
Address::Family GetFamily () const
 
Address::Family GetFamily () const
 
Address::Family GetConnectedFamily () const
 
Address::Family GetConnectedFamily () const
 
Address::Family GetConnectedFamily () const
 
Address::Family GetConnectedFamily () const
 
SCAddress::Family GetSCFamily () const
 
SCAddress::Family GetSCFamily () const
 
SCAddress::Family GetSCFamily () const
 
SCAddress::Family GetSCFamily () const
 
void Enqueue (ServiceChainRequestT *req)
 
- Public Member Functions inherited from IServiceChainMgr
virtual ~IServiceChainMgr ()
 

Private Types

typedef std::map< RoutingInstance *, ServiceChainPtrServiceChainMap
 
typedef std::map< RoutingInstance *, PendingChainStatePendingChainList
 
typedef boost::ptr_map< std::string, ServiceChainGroupGroupMap
 
typedef std::set< ServiceChainGroup * > GroupSet
 

Private Member Functions

ServiceChainGroupFindServiceChainGroup (RoutingInstance *rtinstance)
 
ServiceChainGroupFindServiceChainGroup (const std::string &group_name)
 
ServiceChainGroupLocateServiceChainGroup (const std::string &group_name)
 
bool ProcessServiceChainGroups ()
 
bool RequestHandler (ServiceChainRequestT *req)
 
void StopServiceChainDone (BgpTable *table, ConditionMatch *info)
 
ServiceChainTFindServiceChain (const std::string &instance) const
 
ServiceChainTFindServiceChain (RoutingInstance *rtinstance) const
 
void AddPendingServiceChain (RoutingInstance *rtinstance, ServiceChainGroup *group, std::string reason)
 
void DeletePendingServiceChain (RoutingInstance *rtinstance)
 
PendingChainState GetPendingServiceChain (RoutingInstance *rtinstance)
 
void UpdateServiceChainRoutes (ServiceChainT *chain, const typename ServiceChainT::ConnectedPathIdList &old_path_ids)
 
void DeleteServiceChainRoutes (ServiceChainT *chain)
 
void StartResolve ()
 
bool ResolvePendingServiceChain ()
 
void RoutingInstanceCallback (std::string name, int op)
 
void PeerRegistrationCallback (IPeer *peer, BgpTable *table, bool unregister)
 
bool aggregate_host_route () const
 
virtual void set_aggregate_host_route (bool value)
 
virtual void DisableResolveTrigger ()
 
virtual void EnableResolveTrigger ()
 
virtual void DisableGroupTrigger ()
 
virtual void EnableGroupTrigger ()
 
virtual void DisableQueue ()
 
virtual void EnableQueue ()
 
 DISALLOW_COPY_AND_ASSIGN (ServiceChainMgr)
 
int service_chain_task_id_
 
int service_chain_task_id_
 
int service_chain_task_id_
 
int service_chain_task_id_
 

Private Attributes

BgpServerserver_
 
tbb::mutex mutex_
 
BgpConditionListenerlistener_
 
boost::scoped_ptr< TaskTriggerresolve_trigger_
 
boost::scoped_ptr< WorkQueue< ServiceChainRequestT * > > process_queue_
 
ServiceChainMap chain_set_
 
PendingChainList pending_chains_
 
boost::scoped_ptr< TaskTriggergroup_trigger_
 
GroupMap group_map_
 
GroupSet group_set_
 
bool aggregate_host_route_
 
int id_
 
int registration_id_
 
boost::scoped_ptr< DeleteActordeleter_
 
LifetimeRef< ServiceChainMgrserver_delete_ref_
 

Static Private Attributes

static int service_chain_task_id_
 

Friends

template<typename U >
class ServiceChainIntegrationTest
 
template<typename U >
class ServiceChainTest
 

Detailed Description

template<typename T>
class ServiceChainMgr< T >

Definition at line 319 of file service_chaining.h.

Member Typedef Documentation

◆ AddressT

template<typename T >
typedef T::AddressT ServiceChainMgr< T >::AddressT

Definition at line 323 of file service_chaining.h.

◆ GroupMap

template<typename T >
typedef boost::ptr_map<std::string, ServiceChainGroup> ServiceChainMgr< T >::GroupMap
private

Definition at line 391 of file service_chaining.h.

◆ GroupSet

template<typename T >
typedef std::set<ServiceChainGroup *> ServiceChainMgr< T >::GroupSet
private

Definition at line 392 of file service_chaining.h.

◆ PendingChainList

template<typename T >
typedef std::map<RoutingInstance *, PendingChainState> ServiceChainMgr< T >::PendingChainList
private

Definition at line 389 of file service_chaining.h.

◆ PrefixT

template<typename T >
typedef T::PrefixT ServiceChainMgr< T >::PrefixT

Definition at line 322 of file service_chaining.h.

◆ RouteT

template<typename T >
typedef T::RouteT ServiceChainMgr< T >::RouteT

Definition at line 321 of file service_chaining.h.

◆ ServiceChainMap

template<typename T >
typedef std::map<RoutingInstance *, ServiceChainPtr> ServiceChainMgr< T >::ServiceChainMap
private

Definition at line 382 of file service_chaining.h.

◆ ServiceChainRequestT

template<typename T >
typedef ServiceChainRequest<T> ServiceChainMgr< T >::ServiceChainRequestT

Definition at line 325 of file service_chaining.h.

◆ ServiceChainT

template<typename T >
typedef ServiceChain<T> ServiceChainMgr< T >::ServiceChainT

Definition at line 324 of file service_chaining.h.

Constructor & Destructor Documentation

◆ ServiceChainMgr()

template<typename T >
ServiceChainMgr< T >::ServiceChainMgr ( BgpServer server)
explicit

Definition at line 1419 of file service_chaining.cc.

Here is the call graph for this function:

◆ ~ServiceChainMgr()

template<typename T >
ServiceChainMgr< T >::~ServiceChainMgr
virtual

Definition at line 1449 of file service_chaining.cc.

Member Function Documentation

◆ AddPendingServiceChain()

template<typename T >
void ServiceChainMgr< T >::AddPendingServiceChain ( RoutingInstance rtinstance,
ServiceChainGroup group,
std::string  reason 
)
inlineprivate

Definition at line 404 of file service_chaining.h.

◆ aggregate_host_route()

template<typename T >
bool ServiceChainMgr< T >::aggregate_host_route ( ) const
inlineprivate

Definition at line 432 of file service_chaining.h.

◆ DeletePendingServiceChain()

template<typename T >
void ServiceChainMgr< T >::DeletePendingServiceChain ( RoutingInstance rtinstance)
inlineprivate

Definition at line 409 of file service_chaining.h.

◆ DeleteServiceChainRoutes()

template<typename T >
void ServiceChainMgr< T >::DeleteServiceChainRoutes ( ServiceChainT chain)
private

Definition at line 1964 of file service_chaining.cc.

Here is the call graph for this function:

◆ DisableGroupTrigger()

template<typename T >
void ServiceChainMgr< T >::DisableGroupTrigger
privatevirtual

Implements IServiceChainMgr.

Definition at line 2014 of file service_chaining.cc.

◆ DisableQueue()

template<typename T >
virtual void ServiceChainMgr< T >::DisableQueue ( )
inlineprivatevirtual

Implements IServiceChainMgr.

Definition at line 445 of file service_chaining.h.

◆ DisableResolveTrigger()

template<typename T >
void ServiceChainMgr< T >::DisableResolveTrigger
privatevirtual

Implements IServiceChainMgr.

Definition at line 2004 of file service_chaining.cc.

◆ DISALLOW_COPY_AND_ASSIGN()

template<typename T >
ServiceChainMgr< T >::DISALLOW_COPY_AND_ASSIGN ( ServiceChainMgr< T >  )
private

◆ EnableGroupTrigger()

template<typename T >
void ServiceChainMgr< T >::EnableGroupTrigger
privatevirtual

Implements IServiceChainMgr.

Definition at line 2019 of file service_chaining.cc.

◆ EnableQueue()

template<typename T >
virtual void ServiceChainMgr< T >::EnableQueue ( )
inlineprivatevirtual

Implements IServiceChainMgr.

Definition at line 446 of file service_chaining.h.

◆ EnableResolveTrigger()

template<typename T >
void ServiceChainMgr< T >::EnableResolveTrigger
privatevirtual

Implements IServiceChainMgr.

Definition at line 2009 of file service_chaining.cc.

◆ Enqueue() [1/2]

void ServiceChainMgr< T >::Enqueue ( ServiceChainRequestT req)

Definition at line 1618 of file service_chaining.cc.

◆ Enqueue() [2/2]

template<typename T >
void ServiceChainMgr< T >::Enqueue ( ServiceChainRequestT req)

◆ FillServiceChainInfo()

template<typename T >
bool ServiceChainMgr< T >::FillServiceChainInfo ( RoutingInstance rtinstance,
ShowServicechainInfo *  info 
) const
virtual

Implements IServiceChainMgr.

Definition at line 1646 of file service_chaining.cc.

Here is the call graph for this function:

◆ FindServiceChain() [1/2]

template<typename T >
ServiceChainT* ServiceChainMgr< T >::FindServiceChain ( const std::string &  instance) const
private

◆ FindServiceChain() [2/2]

template<typename T >
ServiceChain< T > * ServiceChainMgr< T >::FindServiceChain ( RoutingInstance rtinstance) const
private

Definition at line 1831 of file service_chaining.cc.

◆ FindServiceChainGroup() [1/2]

template<typename T >
ServiceChainGroup* ServiceChainMgr< T >::FindServiceChainGroup ( const std::string &  group_name)
privatevirtual

Implements IServiceChainMgr.

◆ FindServiceChainGroup() [2/2]

template<typename T >
ServiceChainGroup * ServiceChainMgr< T >::FindServiceChainGroup ( RoutingInstance rtinstance)
privatevirtual

Implements IServiceChainMgr.

Definition at line 1486 of file service_chaining.cc.

Here is the call graph for this function:

◆ GetConnectedFamily() [1/5]

Address::Family ServiceChainMgr< ServiceChainInet >::GetConnectedFamily ( ) const

Connected Table Family. For EVPN, it is INET or INET6.

Definition at line 1574 of file service_chaining.cc.

◆ GetConnectedFamily() [2/5]

Address::Family ServiceChainMgr< ServiceChainInet6 >::GetConnectedFamily ( ) const

Definition at line 1579 of file service_chaining.cc.

◆ GetConnectedFamily() [3/5]

Address::Family ServiceChainMgr< ServiceChainEvpn >::GetConnectedFamily ( ) const

Definition at line 1584 of file service_chaining.cc.

◆ GetConnectedFamily() [4/5]

Address::Family ServiceChainMgr< ServiceChainEvpn6 >::GetConnectedFamily ( ) const

Definition at line 1589 of file service_chaining.cc.

◆ GetConnectedFamily() [5/5]

template<typename T >
Address::Family ServiceChainMgr< T >::GetConnectedFamily ( ) const

◆ GetDownServiceChainCount()

template<typename T >
uint32_t ServiceChainMgr< T >::GetDownServiceChainCount
virtual

Implements IServiceChainMgr.

Definition at line 2024 of file service_chaining.cc.

Here is the call graph for this function:

◆ GetFamily() [1/5]

Address Family - used for GetTable().

Definition at line 1551 of file service_chaining.cc.

◆ GetFamily() [2/5]

Definition at line 1556 of file service_chaining.cc.

◆ GetFamily() [3/5]

Definition at line 1561 of file service_chaining.cc.

◆ GetFamily() [4/5]

Definition at line 1566 of file service_chaining.cc.

◆ GetFamily() [5/5]

template<typename T >
Address::Family ServiceChainMgr< T >::GetFamily ( ) const

◆ GetListener()

template<typename T >
BgpConditionListener * ServiceChainMgr< T >::GetListener
virtual

Get appropriate listener for watching routes. For EVPN connected table, listener will depend on the connected AF

Parameters
addr- service-chain address
is_conn_table- "true" indicates connected table
Returns
- Pointer to BgpConditionListener object

Definition at line 1240 of file service_chaining.cc.

◆ GetPendingServiceChain()

template<typename T >
PendingChainState ServiceChainMgr< T >::GetPendingServiceChain ( RoutingInstance rtinstance)
inlineprivate

Definition at line 412 of file service_chaining.h.

◆ GetSCFamily() [1/5]

Service Chain Family

Definition at line 1597 of file service_chaining.cc.

◆ GetSCFamily() [2/5]

Definition at line 1602 of file service_chaining.cc.

◆ GetSCFamily() [3/5]

Definition at line 1607 of file service_chaining.cc.

◆ GetSCFamily() [4/5]

Definition at line 1612 of file service_chaining.cc.

◆ GetSCFamily() [5/5]

template<typename T >
SCAddress::Family ServiceChainMgr< T >::GetSCFamily ( ) const

◆ IsQueueEmpty()

template<typename T >
virtual bool ServiceChainMgr< T >::IsQueueEmpty ( ) const
inlinevirtual

Implements IServiceChainMgr.

Definition at line 350 of file service_chaining.h.

◆ LocateServiceChain()

template<typename T >
bool ServiceChainMgr< T >::LocateServiceChain ( RoutingInstance rtinstance,
const ServiceChainConfig config 
)
virtual

Get the BGP Tables to add condition For EVPN, connected table will be INET/INET6 depending on whether prefix carried is v4/v6.

Implements IServiceChainMgr.

Definition at line 1664 of file service_chaining.cc.

Here is the call graph for this function:

◆ LocateServiceChainGroup()

template<typename T >
ServiceChainGroup * ServiceChainMgr< T >::LocateServiceChainGroup ( const std::string &  group_name)
private

Definition at line 1505 of file service_chaining.cc.

◆ ManagedDelete()

template<typename T >
void ServiceChainMgr< T >::ManagedDelete
virtual

Implements IServiceChainMgr.

Definition at line 1465 of file service_chaining.cc.

◆ MayDelete()

template<typename T >
bool ServiceChainMgr< T >::MayDelete

Definition at line 1470 of file service_chaining.cc.

◆ PeerRegistrationCallback()

template<typename T >
void ServiceChainMgr< T >::PeerRegistrationCallback ( IPeer peer,
BgpTable table,
bool  unregister 
)
private

Definition at line 1983 of file service_chaining.cc.

Here is the call graph for this function:

◆ PendingQueueSize()

template<typename T >
virtual size_t ServiceChainMgr< T >::PendingQueueSize ( ) const
inlinevirtual

Implements IServiceChainMgr.

Definition at line 347 of file service_chaining.h.

◆ ProcessServiceChainGroups()

template<typename T >
bool ServiceChainMgr< T >::ProcessServiceChainGroups
private

Definition at line 1530 of file service_chaining.cc.

Here is the call graph for this function:

◆ RequestHandler()

template<typename T >
bool ServiceChainMgr< T >::RequestHandler ( ServiceChainRequestT req)
private

Definition at line 1245 of file service_chaining.cc.

Here is the call graph for this function:

◆ ResolvedQueueSize()

template<typename T >
virtual size_t ServiceChainMgr< T >::ResolvedQueueSize ( ) const
inlinevirtual

Implements IServiceChainMgr.

Definition at line 348 of file service_chaining.h.

◆ ResolvePendingServiceChain()

template<typename T >
bool ServiceChainMgr< T >::ResolvePendingServiceChain
private

Definition at line 1841 of file service_chaining.cc.

Here is the call graph for this function:

◆ RetryDelete()

template<typename T >
void ServiceChainMgr< T >::RetryDelete

Definition at line 1479 of file service_chaining.cc.

◆ RoutingInstanceCallback()

template<typename T >
void ServiceChainMgr< T >::RoutingInstanceCallback ( std::string  name,
int  op 
)
private

Definition at line 1862 of file service_chaining.cc.

◆ service_chain_task_id_() [1/4]

int ServiceChainMgr< ServiceChainInet >::service_chain_task_id_
private

Definition at line 36 of file service_chaining.cc.

◆ service_chain_task_id_() [2/4]

int ServiceChainMgr< ServiceChainInet6 >::service_chain_task_id_
private

Definition at line 38 of file service_chaining.cc.

◆ service_chain_task_id_() [3/4]

int ServiceChainMgr< ServiceChainEvpn >::service_chain_task_id_
private

Definition at line 40 of file service_chaining.cc.

◆ service_chain_task_id_() [4/4]

int ServiceChainMgr< ServiceChainEvpn6 >::service_chain_task_id_
private

Definition at line 42 of file service_chaining.cc.

◆ ServiceChainIsPending()

template<typename T >
bool ServiceChainMgr< T >::ServiceChainIsPending ( RoutingInstance rtinstance,
std::string *  reason = NULL 
) const
virtual

Implements IServiceChainMgr.

Definition at line 1623 of file service_chaining.cc.

◆ ServiceChainIsUp()

template<typename T >
bool ServiceChainMgr< T >::ServiceChainIsUp ( RoutingInstance rtinstance) const
virtual

Implements IServiceChainMgr.

Definition at line 1636 of file service_chaining.cc.

Here is the call graph for this function:

◆ set_aggregate_host_route()

template<typename T >
virtual void ServiceChainMgr< T >::set_aggregate_host_route ( bool  value)
inlineprivatevirtual

Implements IServiceChainMgr.

Definition at line 433 of file service_chaining.h.

◆ StartResolve()

template<typename T >
void ServiceChainMgr< T >::StartResolve
private

Definition at line 1868 of file service_chaining.cc.

◆ StopServiceChain()

template<typename T >
void ServiceChainMgr< T >::StopServiceChain ( RoutingInstance rtinstance)
virtual

Implements IServiceChainMgr.

Definition at line 1886 of file service_chaining.cc.

Here is the call graph for this function:

◆ StopServiceChainDone()

template<typename T >
void ServiceChainMgr< T >::StopServiceChainDone ( BgpTable table,
ConditionMatch info 
)
private

Definition at line 1875 of file service_chaining.cc.

◆ Terminate()

template<typename T >
void ServiceChainMgr< T >::Terminate

Definition at line 1455 of file service_chaining.cc.

Here is the call graph for this function:

◆ UpdateServiceChain()

template<typename T >
void ServiceChainMgr< T >::UpdateServiceChain ( RoutingInstance rtinstance,
bool  group_oper_state_up 
)
virtual

Implements IServiceChainMgr.

Definition at line 1919 of file service_chaining.cc.

Here is the call graph for this function:

◆ UpdateServiceChainGroup()

template<typename T >
void ServiceChainMgr< T >::UpdateServiceChainGroup ( ServiceChainGroup group)
virtual

Implements IServiceChainMgr.

Definition at line 1520 of file service_chaining.cc.

◆ UpdateServiceChainRoutes()

template<typename T >
void ServiceChainMgr< T >::UpdateServiceChainRoutes ( ServiceChainT chain,
const typename ServiceChainT::ConnectedPathIdList old_path_ids 
)
private

Definition at line 1942 of file service_chaining.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ServiceChainIntegrationTest

template<typename T >
template<typename U >
friend class ServiceChainIntegrationTest
friend

Definition at line 363 of file service_chaining.h.

◆ ServiceChainTest

template<typename T >
template<typename U >
friend class ServiceChainTest
friend

Definition at line 364 of file service_chaining.h.

Member Data Documentation

◆ aggregate_host_route_

template<typename T >
bool ServiceChainMgr< T >::aggregate_host_route_
private

Definition at line 459 of file service_chaining.h.

◆ chain_set_

template<typename T >
ServiceChainMap ServiceChainMgr< T >::chain_set_
private

Definition at line 454 of file service_chaining.h.

◆ deleter_

template<typename T >
boost::scoped_ptr<DeleteActor> ServiceChainMgr< T >::deleter_
private

Definition at line 462 of file service_chaining.h.

◆ group_map_

template<typename T >
GroupMap ServiceChainMgr< T >::group_map_
private

Definition at line 457 of file service_chaining.h.

◆ group_set_

template<typename T >
GroupSet ServiceChainMgr< T >::group_set_
private

Definition at line 458 of file service_chaining.h.

◆ group_trigger_

template<typename T >
boost::scoped_ptr<TaskTrigger> ServiceChainMgr< T >::group_trigger_
private

Definition at line 456 of file service_chaining.h.

◆ id_

template<typename T >
int ServiceChainMgr< T >::id_
private

Definition at line 460 of file service_chaining.h.

◆ listener_

template<typename T >
BgpConditionListener* ServiceChainMgr< T >::listener_
private

Definition at line 451 of file service_chaining.h.

◆ mutex_

template<typename T >
tbb::mutex ServiceChainMgr< T >::mutex_
private

Definition at line 450 of file service_chaining.h.

◆ pending_chains_

template<typename T >
PendingChainList ServiceChainMgr< T >::pending_chains_
private

Definition at line 455 of file service_chaining.h.

◆ process_queue_

template<typename T >
boost::scoped_ptr<WorkQueue<ServiceChainRequestT *> > ServiceChainMgr< T >::process_queue_
private

Definition at line 453 of file service_chaining.h.

◆ registration_id_

template<typename T >
int ServiceChainMgr< T >::registration_id_
private

Definition at line 461 of file service_chaining.h.

◆ resolve_trigger_

template<typename T >
boost::scoped_ptr<TaskTrigger> ServiceChainMgr< T >::resolve_trigger_
private

Definition at line 452 of file service_chaining.h.

◆ server_

template<typename T >
BgpServer* ServiceChainMgr< T >::server_
private

Definition at line 449 of file service_chaining.h.

◆ server_delete_ref_

template<typename T >
LifetimeRef<ServiceChainMgr> ServiceChainMgr< T >::server_delete_ref_
private

Definition at line 463 of file service_chaining.h.

◆ service_chain_task_id_

template<typename T >
int ServiceChainMgr< T >::service_chain_task_id_
staticprivate

Definition at line 369 of file service_chaining.h.


The documentation for this class was generated from the following files: