OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
local_sequence_number.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
6 
7 #include <stdio.h>
8 
9 #include <algorithm>
10 #include <string>
11 
12 
13 using std::copy;
14 using std::string;
15 
19  put_value(&data_[2], 4, seq);
20 }
21 
23  copy(data.begin(), data.end(), data_.begin());
24 }
25 
27  uint8_t data[LocalSequenceNumber::kSize];
28  copy(data_.begin(), data_.end(), &data[0]);
31  uint32_t num = get_value(data + 2, 4);
32  return num;
33  }
34  return 0;
35 }
36 
38  char temp[50];
39  snprintf(temp, sizeof(temp), "local_sequence_number:%u",
41  return string(temp);
42 }
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
static void put_value(uint8_t *data, int size, uint64_t value)
Definition: parse_object.h:55