nl:: Inet
Summary
Typedefs |
|
---|---|
InterfaceId
|
typedefstruct netif *
Indicator for system network interfaces. |
Variables |
|
---|---|
sIOCTLSocket = -1
|
int
|
Functions |
|
---|---|
CheckMulticastGroupArgs(InterfaceId aInterfaceId, const IPAddress & aAddress)
|
|
CloseIOCTLSocket(void)
|
void
Close the global socket created by
GetIOCTLSocket . |
FormatInetLayerError(char *buf, uint16_t bufSize, int32_t err)
|
bool
Given an Inet Layer error, returns a human-readable NULL-terminated C string describing the error.
|
GetIOCTLSocket(void)
|
int
Returns a global general purpose socket useful for invoking certain network IOCTLs.
|
GetInterfaceName(InterfaceId intfId, char *nameBuf, size_t nameBufSize)
|
NL_DLL_EXPORT INET_ERROR
Get the name of a network interface.
|
INET_IsInetEvent(Weave::System::EventType aType)
|
bool
Check to verify if a System::EventType is a valid Inet layer event type.
|
InterfaceNameToId(const char *intfName, InterfaceId & intfId)
|
NL_DLL_EXPORT INET_ERROR
Search the list of network interfaces for the indicated name.
|
LwIPBindInterface(struct raw_pcb *aRaw, InterfaceId intfId)
|
|
LwIPBindInterface(struct udp_pcb *aUDP, InterfaceId intfId)
|
|
NetmaskToPrefixLength(const uint8_t *netmask, uint16_t netmaskLen)
|
uint8_t
Compute a prefix length from a variable-length netmask.
|
ParseHostAndPort(const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort)
|
Parse a human-readable string containing a host or IP address and an optional port number (separated by a ':'), supporting the following formats:
|
ParseHostPortAndInterface(const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen)
|
Parse a human-readable string containing a host or IP address, an optional port number (separated by a ':'), and an optional interface name (separated by a ''), supporting the following formats:
|
RegisterInetLayerErrorFormatter(void)
|
void
Register a text error formatter for Inet Layer errors.
|
SocketsIPv4JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand)
|
|
SocketsIPv6JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand)
|
|
SocketsSetMulticastLoopback(int aSocket, bool aLoopback, int aProtocol, int aOption)
|
|
SocketsSetMulticastLoopback(int aSocket, IPVersion aIPVersion, bool aLoopback)
|
Classes |
|
---|---|
nl:: |
This is an internal class to InetLayer that provides helper APIs for Asynchronous Domain Name System (DNS) resolution in InetLayer. |
nl:: |
This is an internal class to InetLayer that provides the abstraction of Domain Name System (DNS) resolution in InetLayer. |
nl:: |
Basis of internet transport endpoint classes. |
nl:: |
Internet protocol address. |
nl:: |
Objects of this class represent non-instantiable IP protocol endpoints. |
nl:: |
Information about an incoming/outgoing message/connection. |
nl:: |
Internet protocol address prefix. |
nl:: |
This provides access to Internet services, including timers, Domain Name System (DNS) resolution, TCP network transport, UDP network transport, and raw network transport, for a single thread. |
nl:: |
This is the basis class of reference-counted objects managed by an InetLayer object. |
nl:: |
Iterator for the list of system network interface IP addresses. |
nl:: |
Iterator for the list of system network interfaces. |
nl:: |
Objects of this class represent raw IP network endpoints. |
nl:: |
Represent a set of I/O events requested/pending on a socket. |
nl:: |
Objects of this class represent TCP transport endpoints. |
nl:: |
Objects of this class represent tunnel interfaces. |
nl:: |
Objects of this class represent UDP transport endpoints. |
Unions |
|
---|---|
nl:: |
Namespaces |
|
---|---|
nl:: |
Enumerations
@7
@7
The Inet layer event type definitions.
Properties | |
---|---|
kInetEvent_DNSResolveComplete
|
The event for DNS name resolution completion. |
kInetEvent_RawDataReceived
|
The event for data reception over an InetLayer raw endpoint. |
kInetEvent_TCPConnectComplete
|
The event for TCP connection completion. |
kInetEvent_TCPConnectionReceived
|
The event for TCP connection reception. |
kInetEvent_TCPDataReceived
|
The event for data reception over a TCP connection. |
kInetEvent_TCPDataSent
|
The event for data transmission over a TCP connection. |
kInetEvent_TCPError
|
The event for an error on a TCP connection. |
kInetEvent_TunDataReceived
|
The event for data reception over a Weave tunnel. |
kInetEvent_UDPDataReceived
|
The event for data reception over UDP. |
DNSOptions
DNSOptions
Options controlling how IP address resolution is performed.
IPAddressType
IPAddressType
Internet protocol address family.
Values of the IPAddressType
type are returned by the IPAddress::Type()
method. They indicate the address family entailed by the use of the address.
IPProtocol
IPProtocol
IPV6MulticastGroup
IPV6MulticastGroup
Internet protocol multicast group identifiers.
Values of the IPV6MulticastGroup
type are used to call the IPAddress::MakeIPv6Multicast()
method. They indicate distinguished group identifiers registered by IETF with IANA.
Properties | |
---|---|
kIPV6MulticastGroup_AllRouters
|
RFC 4291. |
IPVersion
IPVersion
IPv6MulticastFlag
IPv6MulticastFlag
Internet protocol v6 multicast flags.
Values of the IPv6MulticastFlag
type are used to call the IPAddress::MakeIPv6Multicast()
methods. They indicate the type of IPv6 multicast address to create. These numbers are registered by IETF with IANA.
IPv6MulticastScope
IPv6MulticastScope
Internet protocol multicast address scope.
Values of the IPv6MulticastScope
type are used to call the IPAddress::MakeIPv6Multicast()
method. They indicate the routable scope of the multicast group designated by the result. These numbers are registered by IETF with IANA.
Typedefs
InterfaceId
struct netif * InterfaceId
Indicator for system network interfaces.
Portability depends on never witnessing this alias. It may be replaced by a concrete opaque class in the future.
Note Well: The term "interface identifier" also conventionally refers to the lower 64 bits of an IPv6 address in all the relevant IETF standards documents, where the abbreviation "IID" is often used. In this text, the term "interface indicator" refers to values of this type alias.
Variables
sIOCTLSocket
int sIOCTLSocket = -1
Functions
CheckMulticastGroupArgs
INET_ERROR CheckMulticastGroupArgs( InterfaceId aInterfaceId, const IPAddress & aAddress )
CloseIOCTLSocket
void CloseIOCTLSocket( void )
Close the global socket created by GetIOCTLSocket
.
This function is provided for cases were leaving the global IOCTL socket open would register as a leak.
NB: This function is NOT thread-safe with respect to GetIOCTLSocket
.
FormatInetLayerError
bool FormatInetLayerError( char *buf, uint16_t bufSize, int32_t err )
Given an Inet Layer error, returns a human-readable NULL-terminated C string describing the error.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
true If a description string was written into the supplied buffer.
|
||||||
Returns |
false If the supplied error was not an Inet Layer error.
|
GetIOCTLSocket
int GetIOCTLSocket( void )
Returns a global general purpose socket useful for invoking certain network IOCTLs.
This function is thread-safe on all platforms.
GetInterfaceName
NL_DLL_EXPORT INET_ERROR GetInterfaceName( InterfaceId intfId, char *nameBuf, size_t nameBufSize )
Get the name of a network interface.
Writes the name of the network interface as \c NUL terminated text string at \c nameBuf. The name of the unspecified network interface is the empty string.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
INET_IsInetEvent
bool INET_IsInetEvent( Weave::System::EventType aType )
Check to verify if a System::EventType is a valid Inet layer event type.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if it falls within the enumerated range; otherwise, false.
|
InterfaceNameToId
NL_DLL_EXPORT INET_ERROR InterfaceNameToId( const char *intfName, InterfaceId & intfId )
Search the list of network interfaces for the indicated name.
On LwIP, this function must be called with the LwIP stack lock acquired. The \c intfId parameter is not updated unless the value returned is \c INET_NO_ERROR. It should be initialized with \c INET_NULL_INTERFACEID before calling this function.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
LwIPBindInterface
INET_ERROR LwIPBindInterface( struct raw_pcb *aRaw, InterfaceId intfId )
LwIPBindInterface
INET_ERROR LwIPBindInterface( struct udp_pcb *aUDP, InterfaceId intfId )
NetmaskToPrefixLength
uint8_t NetmaskToPrefixLength( const uint8_t *netmask, uint16_t netmaskLen )
Compute a prefix length from a variable-length netmask.
ParseHostAndPort
INET_ERROR ParseHostAndPort( const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort )
Parse a human-readable string containing a host or IP address and an optional port number (separated by a ':'), supporting the following formats:
: : - [
]:
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Returns |
INET_ERROR_INVALID_HOST_NAME If the input to be parsed is of zero-length or otherwise malformed.
|
||||||||||
Returns |
INET_ERROR_HOST_NAME_TOO_LONG If the host name exceeds 253 characters.
|
||||||||||
Returns |
INET_NO_ERROR On success.
|
ParseHostPortAndInterface
INET_ERROR ParseHostPortAndInterface( const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen )
Parse a human-readable string containing a host or IP address, an optional port number (separated by a ':'), and an optional interface name (separated by a ''), supporting the following formats:
% : : % % : : % % - [
]: - [
]: %
Details | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||
Returns |
INET_ERROR_INVALID_HOST_NAME If the input to be parsed is of zero-length or otherwise malformed.
|
||||||||||||||
Returns |
INET_ERROR_HOST_NAME_TOO_LONG If the host name exceeds 253 characters.
|
||||||||||||||
Returns |
INET_NO_ERROR On success.
|
RegisterInetLayerErrorFormatter
void RegisterInetLayerErrorFormatter( void )
Register a text error formatter for Inet Layer errors.
SocketsIPv4JoinLeaveMulticastGroup
INET_ERROR SocketsIPv4JoinLeaveMulticastGroup( int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand )
SocketsIPv6JoinLeaveMulticastGroup
INET_ERROR SocketsIPv6JoinLeaveMulticastGroup( int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand )
SocketsSetMulticastLoopback
INET_ERROR SocketsSetMulticastLoopback( int aSocket, bool aLoopback, int aProtocol, int aOption )
SocketsSetMulticastLoopback
INET_ERROR SocketsSetMulticastLoopback( int aSocket, IPVersion aIPVersion, bool aLoopback )