21#ifndef _GROUPSOCK_HELPER_HH
22#define _GROUPSOCK_HELPER_HH
24#ifndef _NET_ADDRESS_HH
37 int socket,
unsigned char* buffer,
unsigned bufferSize,
38 struct sockaddr_storage& fromAddress );
41 int socket,
struct sockaddr_storage
const& addressAndPort,
43 unsigned char* buffer,
unsigned bufferSize);
46 int socket,
struct sockaddr_storage
const& addressAndPort,
47 unsigned char* buffer,
unsigned bufferSize);
55 int socket,
unsigned requestedSize);
57 int socket,
unsigned requestedSize);
59 int socket,
unsigned requestedSize);
61 int socket,
unsigned requestedSize);
69 struct sockaddr_storage
const& groupAddress);
71 struct sockaddr_storage
const& groupAddress);
75 struct sockaddr_storage
const& groupAddress,
76 struct sockaddr_storage
const& sourceFilterAddr);
78 struct sockaddr_storage
const& groupAddress,
79 struct sockaddr_storage
const& sourceFilterAddr);
104#ifdef HAVE_SOCKADDR_LEN
105#define SET_SOCKADDR_SIN_LEN(var) var.sin_len = sizeof var
106#define SET_SOCKADDR_SIN6_LEN(var) var.sin6_len = sizeof var
108#define SET_SOCKADDR_SIN_LEN(var)
109#define SET_SOCKADDR_SIN6_LEN(var)
112#define MAKE_SOCKADDR_IN(var,adr,prt) \
113 struct sockaddr_in var;\
114 var.sin_family = AF_INET;\
115 var.sin_addr.s_addr = (adr);\
116 var.sin_port = (prt);\
117 SET_SOCKADDR_SIN_LEN(var);
118#define MAKE_SOCKADDR_IN6(var,adr,prt) \
119 struct sockaddr_in6 var;\
120 memset(&var, 0, sizeof var);\
121 var.sin6_family = AF_INET6;\
123 var.sin6_port = (prt);\
124 SET_SOCKADDR_SIN6_LEN(var);
154#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
156extern int gettimeofday(
struct timeval*,
int*);
unsigned setSendBufferTo(UsageEnvironment &env, int socket, unsigned requestedSize)
in6_addr ReceivingInterfaceAddr6
ipv4AddressBits chooseRandomIPv4SSMAddress(UsageEnvironment &env)
Boolean makeSocketNonBlocking(int sock)
Boolean socketJoinGroup(UsageEnvironment &env, int socket, struct sockaddr_storage const &groupAddress)
Boolean weHaveAnIPv6Address(UsageEnvironment &env)
char const * timestampString()
Boolean writeSocket(UsageEnvironment &env, int socket, struct sockaddr_storage const &addressAndPort, u_int8_t ttlArg, unsigned char *buffer, unsigned bufferSize)
unsigned getReceiveBufferSize(UsageEnvironment &env, int socket)
ipv6AddressBits const & ourIPv6Address(UsageEnvironment &env)
Boolean socketLeaveGroup(UsageEnvironment &, int socket, struct sockaddr_storage const &groupAddress)
Boolean setSocketKeepAlive(int sock)
Boolean socketLeaveGroupSSM(UsageEnvironment &, int socket, struct sockaddr_storage const &groupAddress, struct sockaddr_storage const &sourceFilterAddr)
int setupStreamSocket(UsageEnvironment &env, Port port, int domain, Boolean makeNonBlocking=True, Boolean setKeepAlive=False)
ipv4AddressBits SendingInterfaceAddr
unsigned setReceiveBufferTo(UsageEnvironment &env, int socket, unsigned requestedSize)
Boolean weHaveAnIPv4Address(UsageEnvironment &env)
Boolean makeSocketBlocking(int sock, unsigned writeTimeoutInMilliseconds=0)
int setupDatagramSocket(UsageEnvironment &env, Port port, int domain)
unsigned increaseReceiveBufferTo(UsageEnvironment &env, int socket, unsigned requestedSize)
ipv4AddressBits ourIPv4Address(UsageEnvironment &env)
int readSocket(UsageEnvironment &env, int socket, unsigned char *buffer, unsigned bufferSize, struct sockaddr_storage &fromAddress)
void reclaimGroupsockPriv(UsageEnvironment &env)
_groupsockPriv * groupsockPriv(UsageEnvironment &env)
Boolean weHaveAnIPAddress(UsageEnvironment &env)
Boolean socketJoinGroupSSM(UsageEnvironment &env, int socket, struct sockaddr_storage const &groupAddress, struct sockaddr_storage const &sourceFilterAddr)
Boolean getSourcePort(UsageEnvironment &env, int socket, int domain, Port &port)
void ignoreSigPipeOnSocket(int socketNum)
ipv4AddressBits ReceivingInterfaceAddr
unsigned increaseSendBufferTo(UsageEnvironment &env, int socket, unsigned requestedSize)
unsigned getSendBufferSize(UsageEnvironment &env, int socket)
u_int32_t ipv4AddressBits
u_int8_t ipv6AddressBits[16]
NoReuse(UsageEnvironment &env)