7 #ifndef INETADDRESSUTIL_H_
8 #define INETADDRESSUTIL_H_
15 #include <pv/pvType.h>
16 #include <pv/byteBuffer.h>
34 epicsShareFunc
int discoverInterfaces(IfaceNodeVector &list, SOCKET socket,
const osiSockAddr *pMatchAddr = 0);
41 epicsShareFunc
void encodeAsIPv6Address(epics::pvData::ByteBuffer* buffer,
const osiSockAddr* address);
49 epicsShareFunc
bool decodeAsIPv6Address(epics::pvData::ByteBuffer* buffer, osiSockAddr* address);
67 const InetAddrVector* appendList = NULL);
69 epicsShareFunc
std::string inetAddressToString(
const osiSockAddr &addr,
70 bool displayPort =
true,
bool displayHex =
false);
76 struct comp_osiSock_lt {
77 bool operator()(
const osiSockAddr& a,
const osiSockAddr& b)
const {
78 if(a.sa.sa_family<b.sa.sa_family)
return true;
79 if((a.sa.sa_family==b.sa.sa_family)&&(a.ia.sin_addr.s_addr
80 <b.ia.sin_addr.s_addr))
return true;
81 if((a.sa.sa_family==b.sa.sa_family)&&(a.ia.sin_addr.s_addr
82 ==b.ia.sin_addr.s_addr)&&(a.ia.sin_port
83 <b.ia.sin_port))
return true;
void encodeAsIPv6Address(epics::pvData::ByteBuffer *buffer, const osiSockAddr *address)
Encode IPv4 address as IPv6 address.
bool decodeAsIPv6Address(epics::pvData::ByteBuffer *buffer, osiSockAddr *address)
Decode IPv6 address (as IPv4 address).
void getSocketAddressList(InetAddrVector &ret, const std::string &list, int defaultPort, const InetAddrVector *appendList=NULL)
Parse space delimited addresss[:port] string and populate array of InetSocketAddress.
bool isMulticastAddress(const osiSockAddr *address)
Check if an IPv4 address is a multicast address.