INET Framework for OMNeT++/OMNEST
inet::EthernetEncapsulation::Socket Struct Reference

#include <EthernetEncapsulation.h>

Public Member Functions

 Socket (int socketId)
 
bool matches (Packet *packet, int ifaceId, const Ptr< const EthernetMacHeader > &ethernetMacHeader)
 

Public Attributes

int socketId = -1
 
int interfaceId = -1
 
MacAddress localAddress
 
MacAddress remoteAddress
 
const Protocolprotocol = nullptr
 
bool steal = false
 

Constructor & Destructor Documentation

◆ Socket()

inet::EthernetEncapsulation::Socket::Socket ( int  socketId)
inline
51 : socketId(socketId) {}

Member Function Documentation

◆ matches()

bool inet::EthernetEncapsulation::Socket::matches ( Packet packet,
int  ifaceId,
const Ptr< const EthernetMacHeader > &  ethernetMacHeader 
)
55 {
56  if (interfaceId != -1 && interfaceId != ifaceId)
57  return false;
58  if (!remoteAddress.isUnspecified() && !ethernetMacHeader->getSrc().isBroadcast() && ethernetMacHeader->getSrc() != remoteAddress)
59  return false;
60  if (!localAddress.isUnspecified() && !ethernetMacHeader->getDest().isBroadcast() && ethernetMacHeader->getDest() != localAddress)
61  return false;
62  if (protocol != nullptr && packet->getTag<PacketProtocolTag>()->getProtocol() != protocol)
63  return false;
64  return true;
65 }

Member Data Documentation

◆ interfaceId

int inet::EthernetEncapsulation::Socket::interfaceId = -1

◆ localAddress

MacAddress inet::EthernetEncapsulation::Socket::localAddress

◆ protocol

const Protocol* inet::EthernetEncapsulation::Socket::protocol = nullptr

◆ remoteAddress

MacAddress inet::EthernetEncapsulation::Socket::remoteAddress

◆ socketId

int inet::EthernetEncapsulation::Socket::socketId = -1

Referenced by inet::operator<<().

◆ steal

bool inet::EthernetEncapsulation::Socket::steal = false

The documentation for this struct was generated from the following files:
inet::EthernetEncapsulation::Socket::remoteAddress
MacAddress remoteAddress
Definition: EthernetEncapsulation.h:47
inet::EthernetEncapsulation::Socket::socketId
int socketId
Definition: EthernetEncapsulation.h:44
inet::EthernetEncapsulation::Socket::interfaceId
int interfaceId
Definition: EthernetEncapsulation.h:45
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::EthernetEncapsulation::Socket::localAddress
MacAddress localAddress
Definition: EthernetEncapsulation.h:46
inet::MacAddress::isUnspecified
bool isUnspecified() const
Returns true if all address bytes are zero.
Definition: MacAddress.h:136
inet::EthernetEncapsulation::Socket::protocol
const Protocol * protocol
Definition: EthernetEncapsulation.h:48