LCOV - code coverage report
Current view: top level - bgp/rtarget - rtarget_route.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 6 6 100.0 %
Date: 2026-06-18 01:51:13 Functions: 2 2 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_RTARGET_RTARGET_ROUTE_H_
       6             : #define SRC_BGP_RTARGET_RTARGET_ROUTE_H_
       7             : 
       8             : #include <string>
       9             : #include <vector>
      10             : 
      11             : #include "base/util.h"
      12             : #include "bgp/bgp_route.h"
      13             : #include "bgp/rtarget/rtarget_address.h"
      14             : #include "bgp/rtarget/rtarget_prefix.h"
      15             : #include "net/bgp_af.h"
      16             : 
      17             : class BgpAttr;
      18             : class BgpProtoPrefix;
      19             : 
      20             : class RTargetRoute : public BgpRoute {
      21             : public:
      22             :     explicit RTargetRoute(const RTargetPrefix &prefix);
      23             :     virtual int CompareTo(const Route &rhs) const;
      24             : 
      25             :     virtual std::string ToString() const;
      26             : 
      27      142740 :     const RTargetPrefix &GetPrefix() const {
      28      142740 :         return prefix_;
      29             :     }
      30             : 
      31             :     virtual KeyPtr GetDBRequestKey() const;
      32             :     virtual void SetKey(const DBRequestKey *reqkey);
      33             :     virtual void BuildProtoPrefix(BgpProtoPrefix *prefix,
      34             :                                   const BgpAttr *attr = NULL,
      35             :                                   uint32_t label = 0,
      36             :                                   uint32_t l3_label = 0) const;
      37             :     virtual void BuildBgpProtoNextHop(std::vector<uint8_t> &nh,
      38             :                                       IpAddress nexthop) const;
      39             : 
      40     1632009 :     virtual bool IsLess(const DBEntry &genrhs) const {
      41     1632009 :         const RTargetRoute &rhs = static_cast<const RTargetRoute &>(genrhs);
      42     1632009 :         int cmp = CompareTo(rhs);
      43     1632009 :         return (cmp < 0);
      44             :     }
      45             : 
      46             : private:
      47             :     RTargetPrefix prefix_;
      48             :     DISALLOW_COPY_AND_ASSIGN(RTargetRoute);
      49             : };
      50             : 
      51             : #endif  // SRC_BGP_RTARGET_RTARGET_ROUTE_H_

Generated by: LCOV version 1.14