OpenSDN source code
controller_export.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef __CONTROLLER_EXPORT_H__
7 #define __CONTROLLER_EXPORT_H__
8 
9 #include <boost/uuid/uuid_io.hpp>
10 #include <cmn/agent_cmn.h>
11 #include <cmn/agent.h>
12 #include <oper/nexthop.h>
13 #include <oper/agent_path.h>
14 
15 class AgentPath;
16 class EcmpLoadBalance;
17 
18 class RouteExport {
19 public:
20  struct State : DBState {
21  State();
22  virtual ~State() {};
23 
24  bool exported_;
25  bool ingress_replication_exported_; //Used by multicast
26  bool multicast_exported_; //Used by multicast
27  bool force_chg_;
28  uint32_t label_;
29  std::string vn_;
35  //destination and source are valid for tunnel NH.
36  std::string destination_;
37  std::string source_;
40  uint32_t isid_;
42 
43  bool Changed(const AgentRoute *route, const AgentPath *path) const;
44  void Update(const AgentRoute *route, const AgentPath *path);
45  };
47  ~RouteExport();
48 
49  void Notify(const Agent *agent,
50  AgentXmppChannel *bgp_xmpp_peer,
51  bool associate,
53  DBTablePartBase *partition,
54  DBEntryBase *e);
55  void ManagedDelete();
57  void Unregister();
58  bool DeleteState(DBTablePartBase *partition, DBEntryBase *entry);
59 
60  bool MulticastRouteCanDissociate(const AgentRoute *route);
61  static void Walkdone(DBTable::DBTableWalkRef walk_ref, DBTableBase *table,
62  RouteExport *rt);
63  static RouteExport* Init(AgentRouteTable *table,
64  AgentXmppChannel *bgp_xmpp_peer);
65 private:
69  uint32_t state_added_;
70  void MulticastNotify(AgentXmppChannel *bgp_xmpp_peer, bool associate,
71  DBTablePartBase *partition, DBEntryBase *e);
72  void UnicastNotify(AgentXmppChannel *bgp_xmpp_peer,
73  DBTablePartBase *partition, DBEntryBase *e,
75  void SubscribeMulticastRouting(const Agent *agent,
76  AgentXmppChannel *bgp_xmpp_peer,
77  AgentRoute *route,
78  RouteExport::State *state);
80  AgentXmppChannel *bgp_xmpp_peer,
81  AgentRoute *route,
82  RouteExport::State *state);
85 };
86 
87 #endif // __CONTROLLER_EXPORT_H__
std::vector< uint64_t > TagList
Definition: agent.h:203
std::vector< int > SecurityGroupList
Definition: agent.h:202
std::vector< std::string > CommunityList
Definition: bgp_config.h:348
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge,...
Definition: agent_route.h:110
Base class for all Route entries in agent.
Definition: agent_route.h:225
Definition: agent.h:361
RouteTableType
Definition: agent.h:418
int ListenerId
Definition: db_table.h:63
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:170
RouteExport(AgentRouteTable *rt)
static RouteExport * Init(AgentRouteTable *table, AgentXmppChannel *bgp_xmpp_peer)
void UnicastNotify(AgentXmppChannel *bgp_xmpp_peer, DBTablePartBase *partition, DBEntryBase *e, Agent::RouteTableType type)
void SubscribeIngressReplication(Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
void SubscribeMulticastRouting(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
DBTable::DBTableWalkRef walk_ref_
void Notify(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, bool associate, Agent::RouteTableType type, DBTablePartBase *partition, DBEntryBase *e)
uint32_t state_added_
AgentRouteTable * rt_table_
bool DeleteState(DBTablePartBase *partition, DBEntryBase *entry)
LifetimeRef< RouteExport > table_delete_ref_
static void Walkdone(DBTable::DBTableWalkRef walk_ref, DBTableBase *table, RouteExport *rt)
DBTableBase::ListenerId id_
DBTableBase::ListenerId GetListenerId() const
void MulticastNotify(AgentXmppChannel *bgp_xmpp_peer, bool associate, DBTablePartBase *partition, DBEntryBase *e)
bool MulticastRouteCanDissociate(const AgentRoute *route)
uint32_t TypeBmap
Definition: nexthop.h:249
uint8_t type
Definition: load_balance.h:2
PathPreference path_preference_
CommunityList communities_
TunnelType::Type tunnel_type_
void Update(const AgentRoute *route, const AgentPath *path)
SecurityGroupList sg_list_
EcmpLoadBalance ecmp_load_balance_
std::string destination_
bool Changed(const AgentRoute *route, const AgentPath *path) const
TunnelType::TypeBmap tunnel_bmap_