OpenSDN source code
multicast_flags.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef SRC_BGP_EXTENDED_COMMUNITY_MULTICAST_FLAGS_H_
7 #define SRC_BGP_EXTENDED_COMMUNITY_MULTICAST_FLAGS_H_
8 
9 #include <boost/array.hpp>
10 
11 #include <string>
12 
13 #include "base/parse_object.h"
15 
17 public:
18  static const int kSize = 8;
19  typedef boost::array<uint8_t, kSize> bytes_type;
20 
21  explicit MulticastFlags();
22  explicit MulticastFlags(const bytes_type &data);
23 
24  const bytes_type &GetExtCommunity() const {
25  return data_;
26  }
27 
28  const uint64_t GetExtCommunityValue() const {
29  return get_value(data_.begin(), 8);
30  }
31 
32  std::string ToString();
33 
34 private:
36 };
37 
38 #endif // SRC_BGP_EXTENDED_COMMUNITY_MULTICAST_FLAGS_H_
const uint64_t GetExtCommunityValue() const
bytes_type data_
boost::array< uint8_t, kSize > bytes_type
const bytes_type & GetExtCommunity() const
static const int kSize
std::string ToString()
static uint64_t get_value(const uint8_t *data, int size)
Definition: parse_object.h:40