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
Collaboration diagram for Groupsock:
Collaboration graph

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


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 ( )

Member Function Documentation

◆ addDestination()

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

◆ changeDestinationParameters()

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

◆ changePort()

Boolean Socket::changePort ( Port  newPort)

◆ createNewDestRecord()

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

◆ env()

UsageEnvironment& Socket::env ( ) const

Definition at line 96 of file NetInterface.hh.

96 { return fEnv; }
UsageEnvironment & fEnv

References Socket::fEnv.

◆ groupAddress()

struct in_addr const& Groupsock::groupAddress ( ) const

Definition at line 116 of file Groupsock.hh.

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

References fIncomingGroupEId, and GroupEId::groupAddress().

◆ handleRead()

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

Reimplemented from OutputSocket.

◆ hasMultipleDestinations()

Boolean Groupsock::hasMultipleDestinations ( ) const

Definition at line 114 of file Groupsock.hh.

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

References fDests, destRecord::fNext, and NULL.

◆ isSSM()

Boolean Groupsock::isSSM ( ) const

Definition at line 123 of file Groupsock.hh.

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

References fIncomingGroupEId, and GroupEId::isSSM().

◆ lookupDestRecordFromDestination()

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

◆ lookupSessionIdFromDestination()

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

◆ members()

DirectedNetInterfaceSet& Groupsock::members ( )

Definition at line 134 of file Groupsock.hh.

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

References fMembers.

◆ multicastSendOnly()

void Groupsock::multicastSendOnly ( )

◆ output()

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

◆ outputToAllMembersExcept()

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

◆ port()

Port Socket::port ( ) const

Definition at line 92 of file NetInterface.hh.

92  {
93  return fPort;
94  }
Port fPort

References Socket::fPort.

◆ removeAllDestinations()

void Groupsock::removeAllDestinations ( )

◆ removeDestination()

virtual void Groupsock::removeDestination ( unsigned  sessionId)

◆ removeDestinationFrom()

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

◆ reset()

void Socket::reset ( )

◆ socketNum()

int Socket::socketNum ( ) const

Definition at line 90 of file NetInterface.hh.

90 { return fSocketNum; }
int fSocketNum

References Socket::fSocketNum.

◆ sourceFilterAddress()

struct in_addr const& Groupsock::sourceFilterAddress ( ) const

Definition at line 119 of file Groupsock.hh.

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

References fIncomingGroupEId, and GroupEId::sourceFilterAddress().

◆ sourcePortNum()

portNumBits OutputSocket::sourcePortNum ( ) const

Definition at line 54 of file Groupsock.hh.

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

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

◆ ttl()

u_int8_t Groupsock::ttl ( ) const

Definition at line 127 of file Groupsock.hh.

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

References fIncomingGroupEId, and GroupEId::ttl().

◆ 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 

Referenced by OutputSocket::write().

◆ write() [2/2]

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

Definition at line 46 of file Groupsock.hh.

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)

References OutputSocket::write().

Field Documentation

◆ DebugLevel

int Socket::DebugLevel

Definition at line 98 of file NetInterface.hh.

◆ DefaultUsageEnvironment

UsageEnvironment* NetInterface::DefaultUsageEnvironment

Definition at line 32 of file NetInterface.hh.

◆ deleteIfNoMembers

Boolean Groupsock::deleteIfNoMembers

Definition at line 136 of file Groupsock.hh.

◆ fDests

destRecord* Groupsock::fDests

Definition at line 167 of file Groupsock.hh.

Referenced by hasMultipleDestinations().

◆ fIncomingGroupEId

GroupEId Groupsock::fIncomingGroupEId

Definition at line 169 of file Groupsock.hh.

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

◆ fMembers

DirectedNetInterfaceSet Groupsock::fMembers

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

Definition at line 139 of file Groupsock.hh.

◆ statsOutgoing

NetInterfaceTrafficStats Groupsock::statsOutgoing

Definition at line 140 of file Groupsock.hh.

◆ statsRelayedIncoming

NetInterfaceTrafficStats Groupsock::statsRelayedIncoming

Definition at line 141 of file Groupsock.hh.

◆ statsRelayedOutgoing

NetInterfaceTrafficStats Groupsock::statsRelayedOutgoing

Definition at line 142 of file Groupsock.hh.

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