LCOV - code coverage report
Current view: top level - bgp/tunnel_encap - tunnel_encap.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 4 4 100.0 %
Date: 2026-06-22 02:21:21 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_TUNNEL_ENCAP_TUNNEL_ENCAP_H_
       6             : #define SRC_BGP_TUNNEL_ENCAP_TUNNEL_ENCAP_H_
       7             : 
       8             : #include "net/tunnel_encap_type.h"
       9             : 
      10             : #include <boost/array.hpp>
      11             : #include <boost/system/error_code.hpp>
      12             : 
      13             : #include <string>
      14             : 
      15             : #include "base/parse_object.h"
      16             : 
      17             : class TunnelEncap {
      18             : public:
      19             :     static const int kSize = 8;
      20             :     typedef boost::array<uint8_t, kSize> bytes_type;
      21             : 
      22             :     explicit TunnelEncap(TunnelEncapType::Encap encap);
      23             :     explicit TunnelEncap(std::string encap);
      24             :     explicit TunnelEncap(const bytes_type &data);
      25             : 
      26             :     TunnelEncapType::Encap tunnel_encap() const;
      27             : 
      28       32250 :     const bytes_type &GetExtCommunity() const {
      29       32250 :         return data_;
      30             :     }
      31             : 
      32       33778 :     const uint64_t GetExtCommunityValue() const {
      33       33778 :         return get_value(data_.begin(), 8);
      34             :     }
      35             :     std::string ToString();
      36             :     std::string ToXmppString();
      37             : 
      38             : private:
      39             :     bytes_type data_;
      40             : };
      41             : 
      42             : #endif  // SRC_BGP_TUNNEL_ENCAP_TUNNEL_ENCAP_H_

Generated by: LCOV version 1.14