LCOV - code coverage report
Current view: top level - bgp/inet - inet_table.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 9 9 100.0 %
Date: 2026-06-18 01:51:13 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef SRC_BGP_INET_INET_TABLE_H_
       6             : #define SRC_BGP_INET_INET_TABLE_H_
       7             : 
       8             : #include <string>
       9             : 
      10             : #include "bgp/bgp_table.h"
      11             : #include "bgp/inet/inet_route.h"
      12             : #include "base/address.h"
      13             : 
      14             : class BgpServer;
      15             : class InetVpnPrefix;
      16             : class Ip4Prefix;
      17             : class PathResolver;
      18             : 
      19             : class InetTable : public BgpTable {
      20             : public:
      21             :     struct RequestKey : BgpTable::RequestKey {
      22      315945 :         RequestKey(const Ip4Prefix &prefix, const IPeer *ipeer)
      23      315945 :             : prefix(prefix), peer(ipeer) {
      24      315907 :         }
      25             :         Ip4Prefix prefix;
      26             :         const IPeer *peer;
      27       54041 :         virtual const IPeer *GetPeer() const {
      28       54041 :             return peer;
      29             :         }
      30             :     };
      31             : 
      32             :     InetTable(DB *db, const std::string &name);
      33             : 
      34             :     virtual std::unique_ptr<DBEntry> AllocEntry(const DBRequestKey *key) const;
      35             :     virtual std::unique_ptr<DBEntry> AllocEntryStr(const std::string &key) const;
      36             : 
      37     4691008 :     virtual Address::Family family() const { return family_; }
      38             : 
      39             :     virtual size_t Hash(const DBEntry *entry) const;
      40             :     virtual size_t Hash(const DBRequestKey *key) const;
      41             : 
      42             :     virtual bool Export(RibOut *ribout, Route *route,
      43             :                         const RibPeerSet &peerset,
      44             :                         UpdateInfoSList &info_slist);
      45             :     virtual PathResolver *CreatePathResolver();
      46             : 
      47             :     static size_t HashFunction(const Ip4Prefix &addr);
      48             :     static DBTableBase *CreateTable(DB *db, const std::string &name);
      49             :     BgpRoute *RouteReplicate(BgpServer *server, BgpTable *src_tbl,
      50             :                              BgpRoute *src_rt, const BgpPath *path,
      51             :                              ExtCommunityPtr ptr);
      52             : 
      53      237170 :     virtual bool IsRoutingPolicySupported() const { return true; }
      54      487294 :     virtual bool IsRouteAggregationSupported() const {
      55      487294 :         return((family_ == Address::INETMPLS) ? false : true); }
      56             :     virtual BgpAttrPtr GetAttributes(BgpRoute *rt, BgpAttrPtr attrp,
      57             :                                      const IPeer *peer);
      58             :     void UpdateRoute(const InetVpnPrefix &inetvpn_prefix, const IPeer *peer,
      59             :                      BgpAttrPtr inetvpn_attrp);
      60             : 
      61             : private:
      62             :     BgpAttrPtr GetFabricAttributes(BgpRoute *rt, BgpAttrPtr attrp,
      63             :                                    const IPeer *peer);
      64             :     BgpAttrPtr GetMvpnAttributes(BgpAttrPtr attrp);
      65             :     BgpAttrPtr UpdateAttributes(const BgpAttrPtr inetvpn_attrp,
      66             :                                 const BgpAttrPtr inet_attrp);
      67             :     void UpdateExtendedCommunity(RibOutAttr *roattr);
      68             :     virtual BgpRoute *TableFind(DBTablePartition *rtp,
      69             :                                 const DBRequestKey *prefix);
      70             : 
      71             :     Address::Family family_;
      72             :     DISALLOW_COPY_AND_ASSIGN(InetTable);
      73             : };
      74             : 
      75             : #endif  // SRC_BGP_INET_INET_TABLE_H_

Generated by: LCOV version 1.14