OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ()
 
template<>
Address::Family GetFamily () const
 
template<>
Address::Family GetFamily () const
 
template<>
Address::Family GetFamily () const
 
template<>
Address::Family GetFamily () const
 
template<>
Address::Family GetConnectedFamily () const
 
template<>
Address::Family GetConnectedFamily () const
 
template<>
Address::Family GetConnectedFamily () const
 
template<>
Address::Family GetConnectedFamily () const
 
template<>
SCAddress::Family GetSCFamily () const
 
template<>
SCAddress::Family GetSCFamily () const
 
template<>
SCAddress::Family GetSCFamily () const
 
template<>
SCAddress::Family GetSCFamily () const
 
template<>
void Enqueue (ServiceChainRequestT *req)
 
- Public Member Functions inherited from IServiceChainMgr
virtual ~IServiceChainMgr ()
 

Private Types

typedef std::map
< RoutingInstance
*, ServiceChainPtr
ServiceChainMap
 
typedef std::map
< RoutingInstance
*, PendingChainState
PendingChainList
 
typedef boost::ptr_map
< std::string,
ServiceChainGroup
GroupMap
 
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)
 
template<>
int service_chain_task_id_
 
template<>
int service_chain_task_id_
 
template<>
int service_chain_task_id_
 
template<>
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 38 of file service_chaining.h.

Member Typedef Documentation

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

Definition at line 323 of file service_chaining.h.

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

Definition at line 391 of file service_chaining.h.

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

Definition at line 392 of file service_chaining.h.

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

Definition at line 389 of file service_chaining.h.

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

Definition at line 322 of file service_chaining.h.

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

Definition at line 321 of file service_chaining.h.

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

Definition at line 382 of file service_chaining.h.

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

Definition at line 325 of file service_chaining.h.

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

Definition at line 324 of file service_chaining.h.

Constructor & Destructor Documentation

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:

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

Definition at line 1449 of file service_chaining.cc.

Member Function Documentation

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

Definition at line 404 of file service_chaining.h.

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

Definition at line 432 of file service_chaining.h.

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

Definition at line 409 of file service_chaining.h.

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:

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

Implements IServiceChainMgr.

Definition at line 2014 of file service_chaining.cc.

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

Implements IServiceChainMgr.

Definition at line 445 of file service_chaining.h.

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

Implements IServiceChainMgr.

Definition at line 2004 of file service_chaining.cc.

template<typename T>
ServiceChainMgr< T >::DISALLOW_COPY_AND_ASSIGN ( ServiceChainMgr< T >  )
private
template<typename T >
void ServiceChainMgr< T >::EnableGroupTrigger ( )
privatevirtual

Implements IServiceChainMgr.

Definition at line 2019 of file service_chaining.cc.

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

Implements IServiceChainMgr.

Definition at line 446 of file service_chaining.h.

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

Implements IServiceChainMgr.

Definition at line 2009 of file service_chaining.cc.

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

Definition at line 1618 of file service_chaining.cc.

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:

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

Definition at line 1831 of file service_chaining.cc.

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:

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

Implements IServiceChainMgr.

template<typename T>
Address::Family ServiceChainMgr< T >::GetConnectedFamily ( ) const
template<>
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.

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

Definition at line 1579 of file service_chaining.cc.

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

Definition at line 1584 of file service_chaining.cc.

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

Definition at line 1589 of file service_chaining.cc.

template<typename T >
uint32_t ServiceChainMgr< T >::GetDownServiceChainCount ( ) const
virtual

Implements IServiceChainMgr.

Definition at line 2024 of file service_chaining.cc.

Here is the call graph for this function:

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

Address Family - used for GetTable().

Definition at line 1551 of file service_chaining.cc.

template<>
Address::Family ServiceChainMgr< ServiceChainInet6 >::GetFamily ( ) const

Definition at line 1556 of file service_chaining.cc.

template<>
Address::Family ServiceChainMgr< ServiceChainEvpn >::GetFamily ( ) const

Definition at line 1561 of file service_chaining.cc.

template<>
Address::Family ServiceChainMgr< ServiceChainEvpn6 >::GetFamily ( ) const

Definition at line 1566 of file service_chaining.cc.

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.

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

Definition at line 412 of file service_chaining.h.

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

Service Chain Family

Definition at line 1597 of file service_chaining.cc.

template<>
SCAddress::Family ServiceChainMgr< ServiceChainInet6 >::GetSCFamily ( ) const

Definition at line 1602 of file service_chaining.cc.

template<>
SCAddress::Family ServiceChainMgr< ServiceChainEvpn >::GetSCFamily ( ) const

Definition at line 1607 of file service_chaining.cc.

template<>
SCAddress::Family ServiceChainMgr< ServiceChainEvpn6 >::GetSCFamily ( ) const

Definition at line 1612 of file service_chaining.cc.

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

Implements IServiceChainMgr.

Definition at line 350 of file service_chaining.h.

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:

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

Definition at line 1505 of file service_chaining.cc.

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

Implements IServiceChainMgr.

Definition at line 1465 of file service_chaining.cc.

template<typename T >
bool ServiceChainMgr< T >::MayDelete ( ) const

Definition at line 1470 of file service_chaining.cc.

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:

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

Implements IServiceChainMgr.

Definition at line 347 of file service_chaining.h.

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:

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:

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

Implements IServiceChainMgr.

Definition at line 348 of file service_chaining.h.

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:

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

Definition at line 1479 of file service_chaining.cc.

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

Definition at line 1862 of file service_chaining.cc.

template<>
int ServiceChainMgr< ServiceChainInet >::service_chain_task_id_ ( )
private

Definition at line 36 of file service_chaining.cc.

template<>
int ServiceChainMgr< ServiceChainInet6 >::service_chain_task_id_ ( )
private

Definition at line 38 of file service_chaining.cc.

template<>
int ServiceChainMgr< ServiceChainEvpn >::service_chain_task_id_ ( )
private

Definition at line 40 of file service_chaining.cc.

template<>
int ServiceChainMgr< ServiceChainEvpn6 >::service_chain_task_id_ ( )
private

Definition at line 42 of file service_chaining.cc.

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.

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:

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.

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

Definition at line 1868 of file service_chaining.cc.

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:

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

Definition at line 1875 of file service_chaining.cc.

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

Definition at line 1455 of file service_chaining.cc.

Here is the call graph for this function:

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:

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

Implements IServiceChainMgr.

Definition at line 1520 of file service_chaining.cc.

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

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

Definition at line 363 of file service_chaining.h.

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

Definition at line 364 of file service_chaining.h.

Member Data Documentation

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

Definition at line 459 of file service_chaining.h.

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

Definition at line 454 of file service_chaining.h.

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

Definition at line 462 of file service_chaining.h.

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

Definition at line 457 of file service_chaining.h.

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

Definition at line 458 of file service_chaining.h.

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

Definition at line 456 of file service_chaining.h.

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

Definition at line 460 of file service_chaining.h.

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

Definition at line 451 of file service_chaining.h.

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

Definition at line 450 of file service_chaining.h.

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

Definition at line 455 of file service_chaining.h.

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

Definition at line 453 of file service_chaining.h.

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

Definition at line 461 of file service_chaining.h.

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

Definition at line 452 of file service_chaining.h.

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

Definition at line 449 of file service_chaining.h.

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

Definition at line 463 of file service_chaining.h.

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

Definition at line 365 of file service_chaining.h.


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