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
inetvpn_route.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_L3VPN_INETVPN_ROUTE_H_
6
#define SRC_BGP_L3VPN_INETVPN_ROUTE_H_
7
8
#include <set>
9
#include <string>
10
#include <vector>
11
12
#include "
base/util.h
"
13
#include "
base/address.h
"
14
#include "
bgp/bgp_attr.h
"
15
#include "
bgp/bgp_attr_base.h
"
16
#include "
bgp/bgp_route.h
"
17
#include "
bgp/l3vpn/inetvpn_address.h
"
18
#include "
net/bgp_af.h
"
19
20
class
InetVpnRoute
:
public
BgpRoute
{
21
public
:
22
explicit
InetVpnRoute
(
const
InetVpnPrefix
&prefix);
23
virtual
int
CompareTo
(
const
Route
&rhs)
const
;
24
25
virtual
std::string
ToString
()
const
;
26
27
const
InetVpnPrefix
&
GetPrefix
()
const
{
28
return
prefix_
;
29
}
30
virtual
RouteDistinguisher
GetRouteDistinguisher
()
const
{
31
return
prefix_
.
route_distinguisher
();
32
}
33
34
virtual
KeyPtr
GetDBRequestKey
()
const
;
35
virtual
void
SetKey
(
const
DBRequestKey
*reqkey);
36
virtual
void
BuildProtoPrefix
(
BgpProtoPrefix
*prefix,
37
const
BgpAttr
*attr = NULL,
38
uint32_t label = 0,
39
uint32_t l3_label = 0)
const
;
40
virtual
void
BuildBgpProtoNextHop
(std::vector<uint8_t> &nh,
41
IpAddress
nexthop)
const
;
42
43
virtual
bool
IsLess
(
const
DBEntry
&genrhs)
const
{
44
const
InetVpnRoute
&rhs =
static_cast<
const
InetVpnRoute
&
>
(genrhs);
45
int
cmp =
CompareTo
(rhs);
46
return
(cmp < 0);
47
}
48
49
virtual
bool
IsMoreSpecific
(
const
std::string &match)
const
;
50
virtual
bool
IsLessSpecific
(
const
std::string &match)
const
;
51
52
private
:
53
InetVpnPrefix
prefix_
;
54
DISALLOW_COPY_AND_ASSIGN
(
InetVpnRoute
);
55
};
56
57
#endif // SRC_BGP_L3VPN_INETVPN_ROUTE_H_
bgp_attr_base.h
inetvpn_address.h
InetVpnRoute
Definition:
inetvpn_route.h:20
IpAddress
boost::asio::ip::address IpAddress
Definition:
address.h:13
Route
Definition:
route.h:14
InetVpnRoute::GetPrefix
const InetVpnPrefix & GetPrefix() const
Definition:
inetvpn_route.h:27
InetVpnPrefix::route_distinguisher
const RouteDistinguisher & route_distinguisher() const
Definition:
inetvpn_address.h:43
InetVpnRoute::prefix_
InetVpnPrefix prefix_
Definition:
inetvpn_route.h:53
InetVpnRoute::BuildProtoPrefix
virtual void BuildProtoPrefix(BgpProtoPrefix *prefix, const BgpAttr *attr=NULL, uint32_t label=0, uint32_t l3_label=0) const
Definition:
inetvpn_route.cc:59
DBEntryBase::KeyPtr
std::unique_ptr< DBRequestKey > KeyPtr
Definition:
db_entry.h:25
InetVpnPrefix
Definition:
inetvpn_address.h:18
InetVpnRoute::SetKey
virtual void SetKey(const DBRequestKey *reqkey)
Definition:
inetvpn_route.cc:53
BgpProtoPrefix
Definition:
bgp_attr_base.h:97
DBRequestKey
Definition:
db_table.h:26
InetVpnRoute::ToString
virtual std::string ToString() const
Definition:
inetvpn_route.cc:43
InetVpnRoute::IsLessSpecific
virtual bool IsLessSpecific(const std::string &match) const
Definition:
inetvpn_route.cc:93
InetVpnRoute::GetRouteDistinguisher
virtual RouteDistinguisher GetRouteDistinguisher() const
Definition:
inetvpn_route.h:30
InetVpnRoute::CompareTo
virtual int CompareTo(const Route &rhs) const
Definition:
inetvpn_route.cc:19
address.h
RouteDistinguisher
Definition:
rd.h:11
util.h
bgp_af.h
bgp_route.h
InetVpnRoute::BuildBgpProtoNextHop
virtual void BuildBgpProtoNextHop(std::vector< uint8_t > &nh, IpAddress nexthop) const
Definition:
inetvpn_route.cc:66
DBEntry
Definition:
db_entry.h:97
bgp_attr.h
InetVpnRoute::IsMoreSpecific
virtual bool IsMoreSpecific(const std::string &match) const
Definition:
inetvpn_route.cc:81
InetVpnRoute::IsLess
virtual bool IsLess(const DBEntry &genrhs) const
Definition:
inetvpn_route.h:43
InetVpnRoute::GetDBRequestKey
virtual KeyPtr GetDBRequestKey() const
Definition:
inetvpn_route.cc:74
BgpAttr
Definition:
bgp_attr.h:825
BgpRoute
Definition:
bgp_route.h:22
InetVpnRoute::InetVpnRoute
InetVpnRoute(const InetVpnPrefix &prefix)
Definition:
inetvpn_route.cc:15
InetVpnRoute::DISALLOW_COPY_AND_ASSIGN
DISALLOW_COPY_AND_ASSIGN(InetVpnRoute)
contrail
controller
src
bgp
l3vpn
inetvpn_route.h
Generated by
1.8.5