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 enum

공개 속성

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 키 식별자입니다.
[in] peerNodeId
피어의 노드 식별자입니다.
[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
세션 종료자의 노드 식별자입니다.
[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
세션 키 식별자입니다.
[in] peerNodeId
피어의 노드 식별자입니다.
반환 값
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
위임 객체입니다. 위임이 필요하지 않은 경우 NULL일 수 있습니다.

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
)