Line data Source code
1 : /* 2 : * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #ifndef SRC_BGP_INET6_INET6_TABLE_H_ 6 : #define SRC_BGP_INET6_INET6_TABLE_H_ 7 : 8 : #include <string> 9 : 10 : #include "bgp/bgp_table.h" 11 : #include "bgp/inet6/inet6_route.h" 12 : #include "base/address.h" 13 : 14 : class Inet6Prefix; 15 : class BgpServer; 16 : class PathResolver; 17 : 18 : class Inet6Table : public BgpTable { 19 : public: 20 : struct RequestKey : BgpTable::RequestKey { 21 210425 : RequestKey(const Inet6Prefix &prefix, const IPeer *ipeer) 22 210425 : : prefix(prefix), peer(ipeer) { 23 210426 : } 24 : Inet6Prefix prefix; 25 : const IPeer *peer; 26 27018 : virtual const IPeer *GetPeer() const { 27 27018 : return peer; 28 : } 29 : }; 30 : 31 : Inet6Table(DB *db, const std::string &name); 32 : 33 : virtual std::unique_ptr<DBEntry> AllocEntry(const DBRequestKey *key) const; 34 : virtual std::unique_ptr<DBEntry> AllocEntryStr(const std::string &key) const; 35 : 36 3039203 : virtual Address::Family family() const { return Address::INET6; } 37 : 38 : virtual size_t Hash(const DBEntry *entry) const; 39 : virtual size_t Hash(const DBRequestKey *key) const; 40 : 41 : virtual bool Export(RibOut *ribout, Route *route, const RibPeerSet &peerset, 42 : UpdateInfoSList &info_slist); 43 : virtual PathResolver *CreatePathResolver(); 44 : 45 : static size_t HashFunction(const Inet6Prefix &addr); 46 : static DBTableBase *CreateTable(DB *db, const std::string &name); 47 : BgpRoute *RouteReplicate(BgpServer *server, BgpTable *src_tbl, 48 : BgpRoute *src_rt, const BgpPath *path, 49 : ExtCommunityPtr ptr); 50 : 51 213830 : virtual bool IsRoutingPolicySupported() const { return true; } 52 436360 : virtual bool IsRouteAggregationSupported() const { return true; } 53 : private: 54 : virtual BgpRoute *TableFind(DBTablePartition *partition, 55 : const DBRequestKey *rkey); 56 : 57 : DISALLOW_COPY_AND_ASSIGN(Inet6Table); 58 : }; 59 : 60 : #endif // SRC_BGP_INET6_INET6_TABLE_H_