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 Security 会话。
|
SelectNodeAddress(uint64_t nodeId, uint16_t subnet) const
|
返回一个 IPAddress,其中包含指定节点的 Weave ULA。
|
SelectNodeAddress(uint64_t nodeId) const
|
返回一个 IPAddress,其中包含指定节点的 Weave ULA。
|
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
)
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 Security 会话。
SelectNodeAddress
IPAddress SelectNodeAddress(
uint64_t nodeId,
uint16_t subnet
) const
返回一个 IPAddress,其中包含指定节点的 Weave ULA。
此变体允许指定子网。
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
|
SelectNodeAddress
IPAddress SelectNodeAddress(
uint64_t nodeId
) const
返回一个 IPAddress,其中包含指定节点的 Weave ULA。
此变体使用本地节点的默认子网。
详细信息 | |||
---|---|---|---|
参数 |
|
||
返回值 |
|
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
)