nl::Weave::WeaveFabricState
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
#include <src/lib/core/WeaveFabricState.h>
WeaveFabricState 的前向宣告。
摘要
建構函式和解構函式 |
|
---|---|
WeaveFabricState(void)
|
公開類型 |
|
---|---|
PeerIndexType
|
typedefuint8_t
|
SessionEndCbFunct)(uint16_t keyId, uint64_t peerNodeId, void *context)
|
typedefvoid(*
|
State
|
列舉 |
公開屬性 |
|
---|---|
AutoCreateKeys
|
bool
|
DebugFabricId
|
uint64_t
|
DefaultSubnet
|
uint16_t
|
FabricId
|
uint64_t
|
GroupKeyStore
|
|
ListenIPv4Addr
|
IPAddress
|
ListenIPv6Addr
|
IPAddress
|
LocalNodeId
|
uint64_t
|
LogKeys
|
bool
|
MaxUnencUDPMsgIdRcvd[WEAVE_CONFIG_MAX_PEER_NODES]
|
uint32_t
|
MessageLayer
|
|
MostRecentlyUsedIndexes[WEAVE_CONFIG_MAX_PEER_NODES]
|
PeerIndexType
|
NodeId[WEAVE_CONFIG_MAX_PEER_NODES]
|
uint64_t
|
PairingCode
|
const char *
|
State
|
uint8_t
|
UnencRcvFlags[WEAVE_CONFIG_MAX_PEER_NODES]
|
WeaveSessionState::ReceiveFlagsType
|
UseTestKey
|
bool
|
公開函式 |
|
---|---|
AddSharedSessionEndNode(uint64_t endNodeId, uint64_t terminatingNodeId, uint16_t keyId)
|
|
AddSharedSessionEndNode(WeaveSessionKey *sessionKey, uint64_t endNodeId)
|
這個方法會將新的結束節點新增至共用端點記錄。
|
AllocSessionKey(uint64_t peerNodeId, uint16_t keyId, WeaveConnection *boundCon, WeaveSessionKey *& sessionKey)
|
|
ClearFabricState(void)
|
void
|
CreateFabric(void)
|
|
FindSessionKey(uint16_t keyId, uint64_t peerNodeId, bool create, WeaveSessionKey *& retRec)
|
這個方法會尋找工作階段金鑰項目。
|
FindSharedSession(uint64_t terminatingNodeId, WeaveAuthMode authMode, uint8_t encType)
|
搜尋工作階段金鑰資料表,找出已建立的共用工作階段金鑰 (指定目標為指定終止節點,且符合指定的驗證模式和加密類型)。
|
GetFabricState(uint8_t *buf, uint32_t bufSize, uint32_t & fabricStateLen)
|
|
GetPassword(uint8_t pwSrc, const char *& ps, uint16_t & pwLen)
|
|
GetSessionKey(uint16_t keyId, uint64_t peerNodeId, WeaveSessionKey *& outSessionKey)
|
|
GetSessionState(uint64_t remoteNodeId, uint16_t keyId, uint8_t encType, WeaveConnection *con, WeaveSessionState & outSessionState)
|
|
GetSharedSessionEndNodeIds(const WeaveSessionKey *sessionKey, uint64_t *endNodeIds, uint8_t endNodeIdsBufSize, uint8_t & endNodeIdsCount)
|
這個方法會傳回共用指定工作階段的所有結束節點 ID。
|
HandleConnectionClosed(WeaveConnection *con)
|
void
|
Init(void)
|
|
Init(nl::Weave::Profiles::Security::AppKeys::GroupKeyStoreBase *groupKeyStore)
|
|
IsFabricAddress(const IPAddress & addr) const
|
bool
判斷 IP 位址是否代表當地 Weave 布料中某個節點的位址。
|
IsLocalFabricAddress(const IPAddress & addr) const
|
bool
判斷 IP 位址是否代表本機節點的 Weave 布料位址。
|
IsSharedSession(uint16_t keyId, uint64_t peerNodeId)
|
bool
這個方法會檢查與指定對等點和 keyId 相關聯的安全工作階段是否共用。
|
JoinExistingFabric(const uint8_t *fabricState, uint32_t fabricStateLen)
|
|
RegisterSessionEndCallback(SessionEndCbCtxt *sessionEndCb)
|
|
RemoveIdleSessionKeys()
|
bool
|
RemoveSessionKey(uint16_t keyId, uint64_t peerNodeId)
|
|
RemoveSessionKey(WeaveSessionKey *sessionKey, bool wasIdle)
|
void
|
RemoveSharedSessionEndNodes(const WeaveSessionKey *sessionKey)
|
void
|
RestoreSession(uint8_t *serializedSession, uint16_t serializedSessionLen)
|
將先前暫停的 Weave 安全性工作階段從序列化狀態還原。
|
SelectNodeAddress(uint64_t nodeId, uint16_t subnet) const
|
傳回包含指定節點 Weave ULA 的 IPAddress。
|
SelectNodeAddress(uint64_t nodeId) const
|
傳回包含指定節點 Weave ULA 的 IPAddress。
|
SetDelegate(FabricStateDelegate *aDelegate)
|
void
這個方法會設定委派物件。
|
SetSessionKey(uint16_t keyId, uint64_t peerNodeId, uint8_t encType, WeaveAuthMode authMode, const WeaveEncryptionKey *encKey)
|
|
SetSessionKey(WeaveSessionKey *sessionKey, uint8_t encType, WeaveAuthMode authMode, const WeaveEncryptionKey *encKey)
|
|
Shutdown(void)
|
|
SuspendSession(uint16_t keyId, uint64_t peerNodeId, uint8_t *buf, uint16_t bufSize, uint16_t & serializedSessionLen)
|
暫停並序列化作用中的 Weave 安全性工作階段狀態。
|
公開類型
PeerIndexType
uint8_t PeerIndexType
SessionEndCbFunct
void(* SessionEndCbFunct)(uint16_t keyId, uint64_t peerNodeId, void *context)
州
State
公開屬性
AutoCreateKeys
bool AutoCreateKeys
DebugFabricId
uint64_t DebugFabricId
DefaultSubnet
uint16_t DefaultSubnet
FabricId
uint64_t FabricId
GroupKeyStore
nl::Weave::Profiles::Security::AppKeys::GroupKeyStoreBase * GroupKeyStore
ListenIPv4Addr
IPAddress ListenIPv4Addr
ListenIPv6Addr
IPAddress ListenIPv6Addr
LocalNodeId
uint64_t LocalNodeId
LogKeys
bool LogKeys
MaxUnencUDPMsgIdRcvd
uint32_t MaxUnencUDPMsgIdRcvd[WEAVE_CONFIG_MAX_PEER_NODES]
MessageLayer
WeaveMessageLayer * MessageLayer
MostRecentlyUsedIndexes
PeerIndexType MostRecentlyUsedIndexes[WEAVE_CONFIG_MAX_PEER_NODES]
NodeId
uint64_t NodeId[WEAVE_CONFIG_MAX_PEER_NODES]
PairingCode
const char * PairingCode
州
uint8_t State
UnencRcvFlags
WeaveSessionState::ReceiveFlagsType UnencRcvFlags[WEAVE_CONFIG_MAX_PEER_NODES]
UseTestKey
bool UseTestKey
公開函式
AddSharedSessionEndNode
WEAVE_ERROR AddSharedSessionEndNode(
uint64_t endNodeId,
uint64_t terminatingNodeId,
uint16_t keyId
)
AddSharedSessionEndNode
WEAVE_ERROR AddSharedSessionEndNode(
WeaveSessionKey *sessionKey,
uint64_t endNodeId
)
這個方法會將新的結束節點新增至共用端點記錄。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
AllocSessionKey
WEAVE_ERROR AllocSessionKey(
uint64_t peerNodeId,
uint16_t keyId,
WeaveConnection *boundCon,
WeaveSessionKey *& sessionKey
)
ClearFabricState
void ClearFabricState(
void
)
CreateFabric
WEAVE_ERROR CreateFabric(
void
)
FindSessionKey
WEAVE_ERROR FindSessionKey(
uint16_t keyId,
uint64_t peerNodeId,
bool create,
WeaveSessionKey *& retRec
)
這個方法會尋找工作階段金鑰項目。
詳細資料 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|
FindSharedSession
WeaveSessionKey * FindSharedSession(
uint64_t terminatingNodeId,
WeaveAuthMode authMode,
uint8_t encType
)
搜尋工作階段金鑰資料表,找出已建立的共用工作階段金鑰 (指定目標為指定終止節點,且符合指定的驗證模式和加密類型)。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
GetFabricState
WEAVE_ERROR GetFabricState(
uint8_t *buf,
uint32_t bufSize,
uint32_t & fabricStateLen
)
GetPassword
WEAVE_ERROR GetPassword(
uint8_t pwSrc,
const char *& ps,
uint16_t & pwLen
)
GetSessionKey
WEAVE_ERROR GetSessionKey(
uint16_t keyId,
uint64_t peerNodeId,
WeaveSessionKey *& outSessionKey
)
GetSessionState
WEAVE_ERROR GetSessionState(
uint64_t remoteNodeId,
uint16_t keyId,
uint8_t encType,
WeaveConnection *con,
WeaveSessionState & outSessionState
)
GetSharedSessionEndNodeIds
WEAVE_ERROR GetSharedSessionEndNodeIds(
const WeaveSessionKey *sessionKey,
uint64_t *endNodeIds,
uint8_t endNodeIdsBufSize,
uint8_t & endNodeIdsCount
)
這個方法會傳回共用指定工作階段的所有結束節點 ID。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
HandleConnectionClosed
void HandleConnectionClosed(
WeaveConnection *con
)
Init
WEAVE_ERROR Init(
void
)
Init
WEAVE_ERROR Init(
nl::Weave::Profiles::Security::AppKeys::GroupKeyStoreBase *groupKeyStore
)
IsFabricAddress
bool IsFabricAddress(
const IPAddress & addr
) const
判斷 IP 位址是否代表當地 Weave 布料中某個節點的位址。
IsLocalFabricAddress
bool IsLocalFabricAddress(
const IPAddress & addr
) const
判斷 IP 位址是否代表本機節點的 Weave 布料位址。
IsSharedSession
bool IsSharedSession(
uint16_t keyId,
uint64_t peerNodeId
)
這個方法會檢查與指定對等點和 keyId 相關聯的安全工作階段是否共用。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
JoinExistingFabric
WEAVE_ERROR JoinExistingFabric(
const uint8_t *fabricState,
uint32_t fabricStateLen
)
RegisterSessionEndCallback
WEAVE_ERROR RegisterSessionEndCallback(
SessionEndCbCtxt *sessionEndCb
)
RemoveIdleSessionKeys
bool RemoveIdleSessionKeys()
RemoveSessionKey
WEAVE_ERROR RemoveSessionKey(
uint16_t keyId,
uint64_t peerNodeId
)
RemoveSessionKey
void RemoveSessionKey(
WeaveSessionKey *sessionKey,
bool wasIdle
)
RemoveSharedSessionEndNodes
void RemoveSharedSessionEndNodes(
const WeaveSessionKey *sessionKey
)
RestoreSession
WEAVE_ERROR RestoreSession(
uint8_t *serializedSession,
uint16_t serializedSessionLen
)
將先前暫停的 Weave 安全性工作階段從序列化狀態還原。
SelectNodeAddress
IPAddress SelectNodeAddress(
uint64_t nodeId,
uint16_t subnet
) const
傳回包含指定節點 Weave ULA 的 IPAddress。
這個變化版本可讓您指定子網路。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
SelectNodeAddress
IPAddress SelectNodeAddress(
uint64_t nodeId
) const
傳回包含指定節點 Weave ULA 的 IPAddress。
這個變化版本會使用本機節點的預設子網路。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回值 |
|
SetDelegate
void SetDelegate(
FabricStateDelegate *aDelegate
)
這個方法會設定委派物件。
每當 FabricId 發生變更時 (即加入/建立架構,或離開織布狀態時),就會叫用委派的回呼方法
如果先前已設定委派,則對這個方法的第二次呼叫將會覆寫先前的委派。
詳細資料 | |||
---|---|---|---|
參數 |
|
SetSessionKey
WEAVE_ERROR SetSessionKey(
uint16_t keyId,
uint64_t peerNodeId,
uint8_t encType,
WeaveAuthMode authMode,
const WeaveEncryptionKey *encKey
)
SetSessionKey
WEAVE_ERROR SetSessionKey(
WeaveSessionKey *sessionKey,
uint8_t encType,
WeaveAuthMode authMode,
const WeaveEncryptionKey *encKey
)
關閉
WEAVE_ERROR Shutdown(
void
)
SuspendSession
WEAVE_ERROR SuspendSession(
uint16_t keyId,
uint64_t peerNodeId,
uint8_t *buf,
uint16_t bufSize,
uint16_t & serializedSessionLen
)
暫停並序列化作用中的 Weave 安全性工作階段狀態。
將已識別的 Weave 安全性工作階段狀態序列化到提供的緩衝區中,並暫停工作階段,以不再傳送或接收任何訊息。
這個方法適用於不在休眠時保留 RAM 的裝置,讓這類裝置可保留執行中工作階段的狀態,不必在醒來時重新建立工作階段。
WeaveFabricState
WeaveFabricState(
void
)