OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bgp_peer_key.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_BGP_PEER_KEY_H_
6 #define SRC_BGP_BGP_PEER_KEY_H_
7 
8 #include <boost/asio/ip/tcp.hpp>
9 #include <boost/uuid/uuid.hpp>
10 
11 class BgpNeighborConfig;
12 
13 struct BgpPeerKey {
14  BgpPeerKey();
15  explicit BgpPeerKey(const BgpNeighborConfig *config);
16 
17  bool operator<(const BgpPeerKey &rhs) const;
18  bool operator>(const BgpPeerKey &rhs) const;
19  bool operator==(const BgpPeerKey &rhs) const;
20  bool operator!=(const BgpPeerKey &rhs) const;
21 
22  uint32_t address() const { return endpoint.address().to_v4().to_ulong(); }
23 
24  boost::asio::ip::tcp::endpoint endpoint;
26 };
27 
28 
29 #endif // SRC_BGP_BGP_PEER_KEY_H_
uint32_t address() const
Definition: bgp_peer_key.h:22
bool operator>(const BgpPeerKey &rhs) const
Definition: bgp_peer_key.cc:50
bool operator!=(const BgpPeerKey &rhs) const
Definition: bgp_peer_key.cc:61
bool operator==(const BgpPeerKey &rhs) const
Definition: bgp_peer_key.cc:57
boost::uuids::uuid uuid
boost::asio::ip::tcp::endpoint endpoint
Definition: bgp_peer_key.h:24
boost::uuids::uuid uuid
Definition: bgp_peer_key.h:25
bool operator<(const BgpPeerKey &rhs) const
Definition: bgp_peer_key.cc:43