IPv6
這個模組包含控管 IPv6 通訊的功能。
摘要
列舉 |
|
---|---|
anonymous enum{
|
列舉 IPv6 位址來源。 |
anonymous enum{
|
列舉 ECN 狀態,以 IP 標頭表示。 |
anonymous enum{
|
列舉 網際網路通訊協定號碼。 |
Typedefs |
|
---|---|
otBorderRoutingCounters
|
typedefstruct otBorderRoutingCounters
這個結構代表透過邊界轉送轉送的封包計數器。 |
otIp6Address
|
typedefstruct otIp6Address
這個結構代表 IPv6 位址。 |
otIp6AddressCallback)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
|
typedefvoid(*
當新增或移除內部 IPv6 位址時,系統會呼叫這個函式指標。 |
otIp6AddressComponents
|
typedefstruct otIp6AddressComponents
這個結構代表 IPv6 位址的元件。 |
otIp6AddressInfo
|
typedefstruct otIp6AddressInfo
|
otIp6InterfaceIdentifier
|
typedefstruct otIp6InterfaceIdentifier
這個結構代表 IPv6 位址的介面 ID。 |
otIp6NetworkPrefix
|
typedefstruct otIp6NetworkPrefix
這個結構代表 IPv6 位址的網路前置字元 (位址中最主要的 64 位元)。 |
otIp6Prefix
|
typedefstruct otIp6Prefix
這個結構代表 IPv6 前置字元。 |
otIp6ReceiveCallback)(otMessage *aMessage, void *aContext)
|
typedefvoid(*
收到 IPv6 資料圖表時,會呼叫此函式指標。 |
otIp6RegisterMulticastListenersCallback)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
|
typedefvoid(*
系統會使用 otIp6RegisterMulticastListeners 的結果呼叫這個函式指標。 |
otIp6SlaacPrefixFilter)(otInstance *aInstance, const otIp6Prefix *aPrefix)
|
typedefbool(*
這個函式指標可讓使用者篩選前置字串,並不允許根據前置字串新增 SLAAC 位址。 |
otMessageInfo
|
typedefstruct otMessageInfo
這個結構代表本機和對等 IPv6 通訊端位址。 |
otNetifAddress
|
typedefstruct otNetifAddress
這個結構代表 IPv6 網路介面的單點位址。 |
otNetifMulticastAddress
|
typedefstruct otNetifMulticastAddress
這個結構代表 IPv6 網路介面的多播位址。 |
otPacketsAndBytes
|
typedefstruct otPacketsAndBytes
這個結構代表封包和位元組的計數器。 |
otSockAddr
|
typedefstruct otSockAddr
這個結構代表 IPv6 通訊端位址。 |
變數 |
|
---|---|
OT_TOOL_PACKED_END
|
Functions |
|
---|---|
otIp6AddUnicastAddress(otInstance *aInstance, const otNetifAddress *aAddress)
|
為 Thread 介面新增網路介面位址。
|
otIp6AddUnsecurePort(otInstance *aInstance, uint16_t aPort)
|
這個函式會將通訊埠新增至允許的未加密通訊埠清單。
|
otIp6AddressFromString(const char *aString, otIp6Address *aAddress)
|
這個函式會將使用者可理解的 IPv6 位址字串轉換為二進位表示法。
|
otIp6AddressToString(const otIp6Address *aAddress, char *aBuffer, uint16_t aSize)
|
void
這個函式會將特定 IPv6 位址轉換為使用者可理解的字串。
|
otIp6ArePrefixesEqual(const otIp6Prefix *aFirst, const otIp6Prefix *aSecond)
|
bool
測試兩個 IPv6 前置字串是否相同。
|
otIp6GetBorderRoutingCounters(otInstance *aInstance)
|
const otBorderRoutingCounters *
取得邊界轉送計數器。
|
otIp6GetMulticastAddresses(otInstance *aInstance)
|
const otNetifMulticastAddress *
取得訂閱 Thread 介面的 IPv6 多播位址清單。
|
otIp6GetPrefix(const otIp6Address *aAddress, uint8_t aLength, otIp6Prefix *aPrefix)
|
void
這種方法會從
aAddress 取得含有 aLength 的前置字串。 |
otIp6GetUnicastAddresses(otInstance *aInstance)
|
const otNetifAddress *
取得指派給執行緒介面的 IPv6 位址清單。
|
otIp6GetUnsecurePorts(otInstance *aInstance, uint8_t *aNumEntries)
|
const uint16_t *
這個函式會傳回指向不安全的通訊埠清單的指標。
|
otIp6IsAddressEqual(const otIp6Address *aFirst, const otIp6Address *aSecond)
|
bool
測試兩個 IPv6 位址是否相同。
|
otIp6IsAddressUnspecified(const otIp6Address *aAddress)
|
bool
這個函式會指出指定的 IPv6 位址是否為未指定位址。
|
otIp6IsEnabled(otInstance *aInstance)
|
bool
指出 IPv6 介面是否已啟動。
|
otIp6IsMulticastPromiscuousEnabled(otInstance *aInstance)
|
bool
檢查執行緒執行緒中是否已啟用多播概略模式。
|
otIp6IsReceiveFilterEnabled(otInstance *aInstance)
|
bool
這個函式指出是否要透過 otIp6SetReceiveCallback() 指定的回呼,在提供 IPv6 資料圖表時篩除執行緒控制流量。
|
otIp6IsSlaacEnabled(otInstance *aInstance)
|
bool
這個函式會指出是否要啟用 SLAAC 模組。
|
otIp6NewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
分配新的訊息緩衝區來傳送 IPv6 訊息。
|
otIp6NewMessageFromBuffer(otInstance *aInstance, const uint8_t *aData, uint16_t aDataLength, const otMessageSettings *aSettings)
|
分配新的訊息緩衝區,並將 IPv6 資料圖表寫入訊息緩衝區,以便傳送 IPv6 訊息。
|
otIp6PrefixMatch(const otIp6Address *aFirst, const otIp6Address *aSecond)
|
uint8_t
這個函式會傳回兩個 IPv6 位址的前置字串比對長度 (位元)。
|
otIp6PrefixToString(const otIp6Prefix *aPrefix, char *aBuffer, uint16_t aSize)
|
void
這個函式會將特定 IPv6 前置字串轉換為使用者可理解的字串。
|
otIp6ProtoToString(uint8_t aIpProto)
|
const char *
這個函式會將特定 IP 通訊協定號碼轉換為使用者可理解的字串。
|
otIp6RegisterMulticastListeners(otInstance *aInstance, const otIp6Address *aAddresses, uint8_t aAddressNum, const uint32_t *aTimeout, otIp6RegisterMulticastListenersCallback aCallback, void *aContext)
|
這個函式會將多播監聽器註冊為主要中樞路由器。
|
otIp6RemoveAllUnsecurePorts(otInstance *aInstance)
|
void
這個函式會從允許的不安全通訊埠清單中移除所有通訊埠。
|
otIp6RemoveUnicastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
從 Thread 介面移除網路介面位址。
|
otIp6RemoveUnsecurePort(otInstance *aInstance, uint16_t aPort)
|
這個函式會從允許的不安全通訊埠清單中移除通訊埠。
|
otIp6ResetBorderRoutingCounters(otInstance *aInstance)
|
void
重設邊界轉送計數器。
|
otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageInfo)
|
這個函式會執行 OpenThread 來源位址選項。
|
otIp6Send(otInstance *aInstance, otMessage *aMessage)
|
這個函式會透過 Thread 介面傳送 IPv6 資料圖表。
|
otIp6SetAddressCallback(otInstance *aInstance, otIp6AddressCallback aCallback, void *aCallbackContext)
|
void
這個函式會註冊回呼,以通知內部 IPv6 位址變更。
|
otIp6SetEnabled(otInstance *aInstance, bool aEnabled)
|
將 IPv6 介面往上或下移。
|
otIp6SetMeshLocalIid(otInstance *aInstance, const otIp6InterfaceIdentifier *aIid)
|
這個函式會設定網格本機 IID (用於測試)。
|
otIp6SetMulticastPromiscuousEnabled(otInstance *aInstance, bool aEnabled)
|
void
在 Thread 介面中啟用或停用多播概略模式。
|
otIp6SetReceiveCallback(otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext)
|
void
這個函式會註冊回呼,以便提供已接收的 IPv6 資料圖表。
|
otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled)
|
void
這個函式在設定透過 otIp6SetReceiveCallback() 指定的回呼提供 IPv6 資料元時,系統會過濾掉執行緒控制流量。
|
otIp6SetSlaacEnabled(otInstance *aInstance, bool aEnabled)
|
void
這項功能可以啟用/停用 SLAAC 模組。
|
otIp6SetSlaacPrefixFilter(otInstance *aInstance, otIp6SlaacPrefixFilter aFilter)
|
void
這個函式會設定 SLAAC 模組篩選器處理常式。
|
otIp6SockAddrToString(const otSockAddr *aSockAddr, char *aBuffer, uint16_t aSize)
|
void
這個函式會將特定 IPv6 通訊端位址轉換為使用者可理解的字串。
|
otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
將執行緒介面訂閱為網路介面多播位址。
|
otIp6UnsubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
將執行緒介面取消訂閱為網路介面多播位址。
|
結構 |
|
---|---|
otBorderRoutingCounters |
這個結構代表透過邊界轉送轉送的封包計數器。 |
otIp6Address |
這個結構代表 IPv6 位址。 |
otIp6AddressComponents |
這個結構代表 IPv6 位址的元件。 |
otIp6AddressInfo |
這個結構代表 IPv6 位址資訊。 |
otIp6InterfaceIdentifier |
這個結構代表 IPv6 位址的介面 ID。 |
otIp6NetworkPrefix |
這個結構代表 IPv6 位址的網路前置字元 (位址中最主要的 64 位元)。 |
otIp6Prefix |
這個結構代表 IPv6 前置字元。 |
otMessageInfo |
這個結構代表本機和對等 IPv6 通訊端位址。 |
otNetifAddress |
這個結構代表 IPv6 網路介面的單點位址。 |
otNetifMulticastAddress |
這個結構代表 IPv6 網路介面的多播位址。 |
otPacketsAndBytes |
這個結構代表封包和位元組的計數器。 |
otSockAddr |
這個結構代表 IPv6 通訊端位址。 |
組合 |
|
---|---|
otIp6InterfaceIdentifier:: |
列舉
匿名列舉
anonymous enum
IPv6 位址來源。
屬性 | |
---|---|
OT_ADDRESS_ORIGIN_DHCPV6
|
DHCPv6 指派的地址。 |
OT_ADDRESS_ORIGIN_MANUAL
|
手動指派的地址。 |
OT_ADDRESS_ORIGIN_SLAAC
|
SLAAC 指派的地址。 |
OT_ADDRESS_ORIGIN_THREAD
|
執行緒指派的地址 (ALOC、RLOC、MLEID 等) |
匿名列舉
anonymous enum
ECN 狀態,以 IP 標頭表示。
屬性 | |
---|---|
OT_ECN_CAPABLE_0
|
心電圖(0) |
OT_ECN_CAPABLE_1
|
心電圖(1) |
OT_ECN_MARKED
|
壅塞 (CE) |
OT_ECN_NOT_CAPABLE
|
非強化轉換。 |
匿名列舉
anonymous enum
網際網路通訊協定號碼。
屬性 | |
---|---|
OT_IP6_PROTO_DST_OPTS
|
IPv6 的目的地選項。 |
OT_IP6_PROTO_FRAGMENT
|
IPv6 的片段標頭。 |
OT_IP6_PROTO_HOP_OPTS
|
IPv6 嘻哈選項。 |
OT_IP6_PROTO_ICMP6
|
IPv6 的 ICMP。 |
OT_IP6_PROTO_IP6
|
IPv6 封裝。 |
OT_IP6_PROTO_NONE
|
IPv6 沒有下一個標頭。 |
OT_IP6_PROTO_ROUTING
|
IPv6 的轉送標頭。 |
OT_IP6_PROTO_TCP
|
傳輸控制通訊協定 |
OT_IP6_PROTO_UDP
|
使用者資料圖表。 |
Typedefs
otIp6AddressCallback
void(* otIp6AddressCallback)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
當新增或移除內部 IPv6 位址時,系統會呼叫這個函式指標。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6AddressInfo
struct otIp6AddressInfo otIp6AddressInfo
otIp6InterfaceIdentifier
struct otIp6InterfaceIdentifier otIp6InterfaceIdentifier
這個結構代表 IPv6 位址的介面 ID。
otIp6NetworkPrefix
struct otIp6NetworkPrefix otIp6NetworkPrefix
這個結構代表 IPv6 位址的網路前置字元 (位址中最主要的 64 位元)。
otIp6ReceiveCallback
void(* otIp6ReceiveCallback)(otMessage *aMessage, void *aContext)
收到 IPv6 資料圖表時,會呼叫此函式指標。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
otIp6RegisterMulticastListenersCallback
void(* otIp6RegisterMulticastListenersCallback)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
系統會使用 otIp6RegisterMulticastListeners
的結果呼叫這個函式指標。
詳細說明 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
otIp6RegisterMulticastListeners
otIp6SlaacPrefixFilter
bool(* otIp6SlaacPrefixFilter)(otInstance *aInstance, const otIp6Prefix *aPrefix)
這個函式指標可讓使用者篩選前置字串,並不允許根據前置字串新增 SLAAC 位址。
otIp6SetSlaacPrefixFilter()
可用來設定篩選器處理常式。篩選處理常式即將根據前置字串新增 SLAAC 位址時,由 SLAAC 模組叫用篩選器處理常式。其布林傳回值會決定地址是否經過篩選 (未新增)。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otNetifMulticastAddress
struct otNetifMulticastAddress otNetifMulticastAddress
這個結構代表 IPv6 網路介面的多播位址。
變數
OT_TOOL_PACKED_END
OT_TOOL_PACKED_BEGIN struct otIp6InterfaceIdentifier OT_TOOL_PACKED_END
Functions
otIp6AddUnicastAddress
otError otIp6AddUnicastAddress( otInstance *aInstance, const otNetifAddress *aAddress )
為 Thread 介面新增網路介面位址。
傳入的執行個體 aAddress
已由 Thread 介面複製。「Thread」介面僅支援固定數量的外部外部單點通訊地址。詳情請參閱《OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS
》。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
OTIP6AddUnsecurePort
otError otIp6AddUnsecurePort( otInstance *aInstance, uint16_t aPort )
這個函式會將通訊埠新增至允許的未加密通訊埠清單。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otIp6AddressFromString
otError otIp6AddressFromString( const char *aString, otIp6Address *aAddress )
這個函式會將使用者可理解的 IPv6 位址字串轉換為二進位表示法。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6AddressToString
void otIp6AddressToString( const otIp6Address *aAddress, char *aBuffer, uint16_t aSize )
這個函式會將特定 IPv6 位址轉換為使用者可理解的字串。
IPv6 位址字串格式為 16 個十六進位值,並用「:」加以分隔 (例如「%x:%x:%x:...:%x」)。
如果產生的字串不適合在 aBuffer
中 (在其 aSize
字元內),系統會截斷字串,但輸出的字串一定是空值。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6ArePrefixesEqual
bool otIp6ArePrefixesEqual( const otIp6Prefix *aFirst, const otIp6Prefix *aSecond )
測試兩個 IPv6 前置字串是否相同。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6GetBorderRouting 計數器
const otBorderRoutingCounters * otIp6GetBorderRoutingCounters( otInstance *aInstance )
取得邊界轉送計數器。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE
,才能使用這個函式。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向邊界轉送計數器的指標。
|
otIp6GetMulticastAddress
const otNetifMulticastAddress * otIp6GetMulticastAddresses( otInstance *aInstance )
取得訂閱 Thread 介面的 IPv6 多播位址清單。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向第一個網路介面多播位址的指標。
|
otIp6GetPrefix
void otIp6GetPrefix( const otIp6Address *aAddress, uint8_t aLength, otIp6Prefix *aPrefix )
這種方法會從 aAddress
取得含有 aLength
的前置字串。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6GetUnicastAddress
const otNetifAddress * otIp6GetUnicastAddresses( otInstance *aInstance )
取得指派給執行緒介面的 IPv6 位址清單。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向第一個網路介面位址的指標。
|
otIp6GetUnsecurePorts
const uint16_t * otIp6GetUnsecurePorts( otInstance *aInstance, uint8_t *aNumEntries )
這個函式會傳回指向不安全的通訊埠清單的指標。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
指向不安全的通訊埠清單的指標。
|
otIp6IsAddressEqual
bool otIp6IsAddressEqual( const otIp6Address *aFirst, const otIp6Address *aSecond )
測試兩個 IPv6 位址是否相同。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6IsAddressUnspecified
bool otIp6IsAddressUnspecified( const otIp6Address *aAddress )
這個函式會指出指定的 IPv6 位址是否為未指定位址。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
OTIP6IsEnabled
bool otIp6IsEnabled( otInstance *aInstance )
指出 IPv6 介面是否已啟動。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6IsMulticastPromiscuousEnabled
bool otIp6IsMulticastPromiscuousEnabled( otInstance *aInstance )
檢查執行緒執行緒中是否已啟用多播概略模式。
詳細說明 | |||
---|---|---|---|
參數 |
|
otIp6SetMulticastPromiscuousEnabled
otIp6IsReceiveFilterEnabled
bool otIp6IsReceiveFilterEnabled( otInstance *aInstance )
這個函式指出是否要透過 otIp6SetReceiveCallback() 指定的回呼,在提供 IPv6 資料圖表時篩除執行緒控制流量。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
如果篩除了執行緒控制流量,則傳回 TRUE,否則為 FALSE。
|
otIp6SetReceiveCallback
otIp6SetReceiveFilterEnabled
otIp6IsSlaacEnabled
bool otIp6IsSlaacEnabled( otInstance *aInstance )
這個函式會指出是否要啟用 SLAAC 模組。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
,才能使用這個函式。
詳細說明 | |||||
---|---|---|---|---|---|
傳回值 |
|
OTIP6NewMessage
otMessage * otIp6NewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
分配新的訊息緩衝區來傳送 IPv6 訊息。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
如果沒有可用的訊息緩衝區或參數無效,表示訊息緩衝區的指標。
|
otMessageFree
otIp6NewMessageFromBuffer
otMessage * otIp6NewMessageFromBuffer( otInstance *aInstance, const uint8_t *aData, uint16_t aDataLength, const otMessageSettings *aSettings )
分配新的訊息緩衝區,並將 IPv6 資料圖表寫入訊息緩衝區,以便傳送 IPv6 訊息。
詳細說明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回 |
如果 IPv6 標頭的格式有誤,或是訊息緩衝區不足,將指向訊息指標或 NULL。
|
otMessageFree
otIp6PrefixMatch
uint8_t otIp6PrefixMatch( const otIp6Address *aFirst, const otIp6Address *aSecond )
這個函式會傳回兩個 IPv6 位址的前置字串比對長度 (位元)。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
前置字串比對長度 (以位元為單位)。
|
otIp6PrefixToString
void otIp6PrefixToString( const otIp6Prefix *aPrefix, char *aBuffer, uint16_t aSize )
這個函式會將特定 IPv6 前置字串轉換為使用者可理解的字串。
IPv6 位址字串的格式為「%x:%x:%x:...[::]/plen」。
如果產生的字串不適合在 aBuffer
中 (在其 aSize
字元內),系統會截斷字串,但輸出的字串一定是空值。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6ProtoToString
const char * otIp6ProtoToString( uint8_t aIpProto )
這個函式會將特定 IP 通訊協定號碼轉換為使用者可理解的字串。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
代表
aIpProto 的字串。 |
otIp6RegisterMulticastListeners
otError otIp6RegisterMulticastListeners( otInstance *aInstance, const otIp6Address *aAddresses, uint8_t aAddressNum, const uint32_t *aTimeout, otIp6RegisterMulticastListenersCallback aCallback, void *aContext )
這個函式會將多播監聽器註冊為主要中樞路由器。
注意:您必須同時啟用 OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
和 OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
,才能使用這個選項)
詳細說明 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
otIp6RegisterMulticastListenersCallback
otIp6RemoveAllUnsecurePort
void otIp6RemoveAllUnsecurePorts( otInstance *aInstance )
這個函式會從允許的不安全通訊埠清單中移除所有通訊埠。
詳細說明 | |||
---|---|---|---|
參數 |
|
otIp6RemoveUnicastAddress
otError otIp6RemoveUnicastAddress( otInstance *aInstance, const otIp6Address *aAddress )
從 Thread 介面移除網路介面位址。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otIp6RemoveUnsecurePort
otError otIp6RemoveUnsecurePort( otInstance *aInstance, uint16_t aPort )
這個函式會從允許的不安全通訊埠清單中移除通訊埠。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otIp6ResetBorderRouting 計數器
void otIp6ResetBorderRoutingCounters( otInstance *aInstance )
重設邊界轉送計數器。
詳細說明 | |||
---|---|---|---|
參數 |
|
otIp6SelectSourceAddress
otError otIp6SelectSourceAddress( otInstance *aInstance, otMessageInfo *aMessageInfo )
這個函式會執行 OpenThread 來源位址選項。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6 傳送
otError otIp6Send( otInstance *aInstance, otMessage *aMessage )
這個函式會透過 Thread 介面傳送 IPv6 資料圖表。
來電者在通話時轉移 aMessage
的擁有權。處理完成後,OpenThread 會釋出 aMessage
,包括在傳回 OT_ERROR_NONE
以外的值時。
詳細說明 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
otIp6SetAddressCallback
void otIp6SetAddressCallback( otInstance *aInstance, otIp6AddressCallback aCallback, void *aCallbackContext )
這個函式會註冊回呼,以通知內部 IPv6 位址變更。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6SetEnabled
otError otIp6SetEnabled( otInstance *aInstance, bool aEnabled )
將 IPv6 介面往上或下移。
呼叫此方法即可啟用或停用 IPv6 通訊功能。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6SetMeshLocalIid
otError otIp6SetMeshLocalIid( otInstance *aInstance, const otIp6InterfaceIdentifier *aIid )
這個函式會設定網格本機 IID (用於測試)。
您必須啟用 OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
,才能使用此功能。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6SetMulticastPromiscuousEnabled
void otIp6SetMulticastPromiscuousEnabled( otInstance *aInstance, bool aEnabled )
在 Thread 介面中啟用或停用多播概略模式。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
otIp6IsMulticastPromiscuousEnabled
OTIP6SetReceiveCallback
void otIp6SetReceiveCallback( otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext )
這個函式會註冊回呼,以便提供已接收的 IPv6 資料圖表。
根據預設,這個回呼不會傳遞執行緒控制流量。請參閱 otIp6SetReceiveFilterEnabled() 來變更執行緒控制流量篩選器設定。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6IsReceiveFilterEnabled
otIp6SetReceiveFilterEnabled
otIp6SetReceiveFilterEnabled
void otIp6SetReceiveFilterEnabled( otInstance *aInstance, bool aEnabled )
這個函式在設定透過 otIp6SetReceiveCallback() 指定的回呼提供 IPv6 資料元時,系統會過濾掉執行緒控制流量。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
otIp6SetReceiveCallback
otIsReceiveIp6FilterEnabled
otIp6SetSlaacEnabled
void otIp6SetSlaacEnabled( otInstance *aInstance, bool aEnabled )
這項功能可以啟用/停用 SLAAC 模組。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
,才能使用這個函式。
啟用 SLAAC 模組後,系統會將 SLAAC 位址 (根據「網路資料」中的網格前置字串) 新增至介面。如果停用 SLAAC 模組,先前新增的 SLAAC 地址也會一併移除。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
otIp6SetSlaacPrefixFilter
void otIp6SetSlaacPrefixFilter( otInstance *aInstance, otIp6SlaacPrefixFilter aFilter )
這個函式會設定 SLAAC 模組篩選器處理常式。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
,才能使用這個函式。
SLAAC 模組在根據前置字串新增 SLAAC 位址時,會呼叫篩選器處理常式,以決定是否要新增位址。
NULL 篩選器處理常式會停用篩選功能,並允許加入所有 SLAAC 位址。
如未呼叫這個函式,SLAAC 模組使用的預設篩選條件將為 NULL (篩選功能已停用)。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
otIp6SockAddrToString
void otIp6SockAddrToString( const otSockAddr *aSockAddr, char *aBuffer, uint16_t aSize )
這個函式會將特定 IPv6 通訊端位址轉換為使用者可理解的字串。
IPv6 通訊端位址字串格式為 [address
]:port
,其中 address
顯示為 16 個十六進位值,並以 :
分隔,port
則是通訊埠編號,格式為十進位格式,例如「[%x:%x:...:%x]:%u」。
如果產生的字串不適合在 aBuffer
中 (在其 aSize
字元內),系統會截斷字串,但輸出的字串一定是空值。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6SubscriptionMulticastAddress
otError otIp6SubscribeMulticastAddress( otInstance *aInstance, const otIp6Address *aAddress )
將執行緒介面訂閱為網路介面多播位址。
執行緒介面會複製執行個體 (aAddress
) 中傳遞的執行個體。Thread 介面僅支援固定在外部新增的多播位址。詳情請參閱《OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS
》。
詳細說明 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|
otIp6unsubscribeMulticastAddress
otError otIp6UnsubscribeMulticastAddress( otInstance *aInstance, const otIp6Address *aAddress )
將執行緒介面取消訂閱為網路介面多播位址。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
巨集
OT_IP6_ADDRESS_SIZE
OT_IP6_ADDRESS_SIZE 16
IPv6 位址的大小 (位元組)
OT_IP6_ADDRESS_STRING_SIZE
OT_IP6_ADDRESS_STRING_SIZE 40
IPv6 位址的字串表示大小建議。
OT_IP6_IID_SIZE
OT_IP6_IID_SIZE 8
IPv6 介面 ID (大小) 大小
OT_IP6_MAX_MLR_ADDRESSES
OT_IP6_MAX_MLR_ADDRESSES 15
多播監聽器註冊支援的 IPv6 位址數量上限。
OT_IP6_PREFIX_BITSIZE
OT_IP6_PREFIX_BITSIZE (OT_IP6_PREFIX_SIZE * 8)
IPv6 前置字串大小 (位元)
OT_IP6_PREFIX_SIZE
OT_IP6_PREFIX_SIZE 8
IPv6 前置字串的大小 (位元組)
OT_IP6_PREFIX_STRING_SIZE
OT_IP6_PREFIX_STRING_SIZE 45
IPv6 前置字串的字串表示大小建議。
OT_IP6_SOCK_ADDR_STRING_SIZE
OT_IP6_SOCK_ADDR_STRING_SIZE 48
IPv6 通訊端位址的字串表示大小建議。
資源
OpenThread API 參考資料主題出自原始碼,可於 GitHub 取得。如需更多資訊,或想參閱我們的說明文件,請參閱資源。