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 的 IP 地址。
|
SelectNodeAddress(uint64_t nodeId) const
|
返回包含指定节点的 Weave ULA 的 IP 地址。
|
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 安全会话的状态。
|
结构体 |
|
---|---|
nl:: |
公共类型
对等索引类型
uint8_t PeerIndexType
会话结束函数
void(* SessionEndCbFunct)(uint16_t keyId, uint64_t peerNodeId, void *context)
状态
State
公共属性
自动创建密钥
bool AutoCreateKeys
DebugFabricId
uint64_t DebugFabricId
默认子网
uint16_t DefaultSubnet
FabricId
uint64_t FabricId
群组密钥库
nl::Weave::Profiles::Security::AppKeys::GroupKeyStoreBase * GroupKeyStore
ListenIPv4Addr 类中的方法
IPAddress ListenIPv4Addr
ListenIPv6Addr 类中的方法
IPAddress ListenIPv6Addr
LocalNodeId 类中的方法
uint64_t LocalNodeId
日志密钥
bool LogKeys
MaxUnencUDPMsgIdRcvd
uint32_t MaxUnencUDPMsgIdRcvd[WEAVE_CONFIG_MAX_PEER_NODES]
消息层
WeaveMessageLayer * MessageLayer
最近使用的索引
PeerIndexType MostRecentlyUsedIndexes[WEAVE_CONFIG_MAX_PEER_NODES]
NodeId
uint64_t NodeId[WEAVE_CONFIG_MAX_PEER_NODES]
配对码
const char * PairingCode
状态
uint8_t State
UnencRcv 标志
WeaveSessionState::ReceiveFlagsType UnencRcvFlags[WEAVE_CONFIG_MAX_PEER_NODES]
使用测试密钥
bool UseTestKey
公共函数
添加共享会话结束节点
WEAVE_ERROR AddSharedSessionEndNode( uint64_t endNodeId, uint64_t terminatingNodeId, uint16_t keyId )
添加共享会话结束节点
WEAVE_ERROR AddSharedSessionEndNode( WeaveSessionKey *sessionKey, uint64_t endNodeId )
此方法会将新的端点添加到共享端点节点记录。
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
|
AllcSession 键
WEAVE_ERROR AllocSessionKey( uint64_t peerNodeId, uint16_t keyId, WeaveConnection *boundCon, WeaveSessionKey *& sessionKey )
ClearFabricState
void ClearFabricState( void )
创建 Fabric
WEAVE_ERROR CreateFabric( void )
查找会话密钥
WEAVE_ERROR FindSessionKey( uint16_t keyId, uint64_t peerNodeId, bool create, WeaveSessionKey *& retRec )
此方法可查找会话密钥条目。
详细信息 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
参数 |
|
||||||||||
返回值 |
|
查找共享会话
WeaveSessionKey * FindSharedSession( uint64_t terminatingNodeId, WeaveAuthMode authMode, uint8_t encType )
在会话密钥表中搜索以指定的终止节点为目标且与指定身份验证模式和加密类型匹配的既定共享会话密钥。
详细信息 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
||||||
返回值 |
|
GetFabricState
WEAVE_ERROR GetFabricState( uint8_t *buf, uint32_t bufSize, uint32_t & fabricStateLen )
获取密码
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 关联的安全会话。
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
|
加入现有的 Fabric
WEAVE_ERROR JoinExistingFabric( const uint8_t *fabricState, uint32_t fabricStateLen )
RegisterSessionEndCallback
WEAVE_ERROR RegisterSessionEndCallback( SessionEndCbCtxt *sessionEndCb )
移除会话键
bool RemoveIdleSessionKeys()
移除会话密钥
WEAVE_ERROR RemoveSessionKey( uint16_t keyId, uint64_t peerNodeId )
移除会话密钥
void RemoveSessionKey( WeaveSessionKey *sessionKey, bool wasIdle )
移除共享会话结束节点
void RemoveSharedSessionEndNodes( const WeaveSessionKey *sessionKey )
恢复会话
WEAVE_ERROR RestoreSession( uint8_t *serializedSession, uint16_t serializedSessionLen )
从序列化状态恢复之前暂停的 Weave 安全会话。
SelectNodeAddress
IPAddress SelectNodeAddress( uint64_t nodeId, uint16_t subnet ) const
返回包含指定节点的 Weave ULA 的 IP 地址。
此变体允许指定子网。
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
|
SelectNodeAddress
IPAddress SelectNodeAddress( uint64_t nodeId ) const
返回包含指定节点的 Weave ULA 的 IP 地址。
此变体使用本地节点的默认子网。
详细信息 | |||
---|---|---|---|
参数 |
|
||
返回值 |
|
设置代理
void SetDelegate( FabricStateDelegate *aDelegate )
此方法可设置委托对象。
每当更改 FabricId 时(即,当我们加入/创建结构时,或当我们退出架构(清除结构状态)时),都会调用代理的回调方法
如果 delegate 先前已设置,则对此方法的第二次调用将覆盖之前的 delegate。
详细信息 | |||
---|---|---|---|
参数 |
|
设置会话密钥
WEAVE_ERROR SetSessionKey( uint16_t keyId, uint64_t peerNodeId, uint8_t encType, WeaveAuthMode authMode, const WeaveEncryptionKey *encKey )
设置会话密钥
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 )