nl::Inet

Summary

Enumerations

@5{
  kInetEvent_TCPConnectComplete = _INET_CONFIG_EVENT(0),
  kInetEvent_TCPConnectionReceived = _INET_CONFIG_EVENT(1),
  kInetEvent_TCPDataReceived = _INET_CONFIG_EVENT(2),
  kInetEvent_TCPDataSent = _INET_CONFIG_EVENT(3),
  kInetEvent_TCPError = _INET_CONFIG_EVENT(4),
  kInetEvent_UDPDataReceived = _INET_CONFIG_EVENT(5),
  kInetEvent_DNSResolveComplete = _INET_CONFIG_EVENT(6),
  kInetEvent_TunDataReceived = _INET_CONFIG_EVENT(7),
  kInetEvent_RawDataReceived = _INET_CONFIG_EVENT(8)
}
enum
The Inet layer event type definitions.
IPAddressType{
  kIPAddressType_Unknown = 0,
  kIPAddressType_IPv4 = 1,
  kIPAddressType_IPv6 = 2,
  kIPAddressType_Any = 3
}
enum
Internet protocol address family.
IPProtocol{
  kIPProtocol_ICMPv6 = 58,
  kIPProtocol_ICMPv4 = 1
}
enum
The numbers of some of the protocols in the IP family.
IPV6MulticastGroup{
  kIPV6MulticastGroup_AllRouters = 2
}
enum
Internet protocol multicast group identifiers.
IPVersion{
  kIPVersion_6 = 6,
  kIPVersion_4 = 4
}
enum
The version of the IP protocol being used.
IPv6MulticastScope{
  kIPv6MulticastScope_Interface = 1,
  kIPv6MulticastScope_Link = 2,
  kIPv6MulticastScope_IPv4 = 3,
  kIPv6MulticastScope_Admin = 4,
  kIPv6MulticastScope_Site = 5,
  kIPv6MulticastScope_Organization = 8,
  kIPv6MulticastScope_Global = 14
}
enum
Internet protocol multicast address scope.

Typedefs

InterfaceId nl::Inet::InterfaceId
struct netif *
Indicator for system network interfaces.

Functions

GetInterfaceName(InterfaceId intfId, char *nameBuf, size_t nameBufSize)
NL_DLL_EXPORT INET_ERROR
Write the name of the network interface to a memory buffer.
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.
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:

Classes

nl::Inet::DNSResolver

This is an internal class to InetLayer that provides the abstraction of Domain Name System (DNS) resolution in InetLayer.

nl::Inet::EndPointBasis

Basis of internet transport endpoint classes.

nl::Inet::IPAddress

Internet protocol address.

nl::Inet::IPPacketInfo

Information about an incoming/outgoing message/connection.

nl::Inet::IPPrefix

Internet protocol address prefix.

nl::Inet::InetLayer

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::Inet::InetLayerBasis

This is the basis class of reference-counted objects managed by an InetLayer object.

nl::Inet::InterfaceAddressIterator

Iterator for the list of system network interface IP addresses.

nl::Inet::InterfaceIterator

Iterator for the list of system network interfaces.

nl::Inet::RawEndPoint

Objects of this class represent raw IP protocol endpoints.

nl::Inet::SenderInfo
nl::Inet::SocketEvents

Represent a set of I/O events requested/pending on a socket.

nl::Inet::TCPEndPoint

Objects of this class represent TCP transport endpoints.

nl::Inet::TunEndPoint

Objects of this class represent tunnel interfaces.

nl::Inet::UDPEndPoint

Objects of this class represent UDP transport endpoints.

Namespaces

nl::Inet::Platform

Enumerations

@5

 @5

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.

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.

Properties
kIPAddressType_Any

The unspecified internet address (independent of protocol version)

kIPAddressType_IPv4

Internet protocol version 4.

kIPAddressType_IPv6

Internet protocol version 6.

kIPAddressType_Unknown

Not used.

IPProtocol

 IPProtocol

The numbers of some of the protocols in the IP family.

Properties
kIPProtocol_ICMPv4

ICMPv4.

kIPProtocol_ICMPv6

ICMPv6.

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

The version of the IP protocol being used.

Properties
kIPVersion_4

IPv4.

kIPVersion_6

IPv6.

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.

Properties
kIPv6MulticastScope_Admin

Realm-local scope.

kIPv6MulticastScope_Global

Global scope.

kIPv6MulticastScope_IPv4

Realm-local ("IPv4") scope.

kIPv6MulticastScope_Interface

Interface-local scope.

kIPv6MulticastScope_Link

Link-local scope.

kIPv6MulticastScope_Organization

Organization-local scope.

kIPv6MulticastScope_Site

Realm-local scope.

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.

Functions

GetInterfaceName

NL_DLL_EXPORT INET_ERROR GetInterfaceName(
  InterfaceId intfId,
  char *nameBuf,
  size_t nameBufSize
)

Write the name of the network interface to a memory buffer.

Writes the name of the network interface as NUL terminated text string at nameBuf. The name of the unspecified network interface is the empty string.

Details
Parameters
[in] intfId
a network interface
[out] nameBuf
region of memory to write the interface name
[in] nameBufSize
size of the region denoted by nameBuf
Return Values
INET_NO_ERROR
successful result, interface name written
INET_ERROR_NO_MEMORY
name is too large to be written in buffer
other
another system or platform error

The memory at nameBuf may be overwritten with nonsense even when the returned value is not INET_NO_ERROR.

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
[in] aType
A Weave System Layer event type.
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.

Details
Parameters
[in] intfName
name of the network interface to find
[out] intfId
indicator of the network interface to assign
Return Values
INET_NO_ERROR
success, network interface indicated
INET_ERROR_UNKNOWN_INTERFACE
no network interface found
other
another system or platform error

The intfId parameter is not updated unless the value returned is INET_NO_ERROR. It should be initialized with INET_NULL_INTERFACEID before calling this function.

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
[in] aString
The human-reable string to parse.
[in] aStringLen
The length, in characters, of aString.
[out] aHost
A pointer to the host name portion of the parsed string.
[out] aHostLen
The length, in characters, of aHost.
[out] aPort
The port number, if present and successfully parsed; otherwise, 0.
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
[in] aString
The human-reable string to parse.
[in] aStringLen
The length, in characters, of aString.
[out] aHost
A pointer to the host name portion of the parsed string.
[out] aHostLen
The length, in characters, of aHost.
[out] aPort
The port number, if present and successfully parsed; otherwise, 0.
[out] aInterface
A pointer to the interface portion of the parsed string.
[out] aInterfaceLen
The length, in characters, of aInterface.
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.