live
Data Structures | Macros | Functions | Variables
GroupsockHelper.hh File Reference
#include "NetAddress.hh"
#include <sys/time.h>
Include dependency graph for GroupsockHelper.hh:

Go to the source code of this file.

Data Structures

class  NoReuse
 
struct  _groupsockPriv
 

Macros

#define SET_SOCKADDR_SIN_LEN(var)
 
#define SET_SOCKADDR_SIN6_LEN(var)
 
#define MAKE_SOCKADDR_IN(var, adr, prt)
 
#define MAKE_SOCKADDR_IN6(var, prt)
 

Functions

int setupDatagramSocket (UsageEnvironment &env, Port port, int domain)
 
int setupStreamSocket (UsageEnvironment &env, Port port, int domain, Boolean makeNonBlocking=True, Boolean setKeepAlive=False)
 
int readSocket (UsageEnvironment &env, int socket, unsigned char *buffer, unsigned bufferSize, struct sockaddr_storage &fromAddress)
 
Boolean writeSocket (UsageEnvironment &env, int socket, struct sockaddr_storage const &addressAndPort, u_int8_t ttlArg, unsigned char *buffer, unsigned bufferSize)
 
Boolean writeSocket (UsageEnvironment &env, int socket, struct sockaddr_storage const &addressAndPort, unsigned char *buffer, unsigned bufferSize)
 
void ignoreSigPipeOnSocket (int socketNum)
 
unsigned getSendBufferSize (UsageEnvironment &env, int socket)
 
unsigned getReceiveBufferSize (UsageEnvironment &env, int socket)
 
unsigned setSendBufferTo (UsageEnvironment &env, int socket, unsigned requestedSize)
 
unsigned setReceiveBufferTo (UsageEnvironment &env, int socket, unsigned requestedSize)
 
unsigned increaseSendBufferTo (UsageEnvironment &env, int socket, unsigned requestedSize)
 
unsigned increaseReceiveBufferTo (UsageEnvironment &env, int socket, unsigned requestedSize)
 
Boolean makeSocketNonBlocking (int sock)
 
Boolean makeSocketBlocking (int sock, unsigned writeTimeoutInMilliseconds=0)
 
Boolean setSocketKeepAlive (int sock)
 
Boolean socketJoinGroup (UsageEnvironment &env, int socket, struct sockaddr_storage const &groupAddress)
 
Boolean socketLeaveGroup (UsageEnvironment &, int socket, struct sockaddr_storage const &groupAddress)
 
Boolean socketJoinGroupSSM (UsageEnvironment &env, int socket, struct sockaddr_storage const &groupAddress, struct sockaddr_storage const &sourceFilterAddr)
 
Boolean socketLeaveGroupSSM (UsageEnvironment &, int socket, struct sockaddr_storage const &groupAddress, struct sockaddr_storage const &sourceFilterAddr)
 
Boolean getSourcePort (UsageEnvironment &env, int socket, int domain, Port &port)
 
ipv4AddressBits ourIPv4Address (UsageEnvironment &env)
 
ipv6AddressBits const & ourIPv6Address (UsageEnvironment &env)
 
Boolean weHaveAnIPv4Address (UsageEnvironment &env)
 
Boolean weHaveAnIPv6Address (UsageEnvironment &env)
 
Boolean weHaveAnIPAddress (UsageEnvironment &env)
 
ipv4AddressBits chooseRandomIPv4SSMAddress (UsageEnvironment &env)
 
char const * timestampString ()
 
_groupsockPrivgroupsockPriv (UsageEnvironment &env)
 
void reclaimGroupsockPriv (UsageEnvironment &env)
 
void our_srandom (int x)
 
long our_random ()
 
u_int32_t our_random32 ()
 

Variables

ipv4AddressBits SendingInterfaceAddr
 
ipv4AddressBits ReceivingInterfaceAddr
 

Macro Definition Documentation

◆ MAKE_SOCKADDR_IN

#define MAKE_SOCKADDR_IN (   var,
  adr,
  prt 
)
Value:
/*adr,prt must be in network order*/\
struct sockaddr_in var;\
var.sin_family = AF_INET;\
var.sin_addr.s_addr = (adr);\
var.sin_port = (prt);\
SET_SOCKADDR_SIN_LEN(var);

Definition at line 107 of file GroupsockHelper.hh.

◆ MAKE_SOCKADDR_IN6

#define MAKE_SOCKADDR_IN6 (   var,
  prt 
)
Value:
/*adr,prt must be in network order*/\
struct sockaddr_in6 var;\
memset(&var, 0, sizeof var);\
var.sin6_family = AF_INET6;\
var.sin6_port = (prt);\
SET_SOCKADDR_SIN6_LEN(var);

Definition at line 113 of file GroupsockHelper.hh.

◆ SET_SOCKADDR_SIN6_LEN

#define SET_SOCKADDR_SIN6_LEN (   var)

Definition at line 104 of file GroupsockHelper.hh.

◆ SET_SOCKADDR_SIN_LEN

#define SET_SOCKADDR_SIN_LEN (   var)

Definition at line 103 of file GroupsockHelper.hh.

Function Documentation

◆ chooseRandomIPv4SSMAddress()

ipv4AddressBits chooseRandomIPv4SSMAddress ( UsageEnvironment env)

◆ getReceiveBufferSize()

unsigned getReceiveBufferSize ( UsageEnvironment env,
int  socket 
)

◆ getSendBufferSize()

unsigned getSendBufferSize ( UsageEnvironment env,
int  socket 
)

◆ getSourcePort()

Boolean getSourcePort ( UsageEnvironment env,
int  socket,
int  domain,
Port port 
)

◆ groupsockPriv()

_groupsockPriv* groupsockPriv ( UsageEnvironment env)

◆ ignoreSigPipeOnSocket()

void ignoreSigPipeOnSocket ( int  socketNum)

◆ increaseReceiveBufferTo()

unsigned increaseReceiveBufferTo ( UsageEnvironment env,
int  socket,
unsigned  requestedSize 
)

◆ increaseSendBufferTo()

unsigned increaseSendBufferTo ( UsageEnvironment env,
int  socket,
unsigned  requestedSize 
)

◆ makeSocketBlocking()

Boolean makeSocketBlocking ( int  sock,
unsigned  writeTimeoutInMilliseconds = 0 
)

◆ makeSocketNonBlocking()

Boolean makeSocketNonBlocking ( int  sock)

◆ our_random()

long our_random ( )

◆ our_random32()

u_int32_t our_random32 ( )

◆ our_srandom()

void our_srandom ( int  x)

◆ ourIPv4Address()

ipv4AddressBits ourIPv4Address ( UsageEnvironment env)

◆ ourIPv6Address()

ipv6AddressBits const& ourIPv6Address ( UsageEnvironment env)

◆ readSocket()

int readSocket ( UsageEnvironment env,
int  socket,
unsigned char *  buffer,
unsigned  bufferSize,
struct sockaddr_storage &  fromAddress 
)

◆ reclaimGroupsockPriv()

void reclaimGroupsockPriv ( UsageEnvironment env)

◆ setReceiveBufferTo()

unsigned setReceiveBufferTo ( UsageEnvironment env,
int  socket,
unsigned  requestedSize 
)

◆ setSendBufferTo()

unsigned setSendBufferTo ( UsageEnvironment env,
int  socket,
unsigned  requestedSize 
)

◆ setSocketKeepAlive()

Boolean setSocketKeepAlive ( int  sock)

◆ setupDatagramSocket()

int setupDatagramSocket ( UsageEnvironment env,
Port  port,
int  domain 
)

◆ setupStreamSocket()

int setupStreamSocket ( UsageEnvironment env,
Port  port,
int  domain,
Boolean  makeNonBlocking = True,
Boolean  setKeepAlive = False 
)

◆ socketJoinGroup()

Boolean socketJoinGroup ( UsageEnvironment env,
int  socket,
struct sockaddr_storage const &  groupAddress 
)

◆ socketJoinGroupSSM()

Boolean socketJoinGroupSSM ( UsageEnvironment env,
int  socket,
struct sockaddr_storage const &  groupAddress,
struct sockaddr_storage const &  sourceFilterAddr 
)

◆ socketLeaveGroup()

Boolean socketLeaveGroup ( UsageEnvironment ,
int  socket,
struct sockaddr_storage const &  groupAddress 
)

◆ socketLeaveGroupSSM()

Boolean socketLeaveGroupSSM ( UsageEnvironment ,
int  socket,
struct sockaddr_storage const &  groupAddress,
struct sockaddr_storage const &  sourceFilterAddr 
)

◆ timestampString()

char const* timestampString ( )

◆ weHaveAnIPAddress()

Boolean weHaveAnIPAddress ( UsageEnvironment env)

◆ weHaveAnIPv4Address()

Boolean weHaveAnIPv4Address ( UsageEnvironment env)

◆ weHaveAnIPv6Address()

Boolean weHaveAnIPv6Address ( UsageEnvironment env)

◆ writeSocket() [1/2]

Boolean writeSocket ( UsageEnvironment env,
int  socket,
struct sockaddr_storage const &  addressAndPort,
u_int8_t  ttlArg,
unsigned char *  buffer,
unsigned  bufferSize 
)

◆ writeSocket() [2/2]

Boolean writeSocket ( UsageEnvironment env,
int  socket,
struct sockaddr_storage const &  addressAndPort,
unsigned char *  buffer,
unsigned  bufferSize 
)

Variable Documentation

◆ ReceivingInterfaceAddr

ipv4AddressBits ReceivingInterfaceAddr
extern

◆ SendingInterfaceAddr

ipv4AddressBits SendingInterfaceAddr
extern