147be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org/*
247be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
347be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *
447be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  Use of this source code is governed by a BSD-style license
547be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  that can be found in the LICENSE file in the root of the source
647be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  tree. An additional intellectual property rights grant can be found
747be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  in the file PATENTS.  All contributing project authors may
847be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
947be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org */
1047be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
1147be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org#ifndef WEBRTC_BASE_SOCKETADDRESSPAIR_H__
1247be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org#define WEBRTC_BASE_SOCKETADDRESSPAIR_H__
1347be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
1447be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org#include "webrtc/base/socketaddress.h"
1547be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
1647be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.orgnamespace rtc {
1747be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
1847be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org// Records a pair (source,destination) of socket addresses.  The two addresses
1947be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org// identify a connection between two machines.  (For UDP, this "connection" is
2047be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org// not maintained explicitly in a socket.)
2147be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.orgclass SocketAddressPair {
2247be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.orgpublic:
2347be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  SocketAddressPair() {}
2447be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  SocketAddressPair(const SocketAddress& srs, const SocketAddress& dest);
2547be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
2647be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  const SocketAddress& source() const { return src_; }
2747be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  const SocketAddress& destination() const { return dest_; }
2847be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
2947be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  bool operator ==(const SocketAddressPair& r) const;
3047be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  bool operator <(const SocketAddressPair& r) const;
3147be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
3247be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  size_t Hash() const;
3347be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
3447be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.orgprivate:
3547be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  SocketAddress src_;
3647be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org  SocketAddress dest_;
3747be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org};
3847be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
3947be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org} // namespace rtc
4047be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org
4147be73b8629244d6bb63a28198f97f040ce53d21henrike@webrtc.org#endif // WEBRTC_BASE_SOCKETADDRESSPAIR_H__
42