OpenSDN source code
local_sequence_number.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
7 
8 #include <stdio.h>
9 
10 #include <algorithm>
11 #include <string>
12 
13 
14 using std::copy;
15 using std::string;
16 
20  put_value(&data_[2], 4, seq);
21 }
22 
24  copy(data.begin(), data.end(), data_.begin());
25 }
26 
28  uint8_t data[LocalSequenceNumber::kSize];
29  copy(data_.begin(), data_.end(), &data[0]);
32  uint32_t num = get_value(data + 2, 4);
33  return num;
34  }
35  return 0;
36 }
37 
39  char temp[50];
40  snprintf(temp, sizeof(temp), "local_sequence_number:%u",
42  return string(temp);
43 }
boost::array< uint8_t, kSize > bytes_type
uint32_t local_sequence_number() const
LocalSequenceNumber(uint32_t seq)
static void put_value(uint8_t *data, int size, uint64_t value)
Definition: parse_object.h:56
static uint64_t get_value(const uint8_t *data, int size)
Definition: parse_object.h:40