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
es_import.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3
*/
4
5
#include "
bgp/extended-community/es_import.h
"
6
7
#include <algorithm>
8
#include <string>
9
10
#include "
net/mac_address.h
"
11
12
using
std::copy;
13
using
std::string;
14
15
EsImport::EsImport
(
const
bytes_type
&data) {
16
copy(data.begin(), data.end(),
data_
.begin());
17
}
18
19
MacAddress
EsImport::mac_address
()
const
{
20
if
(
data_
[0] !=
BgpExtendedCommunityType::Evpn
||
21
data_
[1] !=
BgpExtendedCommunityEvpnSubType::EsImport
)
22
return
MacAddress
();
23
uint8_t mac_bytes[6];
24
copy(
data_
.begin() + 2,
data_
.end(), mac_bytes);
25
return
MacAddress
(mac_bytes);
26
}
27
28
string
EsImport::ToString
()
const
{
29
string
temp(
"esimport:"
);
30
return
temp +
mac_address
().
ToString
();
31
}
EsImport::mac_address
MacAddress mac_address() const
Definition:
es_import.cc:19
EsImport::EsImport
EsImport(const bytes_type &data)
Definition:
es_import.cc:15
MacAddress
Definition:
mac_address.h:14
MacAddress::ToString
std::string ToString() const
Definition:
mac_address.cc:53
EsImport::ToString
std::string ToString() const
Definition:
es_import.cc:28
BgpExtendedCommunityType::Evpn
Definition:
types.h:14
es_import.h
EsImport::data_
bytes_type data_
Definition:
es_import.h:28
BgpExtendedCommunityEvpnSubType::EsImport
Definition:
types.h:43
EsImport::bytes_type
boost::array< uint8_t, kSize > bytes_type
Definition:
es_import.h:20
mac_address.h
contrail
controller
src
bgp
extended-community
es_import.cc
Generated by
1.8.5