Line data Source code
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 3408 : uint32_t address() const { return endpoint.address().to_v4().to_ulong(); } 23 : 24 : boost::asio::ip::tcp::endpoint endpoint; 25 : boost::uuids::uuid uuid; 26 : }; 27 : 28 : 29 : #endif // SRC_BGP_BGP_PEER_KEY_H_