INET Framework for OMNeT++/OMNEST
inet::UDP::SockDesc Struct Reference

#include <UDP.h>

Public Member Functions

 SockDesc (int sockId, int appGateIndex)
 
 ~SockDesc ()
 
MulticastMembershipTable::iterator findFirstMulticastMembership (const L3Address &multicastAddress)
 
MulticastMembershipfindMulticastMembership (const L3Address &multicastAddress, int interfaceId)
 
void addMulticastMembership (MulticastMembership *membership)
 
void deleteMulticastMembership (MulticastMembership *membership)
 

Public Attributes

int sockId = -1
 
int appGateIndex = -1
 
bool isBound = false
 
bool onlyLocalPortIsSet = false
 
bool reuseAddr = false
 
L3Address localAddr
 
L3Address remoteAddr
 
int localPort = -1
 
int remotePort = -1
 
bool isBroadcast = false
 
int multicastOutputInterfaceId = -1
 
bool multicastLoop = DEFAULT_MULTICAST_LOOP
 
int ttl = -1
 
unsigned char typeOfService = 0
 
MulticastMembershipTable multicastMembershipTable
 

Constructor & Destructor Documentation

inet::UDP::SockDesc::SockDesc ( int  sockId,
int  appGateIndex 
)
97 {
98  sockId = sockId_;
99  appGateIndex = appGateIndex_;
100 }
int appGateIndex
Definition: UDP.h:73
int sockId
Definition: UDP.h:72
inet::UDP::SockDesc::~SockDesc ( )
103 {
104  for(auto & elem : multicastMembershipTable)
105  delete (elem);
106 }
MulticastMembershipTable multicastMembershipTable
Definition: UDP.h:86

Member Function Documentation

void inet::UDP::SockDesc::addMulticastMembership ( MulticastMembership membership)

Referenced by inet::UDP::joinMulticastGroups(), inet::UDP::joinMulticastSources(), and inet::UDP::setMulticastSourceFilter().

1222 {
1223  auto it = lower_bound(multicastMembershipTable.begin(), multicastMembershipTable.end(), membership, lessMembership);
1224  multicastMembershipTable.insert(it, membership);
1225 }
MulticastMembershipTable multicastMembershipTable
Definition: UDP.h:86
void inet::UDP::SockDesc::deleteMulticastMembership ( MulticastMembership membership)

Referenced by inet::UDP::leaveMulticastSources().

1228 {
1230  multicastMembershipTable.end());
1231  delete membership;
1232 }
void remove(std::vector< T > &v, const A &a)
Definition: stlutils.h:91
MulticastMembershipTable multicastMembershipTable
Definition: UDP.h:86
UDP::MulticastMembershipTable::iterator inet::UDP::SockDesc::findFirstMulticastMembership ( const L3Address multicastAddress)

Referenced by inet::UDP::findSocketsForMcastBcastPacket(), and inet::UDP::leaveMulticastGroups().

1196 {
1197  MulticastMembership membership;
1198  membership.multicastAddress = multicastAddress;
1199  membership.interfaceId = 0; // less than any other interfaceId
1200 
1201  auto it = lower_bound(multicastMembershipTable.begin(), multicastMembershipTable.end(), &membership, lessMembership);
1202  if (it != multicastMembershipTable.end() && (*it)->multicastAddress == multicastAddress)
1203  return it;
1204  else
1205  return multicastMembershipTable.end();
1206 }
MulticastMembershipTable multicastMembershipTable
Definition: UDP.h:86
UDP::MulticastMembership * inet::UDP::SockDesc::findMulticastMembership ( const L3Address multicastAddress,
int  interfaceId 
)

Referenced by inet::UDP::blockMulticastSources(), inet::UDP::joinMulticastGroups(), inet::UDP::joinMulticastSources(), inet::UDP::leaveMulticastSources(), inet::UDP::setMulticastSourceFilter(), and inet::UDP::unblockMulticastSources().

1209 {
1210  MulticastMembership membership;
1211  membership.multicastAddress = multicastAddress;
1212  membership.interfaceId = interfaceId;
1213 
1214  auto it = lower_bound(multicastMembershipTable.begin(), multicastMembershipTable.end(), &membership, lessMembership);
1215  if (it != multicastMembershipTable.end() && (*it)->multicastAddress == multicastAddress && (*it)->interfaceId == interfaceId)
1216  return *it;
1217  else
1218  return nullptr;
1219 }
MulticastMembershipTable multicastMembershipTable
Definition: UDP.h:86

Member Data Documentation

int inet::UDP::SockDesc::appGateIndex = -1
bool inet::UDP::SockDesc::isBound = false
bool inet::UDP::SockDesc::isBroadcast = false
MulticastMembershipTable inet::UDP::SockDesc::multicastMembershipTable
int inet::UDP::SockDesc::multicastOutputInterfaceId = -1
bool inet::UDP::SockDesc::onlyLocalPortIsSet = false
bool inet::UDP::SockDesc::reuseAddr = false
int inet::UDP::SockDesc::ttl = -1
unsigned char inet::UDP::SockDesc::typeOfService = 0

The documentation for this struct was generated from the following files: