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