NL::互聯網
概括
類型定義 | |
---|---|
InterfaceId | 類型定義struct netif * 系統網絡接口的指示器。 |
變量 | |
---|---|
sIOCTLSocket = -1 | int |
職能 | |
---|---|
CheckMulticastGroupArgs (InterfaceId aInterfaceId, const IPAddress & aAddress) | |
CloseIOCTLSocket (void) | void 附近創建了全球插座 GetIOCTLSocket 。 |
FormatInetLayerError (char *buf, uint16_t bufSize, int32_t err) | bool 給定 Inet 層錯誤,返回一個人類可讀的以 NULL 結尾的 C 字符串來描述錯誤。 |
GetIOCTLSocket (void) | int 返回用於調用某些網絡 IOCTL 的全局通用套接字。 |
GetInterfaceName (InterfaceId intfId, char *nameBuf, size_t nameBufSize) | NL_DLL_EXPORT INET_ERROR 獲取網絡接口的名稱。 |
INET_IsInetEvent (Weave::System::EventType aType) | bool 檢查以驗證 System::EventType 是否為有效的 Inet 層事件類型。 |
InterfaceNameToId (const char *intfName, InterfaceId & intfId) | NL_DLL_EXPORT INET_ERROR 在網絡接口列表中搜索指定名稱。 |
LwIPBindInterface (struct raw_pcb *aRaw, InterfaceId intfId) | |
LwIPBindInterface (struct udp_pcb *aUDP, InterfaceId intfId) | |
NetmaskToPrefixLength (const uint8_t *netmask, uint16_t netmaskLen) | uint8_t 從可變長度的網絡掩碼計算前綴長度。 |
ParseHostAndPort (const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort) | 解析包含主機或 IP 地址和可選端口號(以“:”分隔)的人類可讀字符串,支持以下格式: |
ParseHostPortAndInterface (const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen) | 解析包含主機或 IP 地址、可選端口號(以 ':' 分隔)和可選接口名稱(以 '' 分隔)的可讀字符串,支持以下格式: |
RegisterInetLayerErrorFormatter (void) | void 為 Inet 層錯誤註冊文本錯誤格式化程序。 |
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) |
班級 | |
---|---|
NL :: Inet電子:: AsyncDNSResolverSockets | |
NL :: Inet電子::使用DNSResolver | |
NL :: Inet電子:: EndPointBasis | 互聯網傳輸端點類的基礎。 |
NL :: Inet電子:: ip地址 | 互聯網協議地址。 |
NL :: Inet電子:: IPEndPointBasis | 此類的對象表示不可實例化的 IP 協議端點。 |
NL :: Inet電子:: IPPacketInfo | 有關傳入/傳出消息/連接的信息。 |
NL :: Inet電子:: IPPrefix | Internet 協議地址前綴。 |
NL :: Inet電子:: InetLayer | 這為單個線程提供了對 Internet 服務的訪問,包括計時器、域名系統 (DNS) 解析、TCP 網絡傳輸、UDP 網絡傳輸和原始網絡傳輸。 |
NL :: Inet電子:: InetLayerBasis | 這是基礎類由一個管理引用計數對象InetLayer對象。 |
NL :: Inet電子:: InterfaceAddressIterator | 系統網絡接口 IP 地址列表的迭代器。 |
NL :: Inet電子:: InterfaceIterator | 系統網絡接口列表的迭代器。 |
NL :: Inet電子:: RawEndPoint | 此類的對象表示原始 IP 網絡端點。 |
NL :: Inet電子:: SocketEvents | 表示套接字上請求/掛起的一組 I/O 事件。 |
NL :: Inet電子:: TCPEndPoint | 此類的對象表示 TCP 傳輸端點。 |
NL :: Inet電子:: TunEndPoint | 此類的對象表示隧道接口。 |
NL :: Inet電子:: UDPEndPoint | 此類的對象表示 UDP 傳輸端點。 |
工會 | |
---|---|
NL :: Inet電子:: PeerSockAddr |
命名空間 | |
---|---|
NL :: Inet電子::平台 |
枚舉
@7
@7
Inet 層事件類型定義。
特性 | |
---|---|
kInetEvent_DNSResolveComplete | DNS 名稱解析完成事件。 |
kInetEvent_RawDataReceived | 通過一個用於數據接收的情況下InetLayer原始端點。 |
kInetEvent_TCPConnectComplete | TCP 連接完成事件。 |
kInetEvent_TCPConnectionReceived | TCP 連接接收事件。 |
kInetEvent_TCPDataReceived | 通過 TCP 連接接收數據的事件。 |
kInetEvent_TCPDataSent | 通過 TCP 連接進行數據傳輸的事件。 |
kInetEvent_TCPError | TCP 連接上的錯誤事件。 |
kInetEvent_TunDataReceived | 通過 Weave 隧道接收數據的事件。 |
kInetEvent_UDPDataReceived | 通過 UDP 接收數據的事件。 |
DNS選項
DNSOptions
控制如何執行 IP 地址解析的選項。
IP地址類型
IPAddressType
Internet 協議地址族。
該值IPAddressType
類型被返回的IPAddress::Type()
方法。它們指示使用地址所需要的地址族。
特性 | |
---|---|
kIPAddressType_Any | 未指定的互聯網地址(獨立於協議版本) |
kIPAddressType_IPv4 | 互聯網協議版本 4。 |
kIPAddressType_IPv6 | 互聯網協議版本 6. |
kIPAddressType_Unknown | 不曾用過。 |
IPV6組播組
IPV6MulticastGroup
Internet 協議多播組標識符。
所述的值IPV6MulticastGroup
類型被用來調用IPAddress::MakeIPv6Multicast()
方法。它們表示 IETF 向 IANA 註冊的可分辨組標識符。
特性 | |
---|---|
kIPV6MulticastGroup_AllRouters | RFC 4291。 |
IPv6多播標誌
IPv6MulticastFlag
Internet 協議 v6 多播標誌。
所述的值IPv6MulticastFlag
類型被用來調用IPAddress::MakeIPv6Multicast()
方法。它們指示要創建的 IPv6 多播地址的類型。這些號碼由 IETF 向 IANA 註冊。
特性 | |
---|---|
kIPv6MulticastFlag_Prefix | 多播地址是 (1) 基於網絡前綴。 |
kIPv6MulticastFlag_Transient | 多播地址是 (1) 臨時的(即動態分配的)而不是 (0) 眾所周知的(即 IANA 分配的)。 |
IPv6多播範圍
IPv6MulticastScope
Internet 協議多播地址範圍。
所述的值IPv6MulticastScope
類型被用來調用IPAddress::MakeIPv6Multicast()
方法。它們指示結果指定的多播組的可路由范圍。這些號碼由 IETF 向 IANA 註冊。
類型定義
接口標識
struct netif * InterfaceId
系統網絡接口的指示器。
可移植性取決於永遠不會看到這個別名。將來它可能會被具體的不透明類取代。
注意:術語“接口標識符”通常也指所有相關 IETF 標准文檔中 IPv6 地址的低 64 位,其中經常使用縮寫“IID”。在本文中,術語“接口指示器”指的是這種類型別名的值。
變量
sIOCTLSocket
int sIOCTLSocket = -1
職能
檢查多播組參數
INET_ERROR CheckMulticastGroupArgs( InterfaceId aInterfaceId, const IPAddress & aAddress )
關閉IOCTLSocket
void CloseIOCTLSocket( void )
附近創建了全球插座GetIOCTLSocket
。
此函數是為在將全局 IOCTL 套接字打開並將註冊為洩漏的情況下提供的。
注:此功能是不是線程安全的,相對於GetIOCTLSocket
。
格式Inet層錯誤
bool FormatInetLayerError( char *buf, uint16_t bufSize, int32_t err )
給定 Inet 層錯誤,返回一個人類可讀的以 NULL 結尾的 C 字符串來描述錯誤。
細節 | |||||||
---|---|---|---|---|---|---|---|
參數 |
| ||||||
退貨 | true 如果描述字符串已寫入提供的緩衝區。 | ||||||
退貨 | false 如果提供的錯誤不是 Inet 層錯誤。 |
獲取IOCTLSocket
int GetIOCTLSocket( void )
返回用於調用某些網絡 IOCTL 的全局通用套接字。
此函數在所有平台上都是線程安全的。
獲取接口名稱
NL_DLL_EXPORT INET_ERROR GetInterfaceName( InterfaceId intfId, char *nameBuf, size_t nameBufSize )
獲取網絡接口的名稱。
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.
細節 | |||||||
---|---|---|---|---|---|---|---|
參數 |
| ||||||
返回值 |
|
INET_IsInetEvent
bool INET_IsInetEvent( Weave::System::EventType aType )
檢查以驗證 System::EventType 是否為有效的 Inet 層事件類型。
細節 | |||
---|---|---|---|
參數 |
| ||
退貨 | 如果它落在枚舉範圍內,則為真;否則為假。 |
接口名稱ToId
NL_DLL_EXPORT INET_ERROR InterfaceNameToId( const char *intfName, InterfaceId & intfId )
在網絡接口列表中搜索指定名稱。
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.
細節 | |||||||
---|---|---|---|---|---|---|---|
參數 |
| ||||||
返回值 |
|
LwIP綁定接口
INET_ERROR LwIPBindInterface( struct raw_pcb *aRaw, InterfaceId intfId )
LwIP綁定接口
INET_ERROR LwIPBindInterface( struct udp_pcb *aUDP, InterfaceId intfId )
網絡掩碼到前綴長度
uint8_t NetmaskToPrefixLength( const uint8_t *netmask, uint16_t netmaskLen )
從可變長度的網絡掩碼計算前綴長度。
解析主機和端口
INET_ERROR ParseHostAndPort( const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort )
解析包含主機或 IP 地址和可選端口號(以“:”分隔)的人類可讀字符串,支持以下格式:
: : - [
]:
細節 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
| ||||||||||
退貨 | INET_ERROR_INVALID_HOST_NAME如果要被解析的輸入是零長度的或不正常的的。 | ||||||||||
退貨 | INET_ERROR_HOST_NAME_TOO_LONG如果主機名超過253個字符。 | ||||||||||
退貨 | INET_NO_ERROR上的成功。 |
解析主機端口和接口
INET_ERROR ParseHostPortAndInterface( const char *aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen )
解析包含主機或 IP 地址、可選端口號(以 ':' 分隔)和可選接口名稱(以 '' 分隔)的可讀字符串,支持以下格式:
% : : % % : : % % - [
]: - [
]: %
細節 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
| ||||||||||||||
退貨 | INET_ERROR_INVALID_HOST_NAME如果要被解析的輸入是零長度的或不正常的的。 | ||||||||||||||
退貨 | INET_ERROR_HOST_NAME_TOO_LONG如果主機名超過253個字符。 | ||||||||||||||
退貨 | INET_NO_ERROR上的成功。 |
註冊InetLayerErrorFormatter
void RegisterInetLayerErrorFormatter( void )
為 Inet 層錯誤註冊文本錯誤格式化程序。
套接字IPv4JoinLeaveMulticastGroup
INET_ERROR SocketsIPv4JoinLeaveMulticastGroup( int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand )
套接字IPv6JoinLeaveMulticastGroup
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 )