OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mac_ip_learning_key.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_VNSW_AGENT_MAC_IP_LEARNING_MAC_LEARNING_KEY_H_
6 #define SRC_VNSW_AGENT_MAC_IP_LEARNING_MAC_LEARNING_KEY_H_
7 
9  MacIpLearningKey(uint32_t vrf_id, const IpAddress ip):
10  vrf_id_(vrf_id), ip_addr_(ip) {}
11  const uint32_t vrf_id_;
13 
14  bool IsLess(const MacIpLearningKey &rhs) const {
15  if (vrf_id_ != rhs.vrf_id_) {
16  return vrf_id_ < rhs.vrf_id_;
17  }
18 
19  return ip_addr_ < rhs.ip_addr_;
20  }
21 };
22 
24  bool operator()(const MacIpLearningKey &lhs, const MacIpLearningKey &rhs) const {
25  return lhs.IsLess(rhs);
26  }
27 };
28 #endif
MacIpLearningKey(uint32_t vrf_id, const IpAddress ip)
boost::asio::ip::address IpAddress
Definition: address.h:13
const IpAddress ip_addr_
bool IsLess(const MacIpLearningKey &rhs) const
bool operator()(const MacIpLearningKey &lhs, const MacIpLearningKey &rhs) const
const uint32_t vrf_id_