OpenSDN source code
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
multicast_flags.cc
Go to the documentation of this file.
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
MulticastFlags::MulticastFlags
() {
15
data_
[0] =
BgpExtendedCommunityType::Evpn
;
16
data_
[1] =
BgpExtendedCommunityEvpnSubType::MulticastFlags
;
17
put_value
(&
data_
[2], 2,
IGMP_PROXY_FLAG
);
18
put_value
(&
data_
[4], 4, 0);
19
}
20
21
MulticastFlags::MulticastFlags
(
const
bytes_type
&data) {
22
copy(data.begin(), data.end(),
data_
.begin());
23
}
24
25
std::string
MulticastFlags::ToString
() {
26
uint16_t flag =
get_value
(&
data_
[2], 2);
27
char
temp[50];
28
snprintf(temp,
sizeof
(temp),
"evpn-mcast-flags:%u"
, flag);
29
return
std::string(temp);
30
}
MulticastFlags::MulticastFlags
MulticastFlags()
Definition:
multicast_flags.cc:14
get_value
static uint64_t get_value(const uint8_t *data, int size)
Definition:
parse_object.h:39
BgpExtendedCommunityEvpnSubType::MulticastFlags
Definition:
types.h:46
MulticastFlags::bytes_type
boost::array< uint8_t, kSize > bytes_type
Definition:
multicast_flags.h:18
MulticastFlags::ToString
std::string ToString()
Definition:
multicast_flags.cc:25
BgpExtendedCommunityType::Evpn
Definition:
types.h:14
MulticastFlags::data_
bytes_type data_
Definition:
multicast_flags.h:34
multicast_flags.h
IGMP_PROXY_FLAG
#define IGMP_PROXY_FLAG
Definition:
multicast_flags.cc:12
put_value
static void put_value(uint8_t *data, int size, uint64_t value)
Definition:
parse_object.h:55
contrail
controller
src
bgp
extended-community
multicast_flags.cc
Generated by
1.8.5