LCOV - code coverage report
Current view: top level - bgp/extended-community - multicast_flags.cc (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 6 13 46.2 %
Date: 2026-06-22 02:21:21 Functions: 1 3 33.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #include "bgp/extended-community/multicast_flags.h"
       6             : 
       7             : #include <algorithm>
       8             : #include <stdio.h>
       9             : 
      10             : 
      11             : using std::copy;
      12             : #define IGMP_PROXY_FLAG 1
      13             : 
      14       20178 : MulticastFlags::MulticastFlags() {
      15       20178 :     data_[0] = BgpExtendedCommunityType::Evpn;
      16       20178 :     data_[1] = BgpExtendedCommunityEvpnSubType::MulticastFlags;
      17       20178 :     put_value(&data_[2], 2, IGMP_PROXY_FLAG);
      18       20178 :     put_value(&data_[4], 4, 0);
      19       20178 : }
      20             : 
      21           0 : MulticastFlags::MulticastFlags(const bytes_type &data) {
      22           0 :     copy(data.begin(), data.end(), data_.begin());
      23           0 : }
      24             : 
      25           0 : std::string MulticastFlags::ToString() {
      26           0 :     uint16_t flag = get_value(&data_[2], 2);
      27             :     char temp[50];
      28           0 :     snprintf(temp, sizeof(temp), "evpn-mcast-flags:%u", flag);
      29           0 :     return std::string(temp);
      30             : }

Generated by: LCOV version 1.14