nl:: Inet:: IPEndPointBasis
#include <src/inet/IPEndPointBasis.h>
Objects of this class represent non-instantiable IP protocol endpoints.
Summary
Inheritance
Inherits from: nl::Inet::EndPointBasisDirect Known Subclasses:
nl::Inet::RawEndPoint
nl::Inet::UDPEndPoint
Public types |
|
---|---|
@8{
|
enum Basic dynamic state of the underlying endpoint. |
@9{
|
enum Transmit option flags for the SendMsg method. |
OnMessageReceivedFunct)(IPEndPointBasis *endPoint, Weave::System::PacketBuffer *msg, const IPPacketInfo *pktInfo)
|
typedefvoid(*
Type of message text reception event handling function. |
OnReceiveErrorFunct)(IPEndPointBasis *endPoint, INET_ERROR err, const IPPacketInfo *pktInfo)
|
typedefvoid(*
Type of reception error event handling function. |
Public attributes |
|
---|---|
OnMessageReceived
|
The endpoint's message reception event handling function delegate.
|
OnReceiveError
|
The endpoint's receive error event handling function delegate.
|
mState
|
enum nl::Inet::IPEndPointBasis::@8
Basic dynamic state of the underlying endpoint.
|
Protected attributes |
|
---|---|
mBoundIntfId
|
InterfaceId
|
Public functions |
|
---|---|
JoinMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
|
Join an IP multicast group.
|
LeaveMulticastGroup(InterfaceId aInterfaceId, const IPAddress & aAddress)
|
Leave an IP multicast group.
|
SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback)
|
Set whether IP multicast traffic should be looped back.
|
Protected functions |
|
---|---|
Bind(IPAddressType aAddressType, IPAddress aAddress, uint16_t aPort, InterfaceId aInterfaceId)
|
|
BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId)
|
|
GetSocket(IPAddressType aAddressType, int aType, int aProtocol)
|
|
HandleDataReceived(Weave::System::PacketBuffer *aBuffer)
|
void
|
HandlePendingIO(uint16_t aPort)
|
void
|
Init(InetLayer *aInetLayer)
|
void
|
PrepareIO(void)
|
|
SendMsg(const IPPacketInfo *aPktInfo, Weave::System::PacketBuffer *aBuffer, uint16_t aSendFlags)
|
Public static functions |
|
---|---|
FindNetifFromInterfaceId(InterfaceId aInterfaceId)
|
struct netif *
|
Protected static functions |
|
---|---|
GetPacketInfo(Weave::System::PacketBuffer *buf)
|
Get LwIP IP layer source and destination addressing information.
|
Public types
@8
@8
Basic dynamic state of the underlying endpoint.
Objects are initialized in the "ready" state, proceed to the "bound" state after binding to a local interface address, then proceed to the "listening" state when they have continuations registered for handling events for reception of ICMP messages.
Note:The kBasisState_Closed
state enumeration is mapped to kState_Ready
for historical binary-compatibility reasons. The existing kState_Closed
exists to identify separately the distinction between "not opened yet" and "previously opened
now closed" that existed previously in the kState_Ready
and kState_Closed
states.
@9
@9
OnMessageReceivedFunct
void(* OnMessageReceivedFunct)(IPEndPointBasis *endPoint, Weave::System::PacketBuffer *msg, const IPPacketInfo *pktInfo)
Type of message text reception event handling function.
Provide a function of this type to the OnMessageReceived
delegate member to process message text reception events on endPoint
where msg
is the message text received from the sender at senderAddr
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
OnReceiveErrorFunct
void(* OnReceiveErrorFunct)(IPEndPointBasis *endPoint, INET_ERROR err, const IPPacketInfo *pktInfo)
Type of reception error event handling function.
Provide a function of this type to the OnReceiveError
delegate member to process reception error events on endPoint
. The err
argument provides specific detail about the type of the error.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Public attributes
OnMessageReceived
OnMessageReceivedFunct OnMessageReceived
The endpoint's message reception event handling function delegate.
OnReceiveError
OnReceiveErrorFunct OnReceiveError
The endpoint's receive error event handling function delegate.
mState
enum nl::Inet::IPEndPointBasis::@8 mState
Basic dynamic state of the underlying endpoint.
Objects are initialized in the "ready" state, proceed to the "bound" state after binding to a local interface address, then proceed to the "listening" state when they have continuations registered for handling events for reception of ICMP messages.
Note:The kBasisState_Closed
state enumeration is mapped to kState_Ready
for historical binary-compatibility reasons. The existing kState_Closed
exists to identify separately the distinction between "not opened yet" and "previously opened
now closed" that existed previously in the kState_Ready
and kState_Closed
states.
Protected attributes
mBoundIntfId
InterfaceId mBoundIntfId
Public functions
JoinMulticastGroup
INET_ERROR JoinMulticastGroup( InterfaceId aInterfaceId, const IPAddress & aAddress )
Join an IP multicast group.
Join the endpoint to the supplied multicast group on the specified interface.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
LeaveMulticastGroup
INET_ERROR LeaveMulticastGroup( InterfaceId aInterfaceId, const IPAddress & aAddress )
Leave an IP multicast group.
Remove the endpoint from the supplied multicast group on the specified interface.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
SetMulticastLoopback
INET_ERROR SetMulticastLoopback( IPVersion aIPVersion, bool aLoopback )
Set whether IP multicast traffic should be looped back.
Set whether or not IP multicast traffic should be looped back to this endpoint.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
Protected functions
Bind
INET_ERROR Bind( IPAddressType aAddressType, IPAddress aAddress, uint16_t aPort, InterfaceId aInterfaceId )
BindInterface
INET_ERROR BindInterface( IPAddressType aAddressType, InterfaceId aInterfaceId )
GetSocket
INET_ERROR GetSocket( IPAddressType aAddressType, int aType, int aProtocol )
HandleDataReceived
void HandleDataReceived( Weave::System::PacketBuffer *aBuffer )
HandlePendingIO
void HandlePendingIO( uint16_t aPort )
Init
void Init( InetLayer *aInetLayer )
PrepareIO
SocketEvents PrepareIO( void )
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *aPktInfo, Weave::System::PacketBuffer *aBuffer, uint16_t aSendFlags )
Public static functions
FindNetifFromInterfaceId
struct netif * FindNetifFromInterfaceId( InterfaceId aInterfaceId )
Protected static functions
GetPacketInfo
IPPacketInfo * GetPacketInfo( Weave::System::PacketBuffer *buf )
Get LwIP IP layer source and destination addressing information.
When using LwIP information about the packet is 'hidden' in the reserved space before the start of the data in the packet buffer. This is necessary because the system layer events only have two arguments, which in this case are used to convey the pointer to the end point and the pointer to the buffer.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
a pointer to the address information on success; otherwise, NULL if there is insufficient space in the packet for the address information.
|
In most cases this trick of storing information before the data works because the first buffer in an LwIP IP message contains the space that was used for the Ethernet/IP/UDP headers. However, given the current size of the IPPacketInfo structure (40 bytes), it is possible for there to not be enough room to store the structure along with the payload in a single packet buffer. In practice, this should only happen for extremely large IPv4 packets that arrive without an Ethernet header.