OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
local_sequence_number.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_BGP_EXTENDED_COMMUNITY_LOCAL_SEQUENCE_NUMBER_H_
6 #define SRC_BGP_EXTENDED_COMMUNITY_LOCAL_SEQUENCE_NUMBER_H_
7 
8 #include <boost/array.hpp>
9 #include <boost/system/error_code.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 LocalSequenceNumber(uint32_t seq);
22  explicit LocalSequenceNumber(const bytes_type &data);
23 
24  uint32_t local_sequence_number() const;
25 
26  const bytes_type &GetExtCommunity() const {
27  return data_;
28  }
29 
30  const uint64_t GetExtCommunityValue() const {
31  return get_value(data_.begin(), 8);
32  }
33 
34  std::string ToString();
35 
36 private:
38 };
39 
40 #endif // SRC_BGP_EXTENDED_COMMUNITY_LOCAL_SEQUENCE_NUMBER_H_
const bytes_type & GetExtCommunity() const
static uint64_t get_value(const uint8_t *data, int size)
Definition: parse_object.h:39
boost::array< uint8_t, kSize > bytes_type
LocalSequenceNumber(uint32_t seq)
uint32_t local_sequence_number() const
const uint64_t GetExtCommunityValue() const