IPv6
這個模組包含用於控制 IPv6 通訊的功能。
摘要
列舉 |
|
---|---|
anonymous enum{
|
列舉 IPv6 位址來源。 |
anonymous enum{
|
列舉 ECN 狀態,如 IP 標頭所示。 |
anonymous enum{
|
列舉 網際網路通訊協定號碼。 |
Typedefs |
|
---|---|
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 網路介面的多點傳送位址。 |
otSockAddr
|
typedefstruct otSockAddr
這個結構代表一個 IPv6 插槽位址。 |
變數 |
|
---|---|
OT_TOOL_PACKED_END
|
函式 |
|
---|---|
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 前置字串是否相同。
|
otIp6GetMulticastAddresses(otInstance *aInstance)
|
const otNetifMulticastAddress *
取得已訂閱 Thread 介面的 IPv6 多播位址清單。
|
otIp6GetUnicastAddresses(otInstance *aInstance)
|
const otNetifAddress *
取得指派給 Thread 介面的 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
檢查 Thread 介面上是否已啟用多點混音模式。
|
otIp6IsReceiveFilterEnabled(otInstance *aInstance)
|
bool
這個函式指出當透過 otIp6SetReceiveCallback() 指定的回呼來傳送 IPv6 資料元時,系統會篩選掉 Thread 控制流量以及 Thread 控制流量。
|
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 數據圖,用於發送 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)
|
這個函式會從允許的不安全通訊埠清單中移除通訊埠。
|
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 資料圖表時,是否排除 Thread 控制流量。
|
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)
|
訂閱 Thread 介面到網路介面多播位址。
|
otIp6UnsubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
將 Thread 介面取消訂閱網路介面介面多點傳送。
|
結構 |
|
---|---|
otIp6Address |
這個結構代表一個 IPv6 位址。 |
otIp6AddressComponents |
這個結構代表的是 IPv6 位址的元件。 |
otIp6AddressInfo |
這個結構代表 IPv6 位址資訊。 |
otIp6InterfaceIdentifier |
這個結構代表了 IPv6 位址的介面 ID。 |
otIp6NetworkPrefix |
這個結構代表 IPv6 位址的「網路前置字串」(地址中最顯著的 64 位元)。 |
otIp6Prefix |
這個結構代表一個 IPv6 前置字串。 |
otMessageInfo |
這個結構代表本機和對等 IPv6 通訊端位址。 |
otNetifAddress |
這個結構代表一個 IPv6 網路介面的單點位址。 |
otNetifMulticastAddress |
這個結構代表一個 IPv6 網路介面的多點傳送位址。 |
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
|
ECT(0) |
OT_ECN_CAPABLE_1
|
ECT(1) |
OT_ECN_MARKED
|
發生壅塞 (CE) |
OT_ECN_NOT_CAPABLE
|
非 ECT。 |
匿名列舉
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 位址時,系統會呼叫這個函式指標。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6 地址資訊
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
函式
otIp6AddUnicastAddress
otError otIp6AddUnicastAddress( otInstance *aInstance, const otNetifAddress *aAddress )
將網路介面位址新增至 Thread 介面。
傳入的執行個體 aAddress
已由 Thread 介面複製。Thread 介面僅支援固定新增的外部 IP 位址。詳情請參閱 OPENINVITER_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 個十六值,以 &&39;:' 分隔; (即「%x:%x:%x:...:%x」)。
如果產生的字串不適合在 aBuffer
字元內 (包含於 aSize
字元),系統會截斷這些字串,但輸出的字串一律會是空值。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6ArePrefixesEqual
bool otIp6ArePrefixesEqual( const otIp6Prefix *aFirst, const otIp6Prefix *aSecond )
測試兩個 IPv6 前置字串是否相同。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6GetMulticastAddress
const otNetifMulticastAddress * otIp6GetMulticastAddresses( otInstance *aInstance )
取得已訂閱 Thread 介面的 IPv6 多播位址清單。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向第一個網路介面多播地址的指標。
|
otIp6GetUnicastAddress
const otNetifAddress * otIp6GetUnicastAddresses( otInstance *aInstance )
取得指派給 Thread 介面的 IPv6 位址清單。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向第一個網路介面介面的指標。
|
otIp6GetUnsecurePort
const uint16_t * otIp6GetUnsecurePorts( otInstance *aInstance, uint8_t *aNumEntries )
這個函式會傳回指向不安全的通訊埠清單。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
指向不安全的通訊埠清單。
|
otIp6IsAddressEqual
bool otIp6IsAddressEqual( const otIp6Address *aFirst, const otIp6Address *aSecond )
測試兩個 IPv6 位址是否相同。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6IsAddress 未指定
bool otIp6IsAddressUnspecified( const otIp6Address *aAddress )
這個函式會指出特定 IPv6 位址是否為未指定位址。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6IsEnabled
bool otIp6IsEnabled( otInstance *aInstance )
這個函式會指出 IPv6 介面是否已開啟。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6IsMulticastPromiscuousEnabled
bool otIp6IsMulticastPromiscuousEnabled( otInstance *aInstance )
檢查 Thread 介面上是否已啟用多點混音模式。
詳情 | |||
---|---|---|---|
參數 |
|
otIp6SetMulticastPromiscuousEnabled
otIp6IsReceiveFilterEnabled
bool otIp6IsReceiveFilterEnabled( otInstance *aInstance )
這個函式指出當透過 otIp6SetReceiveCallback() 指定的回呼來傳送 IPv6 資料元時,系統會篩選掉 Thread 控制流量以及 Thread 控制流量。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
如果篩選到的執行緒控制流量為 TRUE,則傳回 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 消息。
詳情 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回 |
指向訊息的指標 (如果 IPv6 標頭格式錯誤或訊息緩衝區不足),則指向指標。
|
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 位址字串的格式為「&xt;%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 )
這個函式會從允許的不安全通訊埠清單中移除通訊埠。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otIp6 選取來源位址
otError otIp6SelectSourceAddress( otInstance *aInstance, otMessageInfo *aMessageInfo )
這個函式會執行 OpenThread 來源位址選項。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otIp6 傳送
otError otIp6Send( otInstance *aInstance, otMessage *aMessage )
這個函式會透過 Thread 介面傳送 IPv6 資料圖表。
來電者將撥打 aMessage
的擁有權。處理完成後 (包括傳回 OT_ERROR_NONE
以外的值),OpenThread 將免費提供 aMessage
。
詳情 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
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 資料元。
根據預設,這個回呼不會傳送 Thread 控制流量。變更 otIp6SetReceiveFilterEnabled() 可變更執行緒控制流量篩選器設定。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6IsReceiveFilterEnabled
otIp6SetReceiveFilterEnabled
otIp6SetReceiveFilterEnabled
void otIp6SetReceiveFilterEnabled( otInstance *aInstance, bool aEnabled )
這個函式會設定在透過 otIp6SetReceiveCallback() 所指定的回呼來傳送 IPv6 資料圖表時,是否排除 Thread 控制流量。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
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 通訊端位址字串的格式是「&」
]:
則是十進位數字 (例如[「%x:%x:...:%x]:%u」」
如果產生的字串不適合在 aBuffer
字元內 (包含於 aSize
字元),系統會截斷這些字串,但輸出的字串一律會是空值。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otIp6 訂閱多播地址
otError otIp6SubscribeMulticastAddress( otInstance *aInstance, const otIp6Address *aAddress )
訂閱 Thread 介面到網路介面多播位址。
執行個體 (aAddress
) 中傳遞的執行緒將由 Thread 介面複製。Thread 介面僅支援固定的外部多播地址。詳情請參閱 OPENINVITER_CONFIG_IP6_MAX_EXT_MCAST_ADDRS。
詳情 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|
otIp6 取消訂閱多播地址
otError otIp6UnsubscribeMulticastAddress( otInstance *aInstance, const otIp6Address *aAddress )
將 Thread 介面取消訂閱網路介面介面多點傳送。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
巨集
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 通訊端位址的字串表示建議大小。