live
Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Groupsock Class Reference

#include <Groupsock.hh>

Inheritance diagram for Groupsock:
Inheritance graph
[legend]
Collaboration diagram for Groupsock:
Collaboration graph
[legend]

Public Member Functions

 Groupsock (UsageEnvironment &env, struct in_addr const &groupAddr, Port port, u_int8_t ttl)
 
 Groupsock (UsageEnvironment &env, struct in_addr const &groupAddr, struct in_addr const &sourceFilterAddr, Port port)
 
virtual ~Groupsock ()
 
virtual destRecordcreateNewDestRecord (struct in_addr const &addr, Port const &port, u_int8_t ttl, unsigned sessionId, destRecord *next)
 
void changeDestinationParameters (struct in_addr const &newDestAddr, Port newDestPort, int newDestTTL, unsigned sessionId=0)
 
unsigned lookupSessionIdFromDestination (struct sockaddr_in const &destAddrAndPort) const
 
virtual void addDestination (struct in_addr const &addr, Port const &port, unsigned sessionId)
 
virtual void removeDestination (unsigned sessionId)
 
void removeAllDestinations ()
 
Boolean hasMultipleDestinations () const
 
struct in_addr const & groupAddress () const
 
struct in_addr const & sourceFilterAddress () const
 
Boolean isSSM () const
 
u_int8_t ttl () const
 
void multicastSendOnly ()
 
virtual Boolean output (UsageEnvironment &env, unsigned char *buffer, unsigned bufferSize, DirectedNetInterface *interfaceNotToFwdBackTo=NULL)
 
DirectedNetInterfaceSetmembers ()
 
Boolean wasLoopedBackFromUs (UsageEnvironment &env, struct sockaddr_in &fromAddressAndPort)
 
virtual Boolean handleRead (unsigned char *buffer, unsigned bufferMaxSize, unsigned &bytesRead, struct sockaddr_in &fromAddressAndPort)
 
virtual Boolean write (netAddressBits address, portNumBits portNum, u_int8_t ttl, unsigned char *buffer, unsigned bufferSize)
 
Boolean write (struct sockaddr_in &addressAndPort, u_int8_t ttl, unsigned char *buffer, unsigned bufferSize)
 
void reset ()
 
int socketNum () const
 
Port port () const
 
UsageEnvironmentenv () const
 

Data Fields

Boolean deleteIfNoMembers
 
Boolean isSlave
 
NetInterfaceTrafficStats statsGroupIncoming
 
NetInterfaceTrafficStats statsGroupOutgoing
 
NetInterfaceTrafficStats statsGroupRelayedIncoming
 
NetInterfaceTrafficStats statsGroupRelayedOutgoing
 

Static Public Attributes

static NetInterfaceTrafficStats statsIncoming
 
static NetInterfaceTrafficStats statsOutgoing
 
static NetInterfaceTrafficStats statsRelayedIncoming
 
static NetInterfaceTrafficStats statsRelayedOutgoing
 
static int DebugLevel
 
static UsageEnvironmentDefaultUsageEnvironment
 

Protected Member Functions

destRecordlookupDestRecordFromDestination (struct sockaddr_in const &destAddrAndPort) const
 
portNumBits sourcePortNum () const
 
Boolean changePort (Port newPort)
 

Protected Attributes

destRecordfDests
 

Private Member Functions

void removeDestinationFrom (destRecord *&dests, unsigned sessionId)
 
int outputToAllMembersExcept (DirectedNetInterface *exceptInterface, u_int8_t ttlToFwd, unsigned char *data, unsigned size, netAddressBits sourceAddr)
 

Private Attributes

GroupEId fIncomingGroupEId
 
DirectedNetInterfaceSet fMembers
 

Detailed Description

Definition at line 82 of file Groupsock.hh.

Constructor & Destructor Documentation

◆ Groupsock() [1/2]

Groupsock::Groupsock ( UsageEnvironment env,
struct in_addr const &  groupAddr,
Port  port,
u_int8_t  ttl 
)

◆ Groupsock() [2/2]

Groupsock::Groupsock ( UsageEnvironment env,
struct in_addr const &  groupAddr,
struct in_addr const &  sourceFilterAddr,
Port  port 
)

◆ ~Groupsock()

virtual Groupsock::~Groupsock ( )
virtual

Member Function Documentation

◆ addDestination()

virtual void Groupsock::addDestination ( struct in_addr const &  addr,
Port const &  port,
unsigned  sessionId 
)
virtual

◆ changeDestinationParameters()

void Groupsock::changeDestinationParameters ( struct in_addr const &  newDestAddr,
Port  newDestPort,
int  newDestTTL,
unsigned  sessionId = 0 
)

◆ changePort()

Boolean Socket::changePort ( Port  newPort)
protectedinherited

◆ createNewDestRecord()

virtual destRecord* Groupsock::createNewDestRecord ( struct in_addr const &  addr,
Port const &  port,
u_int8_t  ttl,
unsigned  sessionId,
destRecord next 
)
virtual

◆ env()

UsageEnvironment& Socket::env ( ) const
inlineinherited

Definition at line 96 of file NetInterface.hh.

References Socket::fEnv.

96 { return fEnv; }
UsageEnvironment & fEnv

◆ groupAddress()

struct in_addr const& Groupsock::groupAddress ( ) const
inline

Definition at line 116 of file Groupsock.hh.

References fIncomingGroupEId, and GroupEId::groupAddress().

116  {
118  }
GroupEId fIncomingGroupEId
Definition: Groupsock.hh:169
struct in_addr const & groupAddress() const
Definition: GroupEId.hh:42

◆ handleRead()

virtual Boolean Groupsock::handleRead ( unsigned char *  buffer,
unsigned  bufferMaxSize,
unsigned &  bytesRead,
struct sockaddr_in &  fromAddressAndPort 
)
virtual

Reimplemented from OutputSocket.

◆ hasMultipleDestinations()

Boolean Groupsock::hasMultipleDestinations ( ) const
inline

Definition at line 114 of file Groupsock.hh.

References fDests, destRecord::fNext, and NULL.

114 { return fDests != NULL && fDests->fNext != NULL; }
#define NULL
destRecord * fNext
Definition: Groupsock.hh:73
destRecord * fDests
Definition: Groupsock.hh:167

◆ isSSM()

Boolean Groupsock::isSSM ( ) const
inline

Definition at line 123 of file Groupsock.hh.

References fIncomingGroupEId, and GroupEId::isSSM().

123  {
124  return fIncomingGroupEId.isSSM();
125  }
GroupEId fIncomingGroupEId
Definition: Groupsock.hh:169
Boolean isSSM() const

◆ lookupDestRecordFromDestination()

destRecord* Groupsock::lookupDestRecordFromDestination ( struct sockaddr_in const &  destAddrAndPort) const
protected

◆ lookupSessionIdFromDestination()

unsigned Groupsock::lookupSessionIdFromDestination ( struct sockaddr_in const &  destAddrAndPort) const

◆ members()

DirectedNetInterfaceSet& Groupsock::members ( )
inline

Definition at line 134 of file Groupsock.hh.

References fMembers.

134 { return fMembers; }
DirectedNetInterfaceSet fMembers
Definition: Groupsock.hh:170

◆ multicastSendOnly()

void Groupsock::multicastSendOnly ( )

◆ output()

virtual Boolean Groupsock::output ( UsageEnvironment env,
unsigned char *  buffer,
unsigned  bufferSize,
DirectedNetInterface interfaceNotToFwdBackTo = NULL 
)
virtual

◆ outputToAllMembersExcept()

int Groupsock::outputToAllMembersExcept ( DirectedNetInterface exceptInterface,
u_int8_t  ttlToFwd,
unsigned char *  data,
unsigned  size,
netAddressBits  sourceAddr 
)
private

◆ port()

Port Socket::port ( ) const
inlineinherited

Definition at line 92 of file NetInterface.hh.

References Socket::fPort.

92  {
93  return fPort;
94  }
Port fPort

◆ removeAllDestinations()

void Groupsock::removeAllDestinations ( )

◆ removeDestination()

virtual void Groupsock::removeDestination ( unsigned  sessionId)
virtual

◆ removeDestinationFrom()

void Groupsock::removeDestinationFrom ( destRecord *&  dests,
unsigned  sessionId 
)
private

◆ reset()

void Socket::reset ( )
inherited

◆ socketNum()

int Socket::socketNum ( ) const
inlineinherited

Definition at line 90 of file NetInterface.hh.

References Socket::fSocketNum.

90 { return fSocketNum; }
int fSocketNum

◆ sourceFilterAddress()

struct in_addr const& Groupsock::sourceFilterAddress ( ) const
inline

Definition at line 119 of file Groupsock.hh.

References fIncomingGroupEId, and GroupEId::sourceFilterAddress().

119  {
121  }
GroupEId fIncomingGroupEId
Definition: Groupsock.hh:169
struct in_addr const & sourceFilterAddress() const
Definition: GroupEId.hh:43

◆ sourcePortNum()

portNumBits OutputSocket::sourcePortNum ( ) const
inlineprotectedinherited

Definition at line 54 of file Groupsock.hh.

References OutputSocket::fSourcePort, and Port::num().

54 {return fSourcePort.num();}
Port fSourcePort
Definition: Groupsock.hh:62
portNumBits num() const
Definition: NetAddress.hh:98

◆ ttl()

u_int8_t Groupsock::ttl ( ) const
inline

Definition at line 127 of file Groupsock.hh.

References fIncomingGroupEId, and GroupEId::ttl().

127 { return fIncomingGroupEId.ttl(); }
GroupEId fIncomingGroupEId
Definition: Groupsock.hh:169
u_int8_t ttl() const
Definition: GroupEId.hh:49

◆ wasLoopedBackFromUs()

Boolean Groupsock::wasLoopedBackFromUs ( UsageEnvironment env,
struct sockaddr_in &  fromAddressAndPort 
)

◆ write() [1/2]

virtual Boolean OutputSocket::write ( netAddressBits  address,
portNumBits  portNum,
u_int8_t  ttl,
unsigned char *  buffer,
unsigned  bufferSize 
)
virtualinherited

Referenced by OutputSocket::write().

◆ write() [2/2]

Boolean OutputSocket::write ( struct sockaddr_in &  addressAndPort,
u_int8_t  ttl,
unsigned char *  buffer,
unsigned  bufferSize 
)
inlineinherited

Definition at line 46 of file Groupsock.hh.

References OutputSocket::write().

47  {
48  return write(addressAndPort.sin_addr.s_addr, addressAndPort.sin_port, ttl, buffer, bufferSize);
49  }
virtual Boolean write(netAddressBits address, portNumBits portNum, u_int8_t ttl, unsigned char *buffer, unsigned bufferSize)

Field Documentation

◆ DebugLevel

int Socket::DebugLevel
staticinherited

Definition at line 98 of file NetInterface.hh.

◆ DefaultUsageEnvironment

UsageEnvironment* NetInterface::DefaultUsageEnvironment
staticinherited

Definition at line 32 of file NetInterface.hh.

◆ deleteIfNoMembers

Boolean Groupsock::deleteIfNoMembers

Definition at line 136 of file Groupsock.hh.

◆ fDests

destRecord* Groupsock::fDests
protected

Definition at line 167 of file Groupsock.hh.

Referenced by hasMultipleDestinations().

◆ fIncomingGroupEId

GroupEId Groupsock::fIncomingGroupEId
private

Definition at line 169 of file Groupsock.hh.

Referenced by groupAddress(), isSSM(), sourceFilterAddress(), and ttl().

◆ fMembers

DirectedNetInterfaceSet Groupsock::fMembers
private

Definition at line 170 of file Groupsock.hh.

Referenced by members().

◆ isSlave

Boolean Groupsock::isSlave

Definition at line 137 of file Groupsock.hh.

◆ statsGroupIncoming

NetInterfaceTrafficStats Groupsock::statsGroupIncoming

Definition at line 143 of file Groupsock.hh.

◆ statsGroupOutgoing

NetInterfaceTrafficStats Groupsock::statsGroupOutgoing

Definition at line 144 of file Groupsock.hh.

◆ statsGroupRelayedIncoming

NetInterfaceTrafficStats Groupsock::statsGroupRelayedIncoming

Definition at line 145 of file Groupsock.hh.

◆ statsGroupRelayedOutgoing

NetInterfaceTrafficStats Groupsock::statsGroupRelayedOutgoing

Definition at line 146 of file Groupsock.hh.

◆ statsIncoming

NetInterfaceTrafficStats Groupsock::statsIncoming
static

Definition at line 139 of file Groupsock.hh.

◆ statsOutgoing

NetInterfaceTrafficStats Groupsock::statsOutgoing
static

Definition at line 140 of file Groupsock.hh.

◆ statsRelayedIncoming

NetInterfaceTrafficStats Groupsock::statsRelayedIncoming
static

Definition at line 141 of file Groupsock.hh.

◆ statsRelayedOutgoing

NetInterfaceTrafficStats Groupsock::statsRelayedOutgoing
static

Definition at line 142 of file Groupsock.hh.


The documentation for this class was generated from the following file: