OpenSDN source code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inetvpn_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_BGP_L3VPN_INETVPN_TABLE_H_
6 #define SRC_BGP_L3VPN_INETVPN_TABLE_H_
7 
8 #include <string>
9 
10 #include "bgp/bgp_attr.h"
11 #include "bgp/bgp_table.h"
14 
15 class BgpServer;
16 class BgpRoute;
17 
18 class InetVpnTable : public BgpTable {
19 public:
21  RequestKey(const InetVpnPrefix &prefix, const IPeer *ipeer)
22  : prefix(prefix), peer(ipeer) {
23  }
25  const IPeer *peer;
26  virtual const IPeer *GetPeer() const { return peer; }
27  };
28 
29  InetVpnTable(DB *db, const std::string &name);
30 
31  virtual std::unique_ptr<DBEntry> AllocEntry(const DBRequestKey *key) const;
32  virtual std::unique_ptr<DBEntry> AllocEntryStr(const std::string &key) const;
33 
34  virtual Address::Family family() const { return Address::INETVPN; }
35  virtual bool IsVpnTable() const { return true; }
36 
37  virtual size_t Hash(const DBEntry *entry) const;
38  virtual size_t Hash(const DBRequestKey *key) const;
39 
40  virtual BgpRoute *RouteReplicate(BgpServer *server, BgpTable *src_table,
41  BgpRoute *src_rt, const BgpPath *path,
42  ExtCommunityPtr ptr);
43 
44  virtual bool Export(RibOut *ribout, Route *route,
45  const RibPeerSet &peerset,
46  UpdateInfoSList &info_slist);
47  static DBTableBase *CreateTable(DB *db, const std::string &name);
48  virtual BgpRoute *TableFind(DBTablePartition *rtp,
49  const DBRequestKey *prefix);
50 
51 private:
52 
54 };
55 
56 #endif // SRC_BGP_L3VPN_INETVPN_TABLE_H_
virtual bool IsVpnTable() const
Definition: inetvpn_table.h:35
virtual Address::Family family() const
Definition: inetvpn_table.h:34
InetVpnTable(DB *db, const std::string &name)
Family
Definition: address.h:24
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *key) const
Definition: route.h:14
DISALLOW_COPY_AND_ASSIGN(InetVpnTable)
virtual BgpRoute * TableFind(DBTablePartition *rtp, const DBRequestKey *prefix)
RequestKey(const InetVpnPrefix &prefix, const IPeer *ipeer)
Definition: inetvpn_table.h:21
Definition: ipeer.h:186
Definition: db.h:24
boost::intrusive_ptr< const ExtCommunity > ExtCommunityPtr
Definition: community.h:448
const std::string & name() const
Definition: db_table.h:110
virtual std::unique_ptr< DBEntry > AllocEntryStr(const std::string &key) const
BgpServer * server()
Definition: bgp_table.cc:88
virtual BgpRoute * RouteReplicate(BgpServer *server, BgpTable *src_table, BgpRoute *src_rt, const BgpPath *path, ExtCommunityPtr ptr)
static DBTableBase * CreateTable(DB *db, const std::string &name)
virtual bool Export(RibOut *ribout, Route *route, const RibPeerSet &peerset, UpdateInfoSList &info_slist)
virtual const IPeer * GetPeer() const
Definition: inetvpn_table.h:26
virtual size_t Hash(const DBEntry *entry) const