1#if !defined(RESIP_TUPLE_HXX)
22#include <netinet/in.h>
28struct GenericIPAddress;
82 Tuple(
const in_addr& pipv4,
100 Tuple(
const in6_addr& pipv6,
154 bool isEqual(
const Tuple& tuple,
bool ignorePort =
false,
bool ignoreTransport =
false)
const;
197 bool isEqualWithMask(
const Tuple& tuple,
short mask,
bool ignorePort=
false,
bool ignoreTransport=
false)
const;
207 const std::vector<AddressMask>& denied)
const;
216 const Tuple& y)
const;
229 const Tuple& y)
const;
239 const Tuple& y)
const;
247 const Tuple& y)
const;
254 mTargetDomain = target;
261 return mTargetDomain;
289 sockaddr_in6 m_anonv6;
Wraps your platform's implementation of hash_map, hash_multimap, and hash_set.
Handles cross-platform sockets compatibility.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
static const Data Empty
Constant that represents a zero-length data.
A "less than" comparator for Tuple, for use in map containers etc.
bool operator()(const Tuple &x, const Tuple &y) const
A "less than" comparator for Tuple, for use in map containers etc.
bool operator()(const Tuple &x, const Tuple &y) const
A "less than" comparator for Tuple, for use in map containers etc.
bool operator()(const Tuple &x, const Tuple &y) const
bool operator()(const Tuple &x, const Tuple &y) const
Represents a network address.
friend EncodeStream & operator<<(EncodeStream &strm, const Tuple &tuple)
IpVersion ipVersion() const
Returns V4 or V6 as appropriate.
Data presentationFormat() const
Wrapper around the inet_top() method.
static Tuple makeTupleFromBinaryToken(const Data &binaryToken, const Data &salt=Data::Empty)
size_t hash() const
Creates a 32-bit hash based on the contents of this Tuple.
char pad[RESIP_MAX_SOCKADDR_SIZE]
sockaddr & getMutableSockaddr()
Retrieve the binary representation of the socket address for this tuple.
void setTargetDomain(const Data &target)
Set the domain name this address tuple intends to represent.
void setNetNs(const Data &netNs)
Set the netns (network namespace) for this Tuple.
static const Data & toData(TransportType)
Converts the TransportType to a string representation of the transport type, e.g.
bool operator==(const Tuple &rhs) const
Compares TransportType, the binary address, port, and address family of the Tuple.
const Data & getNetNs() const
Get the netns for this Tuple.
GenericIPAddress toGenericIPAddress() const
bool isAnyInterface() const
TRUE if this address is equal to the "INADDR_ANY" value for this address family.
bool onlyUseExistingConnection
bool isPrivateAddress() const
FlowKey mFlowKey
This is a (largely) opaque key that subclasses of Transport will use to help record/find flows.
bool isAddressAllowed(const std::vector< AddressMask > &allowed, const std::vector< AddressMask > &denied) const
Tests whether this address is permitted by the supplied allow/deny address lists.
static const Data & toDataLower(TransportType type)
void setType(TransportType type)
static void writeBinaryToken(const Tuple &tuple, Data &container, const Data &salt=Data::Empty)
bool isEqual(const Tuple &tuple, bool ignorePort=false, bool ignoreTransport=false) const
compares this tuple with the one passed in for family, port and address equality.
void copySockaddrAnyPort(sockaddr *sa)
Get a copy of the socket address including the interface and not the port number.
bool isEqualWithMask(const Tuple &tuple, short mask, bool ignorePort=false, bool ignoreTransport=false) const
compares this tuple with the one passed in for family, port and address equality using the passed in ...
TransportType getType() const
static Data inet_ntop(const Tuple &tuple)
Converts the binary socket address to presentation format, via the DnsUtil::inet_ntop() method.
const sockaddr & getSockaddr() const
Retrieve a const binary representation of the socket address for this tuple.
static TransportType toTransport(const Data &)
Converts a string representation of transport type, i.e.
bool isSpecialPurposeAddress() const
void setSockaddr(const GenericIPAddress &)
Set the internal binary representation of the socket address from the GenericIPAddress.
Tuple(const sockaddr &addr, TransportType ptype, const Data &targetDomain=Data::Empty)
const Data & getTargetDomain() const
Get the domain name this address tuple intends to represent.
FlowKey getFlowKey() const
TransportKey mTransportKey
bool operator<(const Tuple &rhs) const
Compares TransportType, the binary address, port, and address family of the Tuple.
void setFlowKey(FlowKey flowKey)
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
#define RESIP_MAX_SOCKADDR_SIZE
dcm! – add UnusedChecking(_enum) below;
unsigned long TransportKey
TransportType
An enumeration of transport protocols.
IpVersion
An enumeration of IP versions.
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
An IP address paired with a CIDR prefix length (number of mask bits), for use in address-based access...
Represents an IP-address and port (V4 or V6).