21 size_t nlri_size = proto_prefix.
prefix.size();
22 size_t expected_min_nlri_size =
25 if (nlri_size < expected_min_nlri_size)
30 size_t label_offset = 0;
31 *label = proto_prefix.
ReadLabel(label_offset);
37 Ip6Address::bytes_type bt = { { 0 } };
38 copy(proto_prefix.
prefix.begin() + prefix_offset,
39 proto_prefix.
prefix.end(), bt.begin());
57 proto_prefix->
prefix.clear();
62 proto_prefix->
prefix.resize(nlri_size, 0);
63 size_t label_offset = 0;
67 proto_prefix->
prefix.begin() + rd_offset);
71 const Ip6Address::bytes_type &addr_bytes =
addr_.to_bytes();
72 copy(addr_bytes.begin(), addr_bytes.begin() + prefix_size,
73 proto_prefix->
prefix.begin() + prefix_offset);
78 boost::system::error_code *errorp) {
81 size_t pos = str.find(
':');
82 if (pos == string::npos) {
84 *errorp = make_error_code(boost::system::errc::invalid_argument);
88 pos = str.find(
':', (pos + 1));
89 if (pos == string::npos) {
91 *errorp = make_error_code(boost::system::errc::invalid_argument);
95 string rdstr = str.substr(0, pos);
96 boost::system::error_code rderr;
105 string ip6pstr(str, pos + 1);
108 if (errorp != NULL) {
167 repr.append(strplen);
181 uint32_t l3_label)
const {
191 if (src_nh.is_v4()) {
192 source_addr = Ip6Address::v4_mapped(src_nh.to_v4());
193 }
else if (src_nh.is_v6()) {
194 source_addr = src_nh.to_v6();
199 Ip6Address::bytes_type addr_bytes = source_addr.to_bytes();
200 copy(addr_bytes.begin(), addr_bytes.end(),
212 boost::system::error_code ec;
224 boost::system::error_code ec;
virtual bool IsLessSpecific(const std::string &other) const
virtual std::string ToString() const
void WriteLabel(size_t label_offset, uint32_t label, bool is_vni=false)
std::string ToString() const
static int FromProtoPrefix(const BgpProtoPrefix &proto_prefix, Inet6VpnPrefix *prefix, uint32_t *label)
boost::asio::ip::address IpAddress
static RouteDistinguisher FromString(const std::string &str, boost::system::error_code *error=NULL)
uint32_t ReadLabel(size_t label_offset, bool is_vni=false) const
virtual bool IsMoreSpecific(const std::string &other) const
Inet6VpnRoute(const Inet6VpnPrefix &prefix)
static Inet6VpnPrefix FromString(const std::string &str, boost::system::error_code *errorp=NULL)
int CompareTo(const RouteDistinguisher &rhs) const
std::unique_ptr< DBRequestKey > KeyPtr
int CompareTo(const Inet6VpnPrefix &other) const
bool operator==(const Inet6VpnPrefix &rhs) const
static const size_t kSize
boost::intrusive_ptr< const BgpAttr > BgpAttrPtr
virtual void BuildBgpProtoNextHop(std::vector< uint8_t > &nh, IpAddress nexthop) const
static const size_t kLabelSize
std::vector< uint8_t > prefix
virtual void SetKey(const DBRequestKey *reqkey)
boost::asio::ip::address_v6 Ip6Address
std::string ToString() const
virtual KeyPtr GetDBRequestKey() const
static const uint8_t kMaxV6Bytes
void BuildProtoPrefix(uint32_t label, BgpProtoPrefix *prefix) const
virtual void BuildProtoPrefix(BgpProtoPrefix *prefix, const BgpAttr *attr, uint32_t label, uint32_t l3_label=0) const
const RouteDistinguisher & route_distinguisher() const
bool IsMoreSpecific(const Inet6VpnPrefix &rhs) const
std::string ToString() const
const uint8_t * GetData() const
const Inet6VpnPrefix & GetPrefix() const
bool IsMoreSpecific(const Inet6Prefix &rhs) const
boost::system::error_code Inet6SubnetParse(const string &str, Ip6Address *addr, int *plen)
virtual int CompareTo(const Route &rhs) const