OpenSDN source code
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"
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  }
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:
55 };
56 
57 #endif // SRC_BGP_L3VPN_INETVPN_ROUTE_H_
boost::asio::ip::address IpAddress
Definition: address.h:13
Definition: route.h:14
const InetVpnPrefix & GetPrefix() const
Definition: inetvpn_route.h:27
const RouteDistinguisher & route_distinguisher() const
InetVpnPrefix prefix_
Definition: inetvpn_route.h:53
virtual void BuildProtoPrefix(BgpProtoPrefix *prefix, const BgpAttr *attr=NULL, uint32_t label=0, uint32_t l3_label=0) const
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
virtual void SetKey(const DBRequestKey *reqkey)
virtual std::string ToString() const
virtual bool IsLessSpecific(const std::string &match) const
virtual RouteDistinguisher GetRouteDistinguisher() const
Definition: inetvpn_route.h:30
virtual int CompareTo(const Route &rhs) const
virtual void BuildBgpProtoNextHop(std::vector< uint8_t > &nh, IpAddress nexthop) const
virtual bool IsMoreSpecific(const std::string &match) const
virtual bool IsLess(const DBEntry &genrhs) const
Definition: inetvpn_route.h:43
virtual KeyPtr GetDBRequestKey() const
InetVpnRoute(const InetVpnPrefix &prefix)
DISALLOW_COPY_AND_ASSIGN(InetVpnRoute)