nl:: Inet:: RawEndPoint
#include <src/inet/RawEndPoint.h>
這個類別的物件代表原始 IP 網路端點。
摘要
Nest Inet Layer 會封裝與 IP 網路端點 (Linux 和 BSD 衍生系統上的 SOCK_RAW 通訊端) 或 LwIP 原始通訊協定控制模塊互動的方法,因為系統會視情況進行設定。
繼承
沿用來源: nl::Inet::IPEndPointBasis
公開屬性 |
|
---|---|
IPProto
|
IPProtocol
網際網路控制訊息通訊協定 (ICMP) 的版本
|
IPVer
|
IPVersion
網際網路通訊協定的版本。
|
公用函式 |
|
---|---|
Bind(IPAddressType addrType, IPAddress addr, InterfaceId intfId)
|
將端點繫結至介面 IP 位址。
|
BindIPv6LinkLocal(InterfaceId intf, IPAddress addr)
|
將原始端點繫結至指定介面索引的 IPv6 連結本機範圍位址。
|
BindInterface(IPAddressType addrType, InterfaceId intf)
|
將端點繫結至網路介面。
|
Close(void)
|
void
關閉端點。
|
Free(void)
|
void
關閉端點並回收其記憶體。
|
GetBoundInterface(void)
|
InterfaceId
取得這個端點的繫結介面。
|
Listen(void)
|
準備端點以接收 ICMP 訊息。
|
SendMsg(const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
將 ICMP 訊息傳送至指定目的地。
|
SendTo(IPAddress addr, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
SendTo(addr, INET_NULL_INTERFACEID, msg, sendFlags) 的同義詞。 |
SendTo(IPAddress addr, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
將 ICMP 訊息傳送至指定的目的地地址。
|
SetICMPFilter(uint8_t numICMPTypes, const uint8_t *aICMPTypes)
|
在網路堆疊中設定 ICMP6 篩選器參數。
|
公開屬性
IPProto
IPProtocol IPProto
網際網路控制訊息通訊協定 (ICMP) 的版本
雖然這個欄位是可變動的類別變數,但是類別不變的變數,因此並未修改。
IPVer
IPVersion IPVer
網際網路通訊協定的版本。
雖然這個欄位是可變動的類別變數,但是類別不變的變數,因此並未修改。
公用函式
繫結
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, InterfaceId intfId )
將端點繫結至介面 IP 位址。
將端點繫結至指定的網路介面 IP 位址。
詳細說明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||
傳回值 |
|
在 LwIP 上,如果已經取得 LwIP 堆疊鎖定,就不得呼叫此方法。
BindIPv6LinkLocal
INET_ERROR BindIPv6LinkLocal( InterfaceId intf, IPAddress addr )
將原始端點繫結至指定介面索引的 IPv6 連結本機範圍位址。
此外,還要設定各種適用的 IPv6 通訊端選項,以便將封包傳入及傳出連結目的地。
在 intf
指定的網路介面上,將端點繫結至 IPv6 連結本機位址 addr
。
詳細說明 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
參數 |
|
||||||||||||
傳回值 |
|
||||||||||||
傳回 |
失敗時出現 INET_NO_ERROR,或對應失敗時對應的 OS 錯誤。參數清單無效可能會導致 INET_ERROR_WRONG_ADDRESS_TYPE。如果原始端點已繫結或正在監聽,則會傳回 INET_ERROR_INCORRECT_STATE。將端點繫結至介面 IPv6 連結本機位址。
|
在 LwIP 上,如果已經取得 LwIP 堆疊鎖定,就不得呼叫此方法。
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
將端點繫結至網路介面。
將端點繫結至指定的網路介面 IP 位址。
詳細說明 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|
在 LwIP 上,如果已經取得 LwIP 堆疊鎖定,就不得呼叫此方法。
關閉
void Close( void )
關閉端點。
如果設為 mState != kState_Closed
,則會關閉端點,並從符合通訊事件資格的端點組合中移除端點。
在 LwIP 系統中,如果已取得 LwIP 堆疊鎖定,就不能呼叫此方法。
免費
void Free( void )
關閉端點並回收其記憶體。
叫用 Close
方法,然後叫用 InetLayerBasis::Release
方法,將物件傳回其記憶體集區。
在 LwIP 系統中,如果已取得 LwIP 堆疊鎖定,就不能呼叫此方法。
GetBoundInterface
InterfaceId GetBoundInterface( void )
取得這個端點的繫結介面。
詳細說明 | |
---|---|
傳回 |
InterfaceId 繫結介面 ID。
|
聆聽
INET_ERROR Listen( void )
準備端點以接收 ICMP 訊息。
如果 mState
已經為 kState_Listening
,則系統不會執行任何作業,否則將 mState
設為 kState_Listening
,且根據平台的語意,將準備好接收 ICMPv6 訊息。
詳細說明 | |||
---|---|---|---|
傳回值 |
|
在 LwIP 上,如果已取得 LwIP 堆疊鎖定,就不得呼叫此方法
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
將 ICMP 訊息傳送至指定目的地。
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.
詳細說明 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
SendTo
INET_ERROR SendTo( IPAddress addr, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
SendTo(addr, INET_NULL_INTERFACEID, msg, sendFlags)
的同義詞。
SendTo
INET_ERROR SendTo( IPAddress addr, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
將 ICMP 訊息傳送至指定的目的地地址。
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.
詳細說明 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
SetICMPFilter
INET_ERROR SetICMPFilter( uint8_t numICMPTypes, const uint8_t *aICMPTypes )
在網路堆疊中設定 ICMP6 篩選器參數。
將 aICMPTypes
中程式碼的 ICMPv6 篩選參數套用至系統網路堆疊中的基礎端點。
詳細說明 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|