OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
controller_export.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef __CONTROLLER_EXPORT_H__
6 #define __CONTROLLER_EXPORT_H__
7 
8 #include <boost/uuid/uuid_io.hpp>
9 #include <cmn/agent_cmn.h>
10 #include <cmn/agent.h>
11 #include <oper/nexthop.h>
12 #include <oper/agent_path.h>
13 
14 class AgentPath;
15 class EcmpLoadBalance;
16 
17 class RouteExport {
18 public:
19  struct State : DBState {
20  State();
21  virtual ~State() {};
22 
23  bool exported_;
24  bool ingress_replication_exported_; //Used by multicast
25  bool multicast_exported_; //Used by multicast
26  bool force_chg_;
27  uint32_t label_;
28  std::string vn_;
34  //destination and source are valid for tunnel NH.
35  std::string destination_;
36  std::string source_;
39  uint32_t isid_;
41 
42  bool Changed(const AgentRoute *route, const AgentPath *path) const;
43  void Update(const AgentRoute *route, const AgentPath *path);
44  };
46  ~RouteExport();
47 
48  void Notify(const Agent *agent,
49  AgentXmppChannel *bgp_xmpp_peer,
50  bool associate,
52  DBTablePartBase *partition,
53  DBEntryBase *e);
54  void ManagedDelete();
56  void Unregister();
57  bool DeleteState(DBTablePartBase *partition, DBEntryBase *entry);
58 
59  bool MulticastRouteCanDissociate(const AgentRoute *route);
60  static void Walkdone(DBTable::DBTableWalkRef walk_ref, DBTableBase *table,
61  RouteExport *rt);
62  static RouteExport* Init(AgentRouteTable *table,
63  AgentXmppChannel *bgp_xmpp_peer);
64 private:
68  uint32_t state_added_;
69  void MulticastNotify(AgentXmppChannel *bgp_xmpp_peer, bool associate,
70  DBTablePartBase *partition, DBEntryBase *e);
71  void UnicastNotify(AgentXmppChannel *bgp_xmpp_peer,
72  DBTablePartBase *partition, DBEntryBase *e,
74  void SubscribeMulticastRouting(const Agent *agent,
75  AgentXmppChannel *bgp_xmpp_peer,
76  AgentRoute *route,
77  RouteExport::State *state);
79  AgentXmppChannel *bgp_xmpp_peer,
80  AgentRoute *route,
81  RouteExport::State *state);
84 };
85 
86 #endif // __CONTROLLER_EXPORT_H__
uint32_t TypeBmap
Definition: nexthop.h:248
void MulticastNotify(AgentXmppChannel *bgp_xmpp_peer, bool associate, DBTablePartBase *partition, DBEntryBase *e)
bool DeleteState(DBTablePartBase *partition, DBEntryBase *entry)
bool MulticastRouteCanDissociate(const AgentRoute *route)
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge, EVPN (Type2/Type5). This base class contains common code for all types of route tables.
Definition: agent_route.h:109
TunnelType::Type tunnel_type_
static void Walkdone(DBTable::DBTableWalkRef walk_ref, DBTableBase *table, RouteExport *rt)
std::vector< int > SecurityGroupList
Definition: agent.h:201
int ListenerId
Definition: db_table.h:62
void Notify(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, bool associate, Agent::RouteTableType type, DBTablePartBase *partition, DBEntryBase *e)
Base class for all Route entries in agent.
Definition: agent_route.h:224
DBTableBase::ListenerId GetListenerId() const
PathPreference path_preference_
AgentRouteTable * rt_table_
std::string destination_
bool Changed(const AgentRoute *route, const AgentPath *path) const
void SubscribeMulticastRouting(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
void UnicastNotify(AgentXmppChannel *bgp_xmpp_peer, DBTablePartBase *partition, DBEntryBase *e, Agent::RouteTableType type)
uint8_t type
Definition: load_balance.h:109
Definition: agent.h:358
void SubscribeIngressReplication(Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
uint32_t state_added_
void Update(const AgentRoute *route, const AgentPath *path)
std::vector< std::string > CommunityList
Definition: bgp_config.h:347
LifetimeRef< RouteExport > table_delete_ref_
CommunityList communities_
SecurityGroupList sg_list_
DBTable::DBTableWalkRef walk_ref_
EcmpLoadBalance ecmp_load_balance_
RouteExport(AgentRouteTable *rt)
static RouteExport * Init(AgentRouteTable *table, AgentXmppChannel *bgp_xmpp_peer)
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:169
RouteTableType
Definition: agent.h:415
TunnelType::TypeBmap tunnel_bmap_
DBTableBase::ListenerId id_
std::vector< int > TagList
Definition: agent.h:202