nl:: Inet:: RawEndPoint
#include <src/inet/RawEndPoint.h>
Objects of this class represent raw IP network endpoints.
Summary
Nest Inet Layer encapsulates methods for interacting with IP network endpoints (SOCK_RAW sockets on Linux and BSD-derived systems) or LwIP raw protocol control blocks, as the system is configured accordingly.
Inheritance
Inherits from: nl::Inet::IPEndPointBasis
Public attributes |
|
---|---|
IPProto
|
IPProtocol
version of the Internet Control Message Protocol (ICMP)
|
IPVer
|
IPVersion
Version of the Internet protocol.
|
Public functions |
|
---|---|
Bind(IPAddressType addrType, IPAddress addr, InterfaceId intfId)
|
Bind the endpoint to an interface IP address.
|
BindIPv6LinkLocal(InterfaceId intf, IPAddress addr)
|
Bind the raw endpoint to an IPv6 link-local scope address at the specified interface index.
|
BindInterface(IPAddressType addrType, InterfaceId intf)
|
Bind the endpoint to a network interface.
|
Close(void)
|
void
Close the endpoint.
|
Free(void)
|
void
Close the endpoint and recycle its memory.
|
GetBoundInterface(void)
|
InterfaceId
Get the bound interface on this endpoint.
|
Listen(void)
|
Prepare the endpoint to receive ICMP messages.
|
SendMsg(const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Send an ICMP message to the specified destination.
|
SendTo(IPAddress addr, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
A synonym for
SendTo(addr, INET_NULL_INTERFACEID, msg, sendFlags) . |
SendTo(IPAddress addr, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Send an ICMP message to the specified destination address.
|
SetICMPFilter(uint8_t numICMPTypes, const uint8_t *aICMPTypes)
|
Set the ICMP6 filter parameters in the network stack.
|
Public attributes
IPProto
IPProtocol IPProto
version of the Internet Control Message Protocol (ICMP)
While this field is a mutable class variable, it is an invariant of the class that it not be modified.
IPVer
IPVersion IPVer
Version of the Internet protocol.
While this field is a mutable class variable, it is an invariant of the class that it not be modified.
Public functions
Bind
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, InterfaceId intfId )
Bind the endpoint to an interface IP address.
Binds the endpoint to the specified network interface IP address.
Details | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||
Return Values |
|
On LwIP, this method must not be called with the LwIP stack lock already acquired.
BindIPv6LinkLocal
INET_ERROR BindIPv6LinkLocal( InterfaceId intf, IPAddress addr )
Bind the raw endpoint to an IPv6 link-local scope address at the specified interface index.
Also sets various IPv6 socket options appropriate for transmitting packets to and from on-link destinations.
Binds the endpoint to the IPv6 link-local address addr
on the network interface indicated by intf
.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Parameters |
|
||||||||||||
Return Values |
|
||||||||||||
Returns |
INET_NO_ERROR on success, or a mapped OS error on failure. An invalid parameter list can result in INET_ERROR_WRONG_ADDRESS_TYPE. If the raw endpoint is already bound or is listening, then returns INET_ERROR_INCORRECT_STATE. Bind the endpoint to an interface IPv6 link-local address.
|
On LwIP, this method must not be called with the LwIP stack lock already acquired.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
Bind the endpoint to a network interface.
Binds the endpoint to the specified network interface IP address.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
On LwIP, this method must not be called with the LwIP stack lock already acquired.
Close
void Close( void )
Close the endpoint.
If mState != kState_Closed
, then closes the endpoint, removing it from the set of endpoints eligible for communication events.
On LwIP systems, this method must not be called with the LwIP stack lock already acquired.
Free
void Free( void )
Close the endpoint and recycle its memory.
Invokes the Close
method, then invokes the InetLayerBasis::Release
method to return the object to its memory pool.
On LwIP systems, this method must not be called with the LwIP stack lock already acquired.
GetBoundInterface
InterfaceId GetBoundInterface( void )
Get the bound interface on this endpoint.
Details | |
---|---|
Returns |
InterfaceId The bound interface id.
|
Listen
INET_ERROR Listen( void )
Prepare the endpoint to receive ICMP messages.
If mState
is already kState_Listening
, then no operation is performed, otherwise the mState
is set to kState_Listening
and the endpoint is prepared to received ICMPv6 messages, according to the semantics of the platform.
Details | |||
---|---|---|---|
Return Values |
|
On LwIP, this method must not be called with the LwIP stack lock already acquired
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Send an ICMP message to the specified destination.
Send the ICMP message \c msg using the destination information given in \c addr. Where (sendFlags & kSendFlag_RetainBuffer) != 0, calls Weave::System::PacketBuffer::Free on behalf of the caller, otherwise this method deep-copies \c msg into a fresh object, and queues that for transmission, leaving the original \c msg available after return.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
SendTo
INET_ERROR SendTo( IPAddress addr, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
A synonym for SendTo(addr, INET_NULL_INTERFACEID, msg, sendFlags)
.
SendTo
INET_ERROR SendTo( IPAddress addr, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Send an ICMP message to the specified destination address.
Send the ICMP message in \c msg to the destination given in \c addr. Where (sendFlags & kSendFlag_RetainBuffer) != 0, calls Weave::System::PacketBuffer::Free on behalf of the caller, otherwise this method deep-copies \c msg into a fresh object, and queues that for transmission, leaving the original \c msg available after return.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
SetICMPFilter
INET_ERROR SetICMPFilter( uint8_t numICMPTypes, const uint8_t *aICMPTypes )
Set the ICMP6 filter parameters in the network stack.
Apply the ICMPv6 filtering parameters for the codes in aICMPTypes
to the underlying endpoint in the system networking stack.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|