#include <Groupsock.hh>
Inheritance diagram for Groupsock:


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 () |
| void | changeDestinationParameters (struct in_addr const &newDestAddr, Port newDestPort, int newDestTTL) |
| void | addDestination (struct in_addr const &addr, Port const &port) |
| void | removeDestination (struct in_addr const &addr, Port const &port) |
| void | removeAllDestinations () |
| in_addr const & | groupAddress () const |
| in_addr const & | sourceFilterAddress () const |
| Boolean | isSSM () const |
| u_int8_t | ttl () const |
| void | multicastSendOnly () |
| Boolean | output (UsageEnvironment &env, u_int8_t ttl, unsigned char *buffer, unsigned bufferSize, DirectedNetInterface *interfaceNotToFwdBackTo=NULL) |
| DirectedNetInterfaceSet & | members () |
| Boolean | wasLoopedBackFromUs (UsageEnvironment &env, struct sockaddr_in &fromAddress) |
| virtual Boolean | handleRead (unsigned char *buffer, unsigned bufferMaxSize, unsigned &bytesRead, struct sockaddr_in &fromAddress) |
| Boolean | write (netAddressBits address, Port port, u_int8_t ttl, unsigned char *buffer, unsigned bufferSize) |
| int | socketNum () const |
| Port | port () const |
| UsageEnvironment & | env () 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 = 1 |
| static UsageEnvironment * | DefaultUsageEnvironment = NULL |
Protected Member Functions | |
| portNumBits | sourcePortNum () const |
| Boolean | changePort (Port newPort) |
Private Member Functions | |
| int | outputToAllMembersExcept (DirectedNetInterface *exceptInterface, u_int8_t ttlToFwd, unsigned char *data, unsigned size, netAddressBits sourceAddr) |
Private Attributes | |
| GroupEId | fIncomingGroupEId |
| destRecord * | fDests |
| u_int8_t | fTTL |
| DirectedNetInterfaceSet | fMembers |
Definition at line 78 of file Groupsock.hh.
| Groupsock::Groupsock | ( | UsageEnvironment & | env, | |
| struct in_addr const & | groupAddr, | |||
| Port | port, | |||
| u_int8_t | ttl | |||
| ) |
Definition at line 110 of file Groupsock.cpp.
References addDestination(), Socket::DebugLevel, Socket::env(), UsageEnvironment::getResultMsg(), ourIPAddress(), Socket::port(), socketJoinGroup(), and Socket::socketNum().
00112 : OutputSocket(env, port), 00113 deleteIfNoMembers(False), isSlave(False), 00114 fIncomingGroupEId(groupAddr, port.num(), ttl), fDests(NULL), fTTL(ttl) { 00115 addDestination(groupAddr, port); 00116 00117 if (!socketJoinGroup(env, socketNum(), groupAddr.s_addr)) { 00118 if (DebugLevel >= 1) { 00119 env << *this << ": failed to join group: " 00120 << env.getResultMsg() << "\n"; 00121 } 00122 } 00123 00124 // Make sure we can get our source address: 00125 if (ourIPAddress(env) == 0) { 00126 if (DebugLevel >= 0) { // this is a fatal error 00127 env << "Unable to determine our source address: " 00128 << env.getResultMsg() << "\n"; 00129 } 00130 } 00131 00132 if (DebugLevel >= 2) env << *this << ": created\n"; 00133 }
| Groupsock::Groupsock | ( | UsageEnvironment & | env, | |
| struct in_addr const & | groupAddr, | |||
| struct in_addr const & | sourceFilterAddr, | |||
| Port | port | |||
| ) |
Definition at line 136 of file Groupsock.cpp.
References addDestination(), Socket::DebugLevel, Socket::env(), UsageEnvironment::getResultMsg(), Socket::port(), socketJoinGroup(), socketJoinGroupSSM(), and Socket::socketNum().
00139 : OutputSocket(env, port), 00140 deleteIfNoMembers(False), isSlave(False), 00141 fIncomingGroupEId(groupAddr, sourceFilterAddr, port.num()), 00142 fDests(NULL), fTTL(255) { 00143 addDestination(groupAddr, port); 00144 00145 // First try a SSM join. If that fails, try a regular join: 00146 if (!socketJoinGroupSSM(env, socketNum(), groupAddr.s_addr, 00147 sourceFilterAddr.s_addr)) { 00148 if (DebugLevel >= 3) { 00149 env << *this << ": SSM join failed: " 00150 << env.getResultMsg(); 00151 env << " - trying regular join instead\n"; 00152 } 00153 if (!socketJoinGroup(env, socketNum(), groupAddr.s_addr)) { 00154 if (DebugLevel >= 1) { 00155 env << *this << ": failed to join group: " 00156 << env.getResultMsg() << "\n"; 00157 } 00158 } 00159 } 00160 00161 if (DebugLevel >= 2) env << *this << ": created\n"; 00162 }
| Groupsock::~Groupsock | ( | ) | [virtual] |
Definition at line 164 of file Groupsock.cpp.
References Socket::DebugLevel, Socket::env(), fDests, groupAddress(), isSSM(), socketLeaveGroup(), socketLeaveGroupSSM(), Socket::socketNum(), and sourceFilterAddress().
00164 { 00165 if (isSSM()) { 00166 if (!socketLeaveGroupSSM(env(), socketNum(), groupAddress().s_addr, 00167 sourceFilterAddress().s_addr)) { 00168 socketLeaveGroup(env(), socketNum(), groupAddress().s_addr); 00169 } 00170 } else { 00171 socketLeaveGroup(env(), socketNum(), groupAddress().s_addr); 00172 } 00173 00174 delete fDests; 00175 00176 if (DebugLevel >= 2) env() << *this << ": deleting\n"; 00177 }
| void Groupsock::changeDestinationParameters | ( | struct in_addr const & | newDestAddr, | |
| Port | newDestPort, | |||
| int | newDestTTL | |||
| ) |
Definition at line 180 of file Groupsock.cpp.
References Socket::changePort(), Socket::env(), fDests, destRecord::fGroupEId, destRecord::fPort, GroupEId::groupAddress(), IsMulticastAddress(), NULL, Port::num(), GroupEId::portNum(), socketJoinGroup(), socketLeaveGroup(), Socket::socketNum(), and ttl().
Referenced by PassiveServerMediaSubsession::getStreamParameters(), MediaSubsession::initiate(), main(), SIPClient::processURL(), MediaSubsession::setDestinations(), and SIPClient::setProxyServer().
00181 { 00182 if (fDests == NULL) return; 00183 00184 struct in_addr destAddr = fDests->fGroupEId.groupAddress(); 00185 if (newDestAddr.s_addr != 0) { 00186 if (newDestAddr.s_addr != destAddr.s_addr 00187 && IsMulticastAddress(newDestAddr.s_addr)) { 00188 // If the new destination is a multicast address, then we assume that 00189 // we want to join it also. (If this is not in fact the case, then 00190 // call "multicastSendOnly()" afterwards.) 00191 socketLeaveGroup(env(), socketNum(), destAddr.s_addr); 00192 socketJoinGroup(env(), socketNum(), newDestAddr.s_addr); 00193 } 00194 destAddr.s_addr = newDestAddr.s_addr; 00195 } 00196 00197 portNumBits destPortNum = fDests->fGroupEId.portNum(); 00198 if (newDestPort.num() != 0) { 00199 if (newDestPort.num() != destPortNum 00200 && IsMulticastAddress(destAddr.s_addr)) { 00201 // Also bind to the new port number: 00202 changePort(newDestPort); 00203 // And rejoin the multicast group: 00204 socketJoinGroup(env(), socketNum(), destAddr.s_addr); 00205 } 00206 destPortNum = newDestPort.num(); 00207 fDests->fPort = newDestPort; 00208 } 00209 00210 u_int8_t destTTL = ttl(); 00211 if (newDestTTL != ~0) destTTL = (u_int8_t)newDestTTL; 00212 00213 fDests->fGroupEId = GroupEId(destAddr, destPortNum, destTTL); 00214 }
| void Groupsock::addDestination | ( | struct in_addr const & | addr, | |
| Port const & | port | |||
| ) |
Definition at line 216 of file Groupsock.cpp.
References fDests, NULL, Port::num(), Socket::port(), and ttl().
Referenced by Groupsock(), and StreamState::startPlaying().
00216 { 00217 // Check whether this destination is already known: 00218 for (destRecord* dests = fDests; dests != NULL; dests = dests->fNext) { 00219 if (addr.s_addr == dests->fGroupEId.groupAddress().s_addr 00220 && port.num() == dests->fPort.num()) { 00221 return; 00222 } 00223 } 00224 00225 fDests = new destRecord(addr, port, ttl(), fDests); 00226 }
| void Groupsock::removeDestination | ( | struct in_addr const & | addr, | |
| Port const & | port | |||
| ) |
Definition at line 228 of file Groupsock.cpp.
References fDests, NULL, Port::num(), and Socket::port().
Referenced by StreamState::endPlaying().
00228 { 00229 for (destRecord** destsPtr = &fDests; *destsPtr != NULL; 00230 destsPtr = &((*destsPtr)->fNext)) { 00231 if (addr.s_addr == (*destsPtr)->fGroupEId.groupAddress().s_addr 00232 && port.num() == (*destsPtr)->fPort.num()) { 00233 // Remove the record pointed to by *destsPtr : 00234 destRecord* next = (*destsPtr)->fNext; 00235 (*destsPtr)->fNext = NULL; 00236 delete (*destsPtr); 00237 *destsPtr = next; 00238 return; 00239 } 00240 } 00241 }
| void Groupsock::removeAllDestinations | ( | ) |
Definition at line 243 of file Groupsock.cpp.
Referenced by OnDemandServerMediaSubsession::getStreamParameters(), and RTPInterface::setStreamSocket().
| struct in_addr const& Groupsock::groupAddress | ( | ) | const [inline, read] |
Definition at line 104 of file Groupsock.hh.
References fIncomingGroupEId, and GroupEId::groupAddress().
Referenced by PassiveServerMediaSubsession::getStreamParameters(), operator<<(), GroupsockLookupTable::Remove(), PassiveServerMediaSubsession::sdpLines(), and ~Groupsock().
00104 { 00105 return fIncomingGroupEId.groupAddress(); 00106 }
| struct in_addr const& Groupsock::sourceFilterAddress | ( | ) | const [inline, read] |
Definition at line 107 of file Groupsock.hh.
References fIncomingGroupEId, and GroupEId::sourceFilterAddress().
Referenced by handleRead(), operator<<(), outputToAllMembersExcept(), GroupsockLookupTable::Remove(), and ~Groupsock().
00107 { 00108 return fIncomingGroupEId.sourceFilterAddress(); 00109 }
| Boolean Groupsock::isSSM | ( | ) | const [inline] |
Definition at line 111 of file Groupsock.hh.
References fIncomingGroupEId, and GroupEId::isSSM().
Referenced by handleRead(), operator<<(), outputToAllMembersExcept(), and ~Groupsock().
00111 { 00112 return fIncomingGroupEId.isSSM(); 00113 }
| u_int8_t Groupsock::ttl | ( | ) | const [inline] |
Definition at line 115 of file Groupsock.hh.
References fTTL.
Referenced by addDestination(), BasicUDPSink::afterGettingFrame1(), changeDestinationParameters(), PassiveServerMediaSubsession::getStreamParameters(), handleRead(), operator<<(), PassiveServerMediaSubsession::sdpLines(), and RTPInterface::sendPacket().
00115 { return fTTL; }
| void Groupsock::multicastSendOnly | ( | ) |
Definition at line 247 of file Groupsock.cpp.
References Socket::env(), fDests, fIncomingGroupEId, GroupEId::groupAddress(), NULL, socketLeaveGroup(), and Socket::socketNum().
Referenced by main(), and RTCPInstance::RTCPInstance().
00247 { 00248 socketLeaveGroup(env(), socketNum(), fIncomingGroupEId.groupAddress().s_addr); 00249 for (destRecord* dests = fDests; dests != NULL; dests = dests->fNext) { 00250 socketLeaveGroup(env(), socketNum(), dests->fGroupEId.groupAddress().s_addr); 00251 } 00252 }
| Boolean Groupsock::output | ( | UsageEnvironment & | env, | |
| u_int8_t | ttl, | |||
| unsigned char * | buffer, | |||
| unsigned | bufferSize, | |||
| DirectedNetInterface * | interfaceNotToFwdBackTo = NULL | |||
| ) |
Definition at line 254 of file Groupsock.cpp.
References NetInterfaceTrafficStats::countPacket(), Socket::DebugLevel, Socket::env(), False, fDests, UsageEnvironment::getResultMsg(), members(), NULL, ourIPAddress(), outputToAllMembersExcept(), UsageEnvironment::setResultMsg(), statsGroupOutgoing, statsOutgoing, True, and OutputSocket::write().
Referenced by BasicUDPSink::afterGettingFrame1(), RTPInterface::sendPacket(), SIPClient::sendRequest(), and SIPClient::SIPClient().
00256 { 00257 do { 00258 // First, do the datagram send, to each destination: 00259 Boolean writeSuccess = True; 00260 for (destRecord* dests = fDests; dests != NULL; dests = dests->fNext) { 00261 if (!write(dests->fGroupEId.groupAddress().s_addr, dests->fPort, ttlToSend, 00262 buffer, bufferSize)) { 00263 writeSuccess = False; 00264 break; 00265 } 00266 } 00267 if (!writeSuccess) break; 00268 statsOutgoing.countPacket(bufferSize); 00269 statsGroupOutgoing.countPacket(bufferSize); 00270 00271 // Then, forward to our members: 00272 int numMembers = 0; 00273 if (!members().IsEmpty()) { 00274 numMembers = 00275 outputToAllMembersExcept(interfaceNotToFwdBackTo, 00276 ttlToSend, buffer, bufferSize, 00277 ourIPAddress(env)); 00278 if (numMembers < 0) break; 00279 } 00280 00281 if (DebugLevel >= 3) { 00282 env << *this << ": wrote " << bufferSize << " bytes, ttl " 00283 << (unsigned)ttlToSend; 00284 if (numMembers > 0) { 00285 env << "; relayed to " << numMembers << " members"; 00286 } 00287 env << "\n"; 00288 } 00289 return True; 00290 } while (0); 00291 00292 if (DebugLevel >= 0) { // this is a fatal error 00293 env.setResultMsg("Groupsock write failed: ", env.getResultMsg()); 00294 } 00295 return False; 00296 }
| DirectedNetInterfaceSet& Groupsock::members | ( | ) | [inline] |
Definition at line 123 of file Groupsock.hh.
References fMembers.
Referenced by output(), and outputToAllMembersExcept().
00123 { return fMembers; }
| Boolean Groupsock::wasLoopedBackFromUs | ( | UsageEnvironment & | env, | |
| struct sockaddr_in & | fromAddress | |||
| ) |
Definition at line 353 of file Groupsock.cpp.
References Socket::DebugLevel, Socket::env(), False, ourIPAddress(), OutputSocket::sourcePortNum(), and True.
Referenced by handleRead().
00354 { 00355 if (fromAddress.sin_addr.s_addr 00356 == ourIPAddress(env)) { 00357 if (fromAddress.sin_port == sourcePortNum()) { 00358 #ifdef DEBUG_LOOPBACK_CHECKING 00359 if (DebugLevel >= 3) { 00360 env() << *this << ": got looped-back packet\n"; 00361 } 00362 #endif 00363 return True; 00364 } 00365 } 00366 00367 return False; 00368 }
| Boolean Groupsock::handleRead | ( | unsigned char * | buffer, | |
| unsigned | bufferMaxSize, | |||
| unsigned & | bytesRead, | |||
| struct sockaddr_in & | fromAddress | |||
| ) | [virtual] |
Reimplemented from OutputSocket.
Definition at line 298 of file Groupsock.cpp.
References NetInterfaceTrafficStats::countPacket(), Socket::DebugLevel, Socket::env(), False, isSSM(), NULL, our_inet_ntoa(), outputToAllMembersExcept(), readSocket(), UsageEnvironment::setResultMsg(), Socket::socketNum(), sourceFilterAddress(), statsGroupIncoming, statsGroupRelayedIncoming, statsIncoming, statsRelayedIncoming, True, ttl(), TunnelEncapsulationTrailerMaxSize, and wasLoopedBackFromUs().
Referenced by SIPClient::getResponse(), SIPClient::getResponseCode(), RTPInterface::handleRead(), BasicUDPSource::incomingPacketHandler1(), and main().
00300 { 00301 // Read data from the socket, and relay it across any attached tunnels 00302 //##### later make this code more general - independent of tunnels 00303 00304 bytesRead = 0; 00305 00306 int maxBytesToRead = bufferMaxSize - TunnelEncapsulationTrailerMaxSize; 00307 int numBytes = readSocket(env(), socketNum(), 00308 buffer, maxBytesToRead, fromAddress); 00309 if (numBytes < 0) { 00310 if (DebugLevel >= 0) { // this is a fatal error 00311 env().setResultMsg("Groupsock read failed: ", 00312 env().getResultMsg()); 00313 } 00314 return False; 00315 } 00316 00317 // If we're a SSM group, make sure the source address matches: 00318 if (isSSM() 00319 && fromAddress.sin_addr.s_addr != sourceFilterAddress().s_addr) { 00320 return True; 00321 } 00322 00323 // We'll handle this data. 00324 // Also write it (with the encapsulation trailer) to each member, 00325 // unless the packet was originally sent by us to begin with. 00326 bytesRead = numBytes; 00327 00328 int numMembers = 0; 00329 if (!wasLoopedBackFromUs(env(), fromAddress)) { 00330 statsIncoming.countPacket(numBytes); 00331 statsGroupIncoming.countPacket(numBytes); 00332 numMembers = 00333 outputToAllMembersExcept(NULL, ttl(), 00334 buffer, bytesRead, 00335 fromAddress.sin_addr.s_addr); 00336 if (numMembers > 0) { 00337 statsRelayedIncoming.countPacket(numBytes); 00338 statsGroupRelayedIncoming.countPacket(numBytes); 00339 } 00340 } 00341 if (DebugLevel >= 3) { 00342 env() << *this << ": read " << bytesRead << " bytes from "; 00343 env() << our_inet_ntoa(fromAddress.sin_addr); 00344 if (numMembers > 0) { 00345 env() << "; relayed to " << numMembers << " members"; 00346 } 00347 env() << "\n"; 00348 } 00349 00350 return True; 00351 }
| int Groupsock::outputToAllMembersExcept | ( | DirectedNetInterface * | exceptInterface, | |
| u_int8_t | ttlToFwd, | |||
| unsigned char * | data, | |||
| unsigned | size, | |||
| netAddressBits | sourceAddr | |||
| ) | [private] |
Definition at line 370 of file Groupsock.cpp.
References TunnelEncapsulationTrailer::address(), TunnelEncapsulationTrailer::auxAddress(), TunnelEncapsulationTrailer::command(), Socket::env(), fDests, destRecord::fGroupEId, destRecord::fPort, UsageEnvironment::getResultMsg(), GroupEId::groupAddress(), isSSM(), iter, members(), MediaSubsessionIterator::next(), NULL, TunnelEncapsulationTrailer::port(), DirectedNetInterface::SourceAddrOKForRelaying(), sourceFilterAddress(), TunnelEncapsulationTrailer::ttl(), TunnelDataAuxCmd, TunnelDataCmd, TunnelEncapsulationTrailerAuxSize, TunnelEncapsulationTrailerMaxSize, TunnelEncapsulationTrailerSize, and DirectedNetInterface::write().
Referenced by handleRead(), and output().
00373 { 00374 // Don't forward TTL-0 packets 00375 if (ttlToFwd == 0) return 0; 00376 00377 DirectedNetInterfaceSet::Iterator iter(members()); 00378 unsigned numMembers = 0; 00379 DirectedNetInterface* interf; 00380 while ((interf = iter.next()) != NULL) { 00381 // Check whether we've asked to exclude this interface: 00382 if (interf == exceptInterface) 00383 continue; 00384 00385 // Check that the packet's source address makes it OK to 00386 // be relayed across this interface: 00387 UsageEnvironment& saveEnv = env(); 00388 // because the following call may delete "this" 00389 if (!interf->SourceAddrOKForRelaying(saveEnv, sourceAddr)) { 00390 if (strcmp(saveEnv.getResultMsg(), "") != 0) { 00391 // Treat this as a fatal error 00392 return -1; 00393 } else { 00394 continue; 00395 } 00396 } 00397 00398 if (numMembers == 0) { 00399 // We know that we're going to forward to at least one 00400 // member, so fill in the tunnel encapsulation trailer. 00401 // (Note: Allow for it not being 4-byte-aligned.) 00402 TunnelEncapsulationTrailer* trailerInPacket 00403 = (TunnelEncapsulationTrailer*)&data[size]; 00404 TunnelEncapsulationTrailer* trailer; 00405 00406 Boolean misaligned = ((unsigned long)trailerInPacket & 3) != 0; 00407 unsigned trailerOffset; 00408 u_int8_t tunnelCmd; 00409 if (isSSM()) { 00410 // add an 'auxilliary address' before the trailer 00411 trailerOffset = TunnelEncapsulationTrailerAuxSize; 00412 tunnelCmd = TunnelDataAuxCmd; 00413 } else { 00414 trailerOffset = 0; 00415 tunnelCmd = TunnelDataCmd; 00416 } 00417 unsigned trailerSize = TunnelEncapsulationTrailerSize + trailerOffset; 00418 unsigned tmpTr[TunnelEncapsulationTrailerMaxSize]; 00419 if (misaligned) { 00420 trailer = (TunnelEncapsulationTrailer*)&tmpTr; 00421 } else { 00422 trailer = trailerInPacket; 00423 } 00424 trailer += trailerOffset; 00425 00426 if (fDests != NULL) { 00427 trailer->address() = fDests->fGroupEId.groupAddress().s_addr; 00428 trailer->port() = fDests->fPort; // structure copy, outputs in network order 00429 } 00430 trailer->ttl() = ttlToFwd; 00431 trailer->command() = tunnelCmd; 00432 00433 if (isSSM()) { 00434 trailer->auxAddress() = sourceFilterAddress().s_addr; 00435 } 00436 00437 if (misaligned) { 00438 memmove(trailerInPacket, trailer-trailerOffset, trailerSize); 00439 } 00440 00441 size += trailerSize; 00442 } 00443 00444 interf->write(data, size); 00445 ++numMembers; 00446 } 00447 00448 return numMembers; 00449 }
| Boolean OutputSocket::write | ( | netAddressBits | address, | |
| Port | port, | |||
| u_int8_t | ttl, | |||
| unsigned char * | buffer, | |||
| unsigned | bufferSize | |||
| ) | [inherited] |
Definition at line 53 of file Groupsock.cpp.
References Socket::DebugLevel, Socket::env(), False, OutputSocket::fLastSentTTL, OutputSocket::fSourcePort, UsageEnvironment::getResultMsg(), getSourcePort(), Socket::port(), Socket::socketNum(), OutputSocket::sourcePortNum(), True, and writeSocket().
Referenced by output().
00054 { 00055 if (ttl == fLastSentTTL) { 00056 // Optimization: So we don't do a 'set TTL' system call again 00057 ttl = 0; 00058 } else { 00059 fLastSentTTL = ttl; 00060 } 00061 struct in_addr destAddr; destAddr.s_addr = address; 00062 if (!writeSocket(env(), socketNum(), destAddr, port, ttl, 00063 buffer, bufferSize)) 00064 return False; 00065 00066 if (sourcePortNum() == 0) { 00067 // Now that we've sent a packet, we can find out what the 00068 // kernel chose as our ephemeral source port number: 00069 if (!getSourcePort(env(), socketNum(), fSourcePort)) { 00070 if (DebugLevel >= 1) 00071 env() << *this 00072 << ": failed to get source port: " 00073 << env().getResultMsg() << "\n"; 00074 return False; 00075 } 00076 } 00077 00078 return True; 00079 }
| portNumBits OutputSocket::sourcePortNum | ( | ) | const [inline, protected, inherited] |
Definition at line 50 of file Groupsock.hh.
References OutputSocket::fSourcePort, and Port::num().
Referenced by wasLoopedBackFromUs(), and OutputSocket::write().
00050 {return fSourcePort.num();}
| int Socket::socketNum | ( | ) | const [inline, inherited] |
Definition at line 89 of file NetInterface.hh.
References Socket::fSocketNum.
Referenced by GroupsockLookupTable::AddNew(), BasicUDPSource::BasicUDPSource(), changeDestinationParameters(), BasicUDPSource::doGetNextFrame(), BasicUDPSource::doStopGettingFrames(), SocketLookupTable::Fetch(), OnDemandServerMediaSubsession::getStreamParameters(), Groupsock(), handleRead(), MediaSubsession::initiate(), SIPClient::invite1(), main(), multicastSendOnly(), MultiFramedRTPSource::MultiFramedRTPSource(), operator<<(), RTPInterface::RTPInterface(), SIPClient::SIPClient(), RTPInterface::startNetworkReading(), RTPInterface::stopNetworkReading(), unsetGroupsockBySocket(), OutputSocket::write(), BasicUDPSource::~BasicUDPSource(), and ~Groupsock().
00089 { return fSocketNum; }
| Port Socket::port | ( | ) | const [inline, inherited] |
Definition at line 91 of file NetInterface.hh.
References Socket::fPort.
Referenced by addDestination(), PassiveServerMediaSubsession::getStreamParameters(), Groupsock(), operator<<(), SocketLookupTable::Remove(), GroupsockLookupTable::Remove(), removeDestination(), PassiveServerMediaSubsession::sdpLines(), Socket::Socket(), and OutputSocket::write().
00091 { 00092 return fPort; 00093 }
| UsageEnvironment& Socket::env | ( | ) | const [inline, inherited] |
Definition at line 95 of file NetInterface.hh.
References Socket::fEnv.
Referenced by changeDestinationParameters(), getGroupsockBySocket(), getSocketTable(), Groupsock(), handleRead(), multicastSendOnly(), output(), outputToAllMembersExcept(), setGroupsockBySocket(), socketReadHandler(), unsetGroupsockBySocket(), wasLoopedBackFromUs(), OutputSocket::write(), and ~Groupsock().
00095 { return fEnv; }
Definition at line 104 of file NetInterface.cpp.
References closeSocket, Socket::fEnv, Socket::fSetLoopback, Socket::fSocketNum, and setupDatagramSocket().
Referenced by changeDestinationParameters().
00104 { 00105 closeSocket(fSocketNum); 00106 fSocketNum = setupDatagramSocket(fEnv, newPort, fSetLoopback); 00107 return fSocketNum >= 0; 00108 }
Definition at line 125 of file Groupsock.hh.
Definition at line 126 of file Groupsock.hh.
Definition at line 131 of file Groupsock.hh.
Definition at line 135 of file Groupsock.hh.
GroupEId Groupsock::fIncomingGroupEId [private] |
Definition at line 152 of file Groupsock.hh.
Referenced by groupAddress(), isSSM(), multicastSendOnly(), and sourceFilterAddress().
destRecord* Groupsock::fDests [private] |
Definition at line 153 of file Groupsock.hh.
Referenced by addDestination(), changeDestinationParameters(), multicastSendOnly(), output(), outputToAllMembersExcept(), removeAllDestinations(), removeDestination(), and ~Groupsock().
u_int8_t Groupsock::fTTL [private] |
DirectedNetInterfaceSet Groupsock::fMembers [private] |
int Socket::DebugLevel = 1 [static, inherited] |
Definition at line 97 of file NetInterface.hh.