nl::Weave::WeaveFabricState

#include <src/lib/core/WeaveFabricState.h>

WeaveFabricState 的轉寄宣告。

摘要

建構函式和解構函式

WeaveFabricState(void)

公開類型

PeerIndexType typedef
uint8_t
SessionEndCbFunct)(uint16_t keyId, uint64_t peerNodeId, void *context) typedef
void(*
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 安全性工作階段停權並序列化。

結構

nl::Weave::WeaveFabricState::SessionEndCbCtxt

公開類型

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
)

這個方法會在共用的結束節點記錄中新增結束節點。

詳細說明
參數
[in] sessionKey
WeaveSessionKey 物件,代表應新增結束節點的工作階段。
[in] endNodeId
要新增的工作階段結束節點的節點 ID。
傳回值
WEAVE_ERROR_TOO_MANY_SHARED_SESSION_END_NODES
如果共用端點清單中沒有可用空間可供新項目使用。
WEAVE_NO_ERROR
成功時。

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
)

這個方法會尋找工作階段金鑰項目。

詳細說明
參數
[in] keyId
Weave 金鑰 ID。
[in] peerNodeId
對等互連的節點 ID。
[in] create
布林值,指出如果找不到指定的索引鍵時是否應建立新鍵。
[out] retRec
WeaveSessionKey 物件的指標參照。
傳回值
WEAVE_ERROR_WRONG_KEY_TYPE
如果指定的金鑰不是工作階段金鑰類型。
WEAVE_ERROR_INVALID_ARGUMENT
如果輸入引數的值有誤。
WEAVE_ERROR_KEY_NOT_FOUND
找不到指定的鍵。
WEAVE_ERROR_TOO_MANY_KEYS
如果沒有免付費項目可建立新的工作階段金鑰。
WEAVE_NO_ERROR
成功時。

FindSharedSession

WeaveSessionKey * FindSharedSession(
  uint64_t terminatingNodeId,
  WeaveAuthMode authMode,
  uint8_t encType
)

在工作階段金鑰表格中搜尋已建立的共用工作階段金鑰,該金鑰會指定指定的終止節點,且符合指定的驗證模式和加密類型。

詳細說明
參數
[in] terminatingNodeId
工作階段結束器的節點 ID。
[in] authMode
所需的工作階段驗證模式。
[in] encType
所需的郵件加密類型。
傳回值
WeaveSessionKey
* 指向代表相符共用工作階段的 WeaveSessionKey 物件指標;如果找不到相符的工作階段,則為 NULL。

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。

詳細說明
參數
[in] sessionKey
工作階段金鑰物件的指標。
[in] endNodeIds
節點 ID 緩衝區的指標。
[in] endNodeIdsMaxCount
緩衝區空間的節點 ID 數量上限。
[out] endNodeIdsCount
共用指定工作階段的找到結束節點 ID 數量。
傳回值
WEAVE_ERROR_BUFFER_TOO_SMALL
如果提供的結束節點 ID 緩衝區空間不足。
WEAVE_NO_ERROR
成功時。

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 相關聯的安全工作階段。

詳細說明
參數
[in] keyId
工作階段金鑰 ID。
[in] peerNodeId
對等互連的節點 ID。
傳回值
bool
是否共用工作階段。

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。

這個變化版本可讓您指定子網路。

詳細說明
參數
[in] nodeId
相關節點的節點 ID 號碼。
[in] subnet
ULA 的所需子網路。
傳回值
IPAddress
IPAddress 物件。

SelectNodeAddress

IPAddress SelectNodeAddress(
  uint64_t nodeId
) const 

傳回含有指定節點 Weave ULA 的 IPAddress。

這個變化版本會使用本機節點的預設子網路。

詳細說明
參數
[in] nodeId
相關節點的節點 ID 號碼。
傳回值
IPAddress
IPAddress 物件。

SetDelegate

void SetDelegate(
  FabricStateDelegate *aDelegate
)

這個方法會設定委派物件。

每當 FabricId 有所變更時,系統就會叫用委派方法。也就是說,當我們彙整/建立架構,或是離開布料狀態 (較明確的布料狀態) 時

如先前已設定委派,之後對這個方法進行第二次呼叫時,就會覆寫先前的委派設定。

詳細說明
參數
[in] aDelegate
委派物件。如果沒有委派,則可設為空值。

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
)