nl::Weave

Summary

Enumerations

@21{
  kFlagConnectionClosed = 0x0002,
  kFlagAutoRequestAck = 0x0004,
  kFlagDropAck = 0x0008,
  kFlagResponseExpected = 0x0010,
  kFlagAckPending = 0x0020,
  kFlagPeerRequestedAck = 0x0040,
  kFlagMsgRcvdFromPeer = 0x0080,
  kFlagAutoReleaseKey = 0x0100,
  kFlagAutoReleaseConnection = 0x0200,
  kFlagUseEphemeralUDPPort = 0x0400
}
enum
@36 enum
@37 enum
@38{
  kFabricIdDefaultForTest = 1ULL
}
enum
@39{
  kCertType_NotSpecified = 0x00,
  kCertType_General = 0x01,
  kCertType_Device = 0x02,
  kCertType_ServiceEndpoint = 0x03,
  kCertType_FirmwareSigning = 0x04,
  kCertType_AccessToken = 0x05,
  kCertType_CA = 0x06,
  kCertType_AppDefinedBase = 0x7F,
  kCertType_Max = 0xFF
}
enum
Identifies the purpose or application of certificate.
@40 enum
Identifies the source for the password used in a password-based authentication protocol (e.g.
@41{
  kWeaveAuthMode_NotSpecified = 0x0000,
  kWeaveAuthModeCategory_General = 0x0000,
  kWeaveAuthModeCategory_PASE = 0x1000,
  kWeaveAuthModeCategory_CASE = 0x2000,
  kWeaveAuthModeCategory_TAKE = 0x3000,
  kWeaveAuthModeCategory_GroupKey = 0x4000,
  kWeaveAuthModeCategory_AppDefinedBase = 0xC000,
  kWeaveAuthMode_Unauthenticated = kWeaveAuthModeCategory_General | 0x001,
  kWeaveAuthMode_PASE_PairingCode = kWeaveAuthModeCategory_PASE | kPasswordSource_PairingCode,
  kWeaveAuthMode_CASE_AnyCert = kWeaveAuthModeCategory_CASE | kCertType_NotSpecified,
  kWeaveAuthMode_CASE_GeneralCert = kWeaveAuthModeCategory_CASE | kCertType_General,
  kWeaveAuthMode_CASE_Device = kWeaveAuthModeCategory_CASE | kCertType_Device,
  kWeaveAuthMode_CASE_ServiceEndPoint = kWeaveAuthModeCategory_CASE | kCertType_ServiceEndpoint,
  kWeaveAuthMode_CASE_AccessToken = kWeaveAuthModeCategory_CASE | kCertType_AccessToken,
  kWeaveAuthMode_TAKE_IdentificationKey = kWeaveAuthModeCategory_TAKE | 0x001
}
enum
@42{
  kFabricSecretScope_All = 0x00
}
enum
@43{
  kTestKey_AES128CTRSHA1_DataKeyByte = 0xAB,
  kTestKey_AES128CTRSHA1_IntegrityKeyByte = 0xBA
}
enum
@44 enum
Weave message encryption application key diversifier size.
@45 enum
@53 enum
@54{
  kWeavePeerDescription_MaxLength = 100
}
enum
@55{
  kWeaveHeaderFlag_DestNodeId = 0x0100,
  kWeaveHeaderFlag_SourceNodeId = 0x0200,
  kWeaveHeaderFlag_TunneledData = 0x0400,
  kWeaveHeaderFlag_MsgCounterSyncReq = 0x0800
}
enum
Definitions pertaining to the header of an encoded Weave message.
@56{
  kEUI64_UL_Mask = 0x0200000000000000ULL,
  kEUI64_UL_Unversal = 0,
  kEUI64_UL_Local = kEUI64_UL_Mask,
  kEUI64_IG_Mask = 0x0100000000000000ULL,
  kEUI64_IG_Individual = 0,
  kEUI64_IG_Group = kEUI64_IG_Mask
}
enum
Bit field definitions for IEEE EUI-64 Identifiers.
@57{
  kMaxAlwaysLocalWeaveNodeId = 0x000000000000FFFFULL
}
enum
Special ranges of Weave Node Ids.
WeaveEncryptionType{
  kWeaveEncryptionType_None = 0,
  kWeaveEncryptionType_AES128CTRSHA1 = 1
}
enum
The encryption types for the Weave message.
WeaveExchangeFlags{
  kWeaveExchangeFlag_Initiator = 0x1,
  kWeaveExchangeFlag_AckId = 0x2,
  kWeaveExchangeFlag_NeedsAck = 0x4
}
enum
The Weave Exchange header flag bits.
WeaveExchangeVersion enum
The Weave Exchange header version.
WeaveMessageFlags{
  kWeaveMessageFlag_ReuseMessageId = 0x00000010,
  kWeaveMessageFlag_ReuseSourceId = 0x00000020,
  kWeaveMessageFlag_DelaySend = 0x00000040,
  kWeaveMessageFlag_RetainBuffer = 0x00000080,
  kWeaveMessageFlag_MessageEncoded = 0x00001000,
  kWeaveMessageFlag_DefaultMulticastSourceAddress = 0x00002000,
  kWeaveMessageFlag_PeerRequestedAck = 0x00004000,
  kWeaveMessageFlag_DuplicateMessage = 0x00008000,
  kWeaveMessageFlag_PeerGroupMsgIdNotSynchronized = 0x00010000,
  kWeaveMessageFlag_FromInitiator = 0x00020000,
  kWeaveMessageFlag_ViaEphemeralUDPPort = 0x00040000,
  kWeaveMessageFlag_MulticastFromLinkLocal = kWeaveMessageFlag_DefaultMulticastSourceAddress,
  kWeaveMessageFlag_DestNodeId = kWeaveHeaderFlag_DestNodeId,
  kWeaveMessageFlag_SourceNodeId = kWeaveHeaderFlag_SourceNodeId,
  kWeaveMessageFlag_TunneledData = kWeaveHeaderFlag_TunneledData,
  kWeaveMessageFlag_MsgCounterSyncReq = kWeaveHeaderFlag_MsgCounterSyncReq
}
enum
Flags associated with a inbound or outbound Weave message.
WeaveMessageVersion{
  kWeaveMessageVersion_Unspecified = 0,
  kWeaveMessageVersion_V1 = 1,
  kWeaveMessageVersion_V2 = 2
}
enum
The version of the Weave Message format.
WeaveSubnetId{
  kWeaveSubnetId_NotSpecified = 0,
  kWeaveSubnetId_PrimaryWiFi = 1,
  kWeaveSubnetId_ThreadAlarm = 2,
  kWeaveSubnetId_WiFiAP = 3,
  kWeaveSubnetId_MobileDevice = 4,
  kWeaveSubnetId_Service = 5,
  kWeaveSubnetId_ThreadMesh = 6
}
enum
Weave has some reserved subnet numbers for distinguished network interfaces on typical devices.
WeaveVendorId enum

Typedefs

FabricSecretRotationScheme typedef
uint8_t
FabricSecretScope nl::Weave::FabricSecretScope
uint8_t
Identifies the category of devices that can possess and use fabric secret.
WeaveAuthMode typedef
uint16_t
Identifies how a peer node is authenticated.
WeaveEncryptionKey typedef
WeaveEncryptionType typedef
enum nl::Weave::WeaveEncryptionType
The encryption types for the Weave message.
WeaveExchangeFlags typedef
enum nl::Weave::WeaveExchangeFlags
The Weave Exchange header flag bits.
WeaveExchangeVersion typedef
enum nl::Weave::WeaveExchangeVersion
The Weave Exchange header version.
WeaveMessageFlags typedef
enum nl::Weave::WeaveMessageFlags
Flags associated with a inbound or outbound Weave message.
WeaveMessageHeader typedef
WeaveMessageVersion typedef
enum nl::Weave::WeaveMessageVersion
The version of the Weave Message format.
WeaveSubnetId typedef
enum nl::Weave::WeaveSubnetId
Weave has some reserved subnet numbers for distinguished network interfaces on typical devices.

Variables

ExchangeMgr
NL_DLL_EXPORT WeaveExchangeManager
FabricState
NL_DLL_EXPORT WeaveFabricState
MessageLayer
NL_DLL_EXPORT WeaveMessageLayer
SecurityMgr
NL_DLL_EXPORT WeaveSecurityManager
WeaveConnection
class NL_DLL_EXPORT
WeaveExchangeManager
class NL_DLL_EXPORT
WeaveMessageLayer
class NL_DLL_EXPORT
gDefaultWRMPConfig = { WEAVE_CONFIG_WRMP_DEFAULT_INITIAL_RETRANS_TIMEOUT, WEAVE_CONFIG_WRMP_DEFAULT_ACTIVE_RETRANS_TIMEOUT, WEAVE_CONFIG_WRMP_DEFAULT_ACK_TIMEOUT, WEAVE_CONFIG_WRMP_DEFAULT_MAX_RETRANS }
const WRMPConfig
kWeaveMsgEncAppKeyDiversifier = { 0xB1, 0x1D, 0xAE, 0x5B }[]
const uint8_t
Key diversifier used for Weave message encryption key derivation.

Functions

AppGroupMasterKeyIdFromAuthMode(WeaveAuthMode authMode)
uint8_t
Returns the application group master key ID associated with the authentication mode.
CASEAuthMode(uint8_t certType)
WeaveAuthMode
Returns a corresponding CASE authentication mode for a given certificate type.
CertTypeFromAuthMode(WeaveAuthMode authMode)
uint8_t
Returns the password source for the given authentication mode.
DecodeHeaderField(const uint16_t headerField, WeaveMessageInfo *msgInfo)
void
DefaultOnMessageReceived(ExchangeContext *ec, const IPPacketInfo *pktInfo, const WeaveMessageInfo *msgInfo, uint32_t profileId, uint8_t msgType, PacketBuffer *payload)
void
EncodeHeaderField(const WeaveMessageInfo *msgInfo)
uint16_t
FindMessageName(uint32_t inProfileId, uint8_t inMsgType)
const char *
FindProfileName(uint32_t inProfileId)
const char *
FormatWeaveError(char *buf, uint16_t bufSize, int32_t err)
bool
Given a Weave error, returns a human-readable NULL-terminated C string describing the error.
GenerateWeaveNodeId(uint64_t & nodeId)
NL_DLL_EXPORT WEAVE_ERROR
Generate random Weave node Id.
GetFibonacciForIndex(uint32_t index)
uint32_t
This function generates 32-bit Fibonacci number for a given 32 bit index.
GetMessageName(uint32_t profileId, uint8_t msgType)
const char *
GetProfileName(uint32_t profileId)
const char *
GetRandU16(void)
uint16_t
This function generates 16-bit unsigned random number.
GetRandU32(void)
uint32_t
This function generates 32-bit unsigned random number.
GetRandU64(void)
uint64_t
This function generates 64-bit unsigned random number.
GetRandU8(void)
uint8_t
This function generates 8-bit unsigned random number.
GetVendorName(uint16_t vendorId)
const char *
GroupKeyAuthMode(uint32_t keyId)
WeaveAuthMode
Returns a corresponding group key authentication mode for a given key ID.
IPv6InterfaceIdToWeaveNodeId(uint64_t interfaceId)
uint64_t
Convert an IPv6 address interface identifier to a Weave node identifier.
IsCASEAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based on the Weave CASE protocol.
IsCertAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based on possession of a private key associated with a certificate.
IsGroupKeyAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based on possession of a shared group key.
IsPASEAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based on the Weave PASE protocol.
IsPasswordAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based possession of a shared password.
IsTAKEAuthMode(WeaveAuthMode authMode)
bool
True if the authentication mode is based on the Weave TAKE protocol.
IsWRMPControlMessage(uint32_t profileId, uint8_t msgType)
bool
J2N_ByteArray(JNIEnv *env, jbyteArray inArray, uint8_t *& outArray, uint32_t & outArrayLen)
J2N_ByteArrayFieldVal(JNIEnv *env, jobject obj, const char *fieldName, uint8_t *& outArray, uint32_t & outArrayLen)
J2N_ByteArrayInPlace(JNIEnv *env, jbyteArray inArray, uint8_t *outArray, uint32_t maxArrayLen)
J2N_EnumFieldVal(JNIEnv *env, jobject obj, const char *fieldName, const char *fieldType, int & outVal)
J2N_EnumVal(JNIEnv *env, jobject enumObj, int & outVal)
J2N_IntFieldVal(JNIEnv *env, jobject obj, const char *fieldName, jint & outVal)
J2N_LongFieldVal(JNIEnv *env, jobject obj, const char *fieldName, jlong & outVal)
J2N_ShortFieldVal(JNIEnv *env, jobject obj, const char *fieldName, jshort & outVal)
J2N_StringFieldVal(JNIEnv *env, jobject obj, const char *fieldName, char *& outVal)
MakeClassName(const char *basePackageName, const char *relativeClassName, char *& classNameBuf)
PASEAuthMode(uint8_t pwSource)
WeaveAuthMode
Returns a corresponding PASE authentication mode for a given password source.
PasswordSourceFromAuthMode(WeaveAuthMode authMode)
uint8_t
Returns the password source for the given authentication mode.
PrintTunnelInfo(const WeaveConnectionTunnel & tun, const TCPEndPoint & fromEndPoint, const TCPEndPoint & toEndPoint, const PacketBuffer & data)
void
ToHex(const uint8_t data)
char
ToHexString(const uint8_t *data, size_t dataLen, char *& outBuf, size_t & outBufSize)
void
WeaveEncryptionKeyToString(uint8_t encType, const WeaveEncryptionKey & key, char *buf, size_t bufSize)
void
WeaveFabricIdToIPv6GlobalId(uint64_t fabricId)
uint64_t
Convert a Weave fabric identifier to an IPv6 ULA global identifier.
WeaveMessageSourceToStr(char *buf, uint32_t bufSize, const WeaveMessageInfo *msgInfo)
void
WeaveNodeAddrToStr(char *buf, uint32_t bufSize, uint64_t nodeId, const IPAddress *addr, uint16_t port, WeaveConnection *con)
void
WeaveNodeIdToIPv6InterfaceId(uint64_t nodeId)
uint64_t
Convert a Weave node identifier to an IPv6 address interface identifier.
max(const _T & a, const _T & b)
const _T &
min(const _T & a, const _T & b)
const _T &

Classes

nl::Weave::Binding

Captures the intended target of a Weave communication and associated configuration information.

nl::Weave::Counter

An interface for managing a counter as an integer value.

nl::Weave::ExchangeContext

This class represents an ongoing conversation (ExchangeContext) between two or more nodes.

nl::Weave::FabricStateDelegate

This abstract delegate class communicates fabric state changes.

nl::Weave::HostPortList

For managing and manipulating a Host Port List, a compact, binary-encoded collection of host and port identifier tuples associated with the Weave Service Directory.

nl::Weave::JNIUtils
nl::Weave::MonotonicallyIncreasingCounter

A class for managing a monotonically-increasing counter as an integer value.

nl::Weave::PersistedCounter

A class for managing a counter as an integer value intended to persist across reboots.

nl::Weave::WeaveConnection

The definition of the Weave Connection class.

nl::Weave::WeaveConnectionTunnel

The definition of the WeaveConnectionTunnel class, which manages a pair of TCPEndPoints whose original WeaveConnections have been coupled, and between which the WeaveMessageLayer forwards all data and connection closures.

nl::Weave::WeaveEncryptionKey_AES128CTRSHA1
nl::Weave::WeaveExchangeHeader

This specifies the Weave profile and message type of a particular Weave message within an ExchangeContext.

nl::Weave::WeaveExchangeManager

This class is used to manage ExchangeContexts with other Weave nodes.

nl::Weave::WeaveFabricState

Forward declaration of WeaveFabricState.

nl::Weave::WeaveKeyId

The definition of the Weave Key identifier.

nl::Weave::WeaveMessageLayer

The definition of the WeaveMessageLayer class, which manages communication with other Weave nodes.

nl::Weave::WeaveMsgEncryptionKey

Contains information about Weave message encryption key.

nl::Weave::WeaveMsgEncryptionKeyCache

Key cache for Weave message encryption keys.

nl::Weave::WeaveSecurityManager
nl::Weave::WeaveServerBase

Common, base object for implementing Weave profile unsolicited responders (servers) that encapsulates validating authenticated requests and sending status reports and provides common data member storage for fabric state and an exchange manager.

nl::Weave::WeaveServerDelegateBase

A common base class for implementing Weave server delegate objects.

nl::Weave::WeaveSessionKey

Contains information about a Weave session key.

nl::Weave::WeaveSessionState

Conveys the communication state needed to send/receive messages with another node.

Structs

nl::Weave::JNILibraryMethod
nl::Weave::WRMPConfig

The WRMP configuration.

nl::Weave::WeaveMessageInfo

Information about a Weave message that is in the process of being sent or received.

Unions

nl::Weave::WeaveEncryptionKey

Namespaces

nl::Weave::ASN1

This namespace includes all interfaces within Weave for working with Abstract Syntax Notation One (ASN.1).

nl::Weave::Crypto

This namespace includes all interfaces within Weave for shared cryptographic support.

nl::Weave::DeviceLayer
nl::Weave::DeviceManager
nl::Weave::Encoding

This namespace provides functions for:

nl::Weave::Logging

This namespace includes all interfaces within Weave for shared logging support.

nl::Weave::Platform
nl::Weave::Profiles

This namespace includes all interfaces within Weave for Weave profiles, both Common and Nest Labs vendor-specific.

nl::Weave::SecuritySupport
nl::Weave::Stats
nl::Weave::Support
nl::Weave::System
nl::Weave::TLV

Definitions for working with data encoded in Weave TLV format.

nl::Weave::Warm

This namespace includes interfaces for the Weave Address and Routing Module, a portable Module for configuring Weave IP addresses and Routes.

Enumerations

@21

 @21
Properties
kFlagAckPending

If a response is expected for a message that is being sent.

kFlagAutoReleaseConnection

Automatically release the message encryption key when the exchange context is freed.

kFlagAutoReleaseKey

When set, signifies that at least one message has been received from peer on this exchange context.

kFlagAutoRequestAck

This context was associated with a WeaveConnection.

kFlagConnectionClosed

This context is the initiator of the exchange.

kFlagDropAck

When set, automatically request an acknowledgment whenever a message is sent via UDP.

kFlagMsgRcvdFromPeer

When set, signifies that at least one message received on this exchange requested an acknowledgment.

This flag is read by the application to decide if it needs to request an acknowledgment for the response message it is about to send. This flag can also indicate whether peer is using WRMP.

kFlagPeerRequestedAck

When set, signifies that there is an acknowledgment pending to be sent back.

kFlagResponseExpected

Internal and debug only: when set, the exchange layer does not send an acknowledgment.

kFlagUseEphemeralUDPPort

Automatically release the associated WeaveConnection when the exchange context is freed.

@36

 @36

@37

 @37

@38

 @38
Properties
kFabricIdDefaultForTest

Default fabric ID, which should only be used for testing purposes.

@39

 @39

Identifies the purpose or application of certificate.

A certificate type is a label that describes a certificate's purpose or application. Certificate types are not carried as attributes of the corresponding certificates, but rather are derived from the certificate's structure and/or the context in which it is used. The certificate type enumeration includes a set of pre-defined values describing commonly used certificate applications. Developers can also extend the certificate type value range with application-specific types that described custom certificates or certificates with unique security properties.

Certificate types are primarily used in the implementation of access control policies, where access to application features is influenced by the type of certificate presented by a requester.

Properties
kCertType_AccessToken

A Weave access token certificate.

kCertType_AppDefinedBase

Application-specific certificate types should have values >= this value.

kCertType_CA

A CA certificate.

kCertType_Device

A Weave device certificate.

kCertType_FirmwareSigning

A Weave firmware signing certificate.

kCertType_General

The certificate is of a general or non-specific type.

kCertType_Max

Certificate types should not be greater than this value.

kCertType_NotSpecified

The certificate's type has not been specified.

kCertType_ServiceEndpoint

A Weave service endpoint certificate.

@40

 @40

Identifies the source for the password used in a password-based authentication protocol (e.g.

Weave PASE)

@41

 @41
Properties
kWeaveAuthModeCategory_AppDefinedBase

Base value for application-defined authentication categories.

kWeaveAuthModeCategory_CASE

Peer authenticated using Weave CASE protocol.

kWeaveAuthModeCategory_General

Peer authenticated using one of a set of general mechanisms.

kWeaveAuthModeCategory_GroupKey

Peer authenticated using a shared group key.

kWeaveAuthModeCategory_PASE

Peer authenticated using Weave PASE protocol.

kWeaveAuthModeCategory_TAKE

Peer authenticated using Weave TAKE protocol.

kWeaveAuthMode_CASE_AccessToken

Peer authenticated using CASE with Weave access token certificate.

kWeaveAuthMode_CASE_AnyCert

Peer authenticated using CASE with arbitrary certificate, or certificate of unknown type.

kWeaveAuthMode_CASE_Device

Peer authenticated using CASE with Weave device certificate.

kWeaveAuthMode_CASE_GeneralCert

Peer authenticated using CASE with a general, or non-specific certificate type.

kWeaveAuthMode_CASE_ServiceEndPoint

Peer authenticated using CASE with Weave service endpoint certificate.

kWeaveAuthMode_NotSpecified

Authentication mode not specified.

kWeaveAuthMode_PASE_PairingCode

Peer authenticated using PASE with device pairing code.

kWeaveAuthMode_TAKE_IdentificationKey

Peer authenticated using TAKE with a token identification key.

kWeaveAuthMode_Unauthenticated

Peer not authenticated.

@42

 @42
Properties
kFabricSecretScope_All

All devices can possess corresponding fabric secret.

@43

 @43
Properties
kTestKey_AES128CTRSHA1_DataKeyByte

Byte value that constructs encryption key, which is used only for testing.

kTestKey_AES128CTRSHA1_IntegrityKeyByte

Byte value that constructs integrity key, which is used only for testing.

@44

 @44

Weave message encryption application key diversifier size.

@45

 @45

@53

 @53

@54

 @54
Properties
kWeavePeerDescription_MaxLength

Maximum length of string (including NUL character) returned by WeaveMessageLayer::GetPeerDescription().

@55

 @55

Definitions pertaining to the header of an encoded Weave message.

Properties
kWeaveHeaderFlag_DestNodeId

Indicates that the destination node ID is present in the Weave message header.

kWeaveHeaderFlag_MsgCounterSyncReq

Indicates that the sender requests message counter synchronization.

kWeaveHeaderFlag_SourceNodeId

Indicates that the source node ID is present in the Weave message header.

kWeaveHeaderFlag_TunneledData

Indicates that the Weave message payload is a tunneled IP packet.

@56

 @56

Bit field definitions for IEEE EUI-64 Identifiers.

Properties
kEUI64_IG_Group

Individual/Group bit value indicating an group address EUI-64 identifier.

kEUI64_IG_Individual

Individual/Group bit value indicating an individual address EUI-64 identifier.

kEUI64_IG_Mask

Bitmask for the Individual/Group (I/G) bit within an EUI-64 identifier.

A value of 0 indicates the id is an individual address. A value of 1 indicates the id is a group address.

kEUI64_UL_Local

Universal/Local bit value indicating a Locally administered EUI-64 identifier.

kEUI64_UL_Mask

Bitmask for the Universal/Local (U/L) bit within an EUI-64 identifier.

A value of 0 indicates the id is Universally (globally) administered. A value of 1 indicates the id is Locally administered.

kEUI64_UL_Unversal

Universal/Local bit value indicating a Universally administered EUI-64 identifier.

@57

 @57

Special ranges of Weave Node Ids.

Properties
kMaxAlwaysLocalWeaveNodeId

Weave node identifiers less or equal than this value are considered local for testing convenience.

WeaveEncryptionType

 WeaveEncryptionType

The encryption types for the Weave message.

Properties
kWeaveEncryptionType_AES128CTRSHA1

Message encrypted using AES-128-CTR encryption with HMAC-SHA-1 message integrity.

kWeaveEncryptionType_None

Message not encrypted.

WeaveExchangeFlags

 WeaveExchangeFlags

The Weave Exchange header flag bits.

Properties
kWeaveExchangeFlag_AckId

Set when current message is an acknowledgment for a previously received message.

kWeaveExchangeFlag_Initiator

Set when current message is sent by the initiator of an exchange.

kWeaveExchangeFlag_NeedsAck

Set when current message is requesting an acknowledgment from the recipient.

WeaveExchangeVersion

 WeaveExchangeVersion

The Weave Exchange header version.

WeaveMessageFlags

 WeaveMessageFlags

Flags associated with a inbound or outbound Weave message.

The values defined here are for use within the WeaveMessageInfo.Flags field.

Properties
kWeaveMessageFlag_DefaultMulticastSourceAddress

Indicates that default IPv6 source address selection should be used when sending IPv6 multicast messages.

kWeaveMessageFlag_DelaySend

Indicates that the sending of the message needs to be delayed.

kWeaveMessageFlag_DestNodeId

Indicates that the destination node ID is present in the Weave message header.

kWeaveMessageFlag_DuplicateMessage

Indicates that the message is a duplicate of a previously received message.

kWeaveMessageFlag_FromInitiator

Indicates that the source of the message is the initiator of the Weave exchange.

kWeaveMessageFlag_MessageEncoded

Indicates that the Weave message is already encoded.

kWeaveMessageFlag_MsgCounterSyncReq

Indicates that the sender requests peer's message counter synchronization.

kWeaveMessageFlag_MulticastFromLinkLocal

Deprecated alias for kWeaveMessageFlag_DefaultMulticastSourceAddress.

kWeaveMessageFlag_PeerGroupMsgIdNotSynchronized

Indicates that the peer's group key message counter is not synchronized.

kWeaveMessageFlag_PeerRequestedAck

Indicates that the sender of the message requested an acknowledgment.

kWeaveMessageFlag_RetainBuffer

Indicates that the message buffer should not be freed after sending.

kWeaveMessageFlag_ReuseMessageId

Indicates that the existing message identifier must be reused.

kWeaveMessageFlag_ReuseSourceId

Indicates that the existing source node identifier must be reused.

kWeaveMessageFlag_SourceNodeId

Indicates that the source node ID is present in the Weave message header.

kWeaveMessageFlag_TunneledData

Indicates that the Weave message payload is a tunneled IP packet.

kWeaveMessageFlag_ViaEphemeralUDPPort

Indicates that message is being sent/received via the local ephemeral UDP port.

WeaveMessageVersion

 WeaveMessageVersion

The version of the Weave Message format.

Weave will choose the appropriate message version based on the frame format required for the Weave message. By default, the message version is kWeaveMessageVersion_V1. When using Weave Reliable Messaging, for example, the version is kWeaveMessageVersion_V2.

Properties
kWeaveMessageVersion_Unspecified

Unspecified message version.

kWeaveMessageVersion_V1

Message header format version V1.

kWeaveMessageVersion_V2

Message header format version V2.

WeaveSubnetId

 WeaveSubnetId

Weave has some reserved subnet numbers for distinguished network interfaces on typical devices.

These numbers are assigned here to symbolic constants. These subnet numbers are used by Weave to configure IPv6 ULA addresses on appropriate interfaces.

Properties
kWeaveSubnetId_MobileDevice

The subnet identifier for all Mobile devices.

kWeaveSubnetId_NotSpecified

Reserved as an unspecified or null value.

kWeaveSubnetId_PrimaryWiFi

The WiFi radio interface subnet number.

kWeaveSubnetId_Service

The subnet identifier for the Nest Service endpoints.

kWeaveSubnetId_ThreadAlarm

The Thread alarm radio interface subnet number.

kWeaveSubnetId_ThreadMesh

The Thread mesh radio interface subnet identifier.

kWeaveSubnetId_WiFiAP

The Local Wi-Fi AP interface subnet number.

WeaveVendorId

 WeaveVendorId

Typedefs

FabricSecretRotationScheme

uint8_t FabricSecretRotationScheme

FabricSecretScope

uint8_t FabricSecretScope

Identifies the category of devices that can possess and use fabric secret.

WeaveAuthMode

uint16_t WeaveAuthMode

Identifies how a peer node is authenticated.

WeaveAuthMode describes the means by which a peer node has been, or should be, authenticated during a Weave message exchange. In an initiating context, applications use WeaveAuthMode to express a desired peer authentication mode for an exchange, thereby instructing the Weave security and messaging layers to achieve the desired mode or fail the communication. In a responding context, WeaveAuthMode identifies how the requesting node (the peer) was authenticated, allowing the responding application to enforce access controls based on this information.

The WeaveAuthMode assigned to an incoming Weave message is related to the nature of the key that was used to encrypt that message. The WeaveAuthMode derives from the mechanism by which the key was established and the criteria used to verify the identities of the communicating parties at the time of key establishment.

WeaveAuthMode includes a set of pre-defined values describing common authentication modes. These are broken down by the key agreement mechanism (CASE, PASE, GroupKey, etc.). Developers can extend WeaveAuthMode by defining application-specific modes, which they can attach to specific encryption keys.

WeaveEncryptionKey

union nl::Weave::WeaveEncryptionKey WeaveEncryptionKey

WeaveEncryptionType

enum nl::Weave::WeaveEncryptionType WeaveEncryptionType

The encryption types for the Weave message.

WeaveExchangeFlags

enum nl::Weave::WeaveExchangeFlags WeaveExchangeFlags

The Weave Exchange header flag bits.

WeaveExchangeVersion

enum nl::Weave::WeaveExchangeVersion WeaveExchangeVersion

The Weave Exchange header version.

WeaveMessageFlags

enum nl::Weave::WeaveMessageFlags WeaveMessageFlags

Flags associated with a inbound or outbound Weave message.

The values defined here are for use within the WeaveMessageInfo.Flags field.

WeaveMessageHeader

struct WeaveMessageInfo WeaveMessageHeader

WeaveMessageVersion

enum nl::Weave::WeaveMessageVersion WeaveMessageVersion

The version of the Weave Message format.

Weave will choose the appropriate message version based on the frame format required for the Weave message. By default, the message version is kWeaveMessageVersion_V1. When using Weave Reliable Messaging, for example, the version is kWeaveMessageVersion_V2.

WeaveSubnetId

enum nl::Weave::WeaveSubnetId WeaveSubnetId

Weave has some reserved subnet numbers for distinguished network interfaces on typical devices.

These numbers are assigned here to symbolic constants. These subnet numbers are used by Weave to configure IPv6 ULA addresses on appropriate interfaces.

Variables

ExchangeMgr

NL_DLL_EXPORT WeaveExchangeManager ExchangeMgr

FabricState

NL_DLL_EXPORT WeaveFabricState FabricState

MessageLayer

NL_DLL_EXPORT WeaveMessageLayer MessageLayer

SecurityMgr

NL_DLL_EXPORT WeaveSecurityManager SecurityMgr

WeaveConnection

class NL_DLL_EXPORT WeaveConnection

WeaveExchangeManager

class NL_DLL_EXPORT WeaveExchangeManager

WeaveMessageLayer

class NL_DLL_EXPORT WeaveMessageLayer

gDefaultWRMPConfig

const WRMPConfig gDefaultWRMPConfig = { WEAVE_CONFIG_WRMP_DEFAULT_INITIAL_RETRANS_TIMEOUT,
                                        WEAVE_CONFIG_WRMP_DEFAULT_ACTIVE_RETRANS_TIMEOUT,
                                        WEAVE_CONFIG_WRMP_DEFAULT_ACK_TIMEOUT,
                                        WEAVE_CONFIG_WRMP_DEFAULT_MAX_RETRANS }

kWeaveMsgEncAppKeyDiversifier

const uint8_t kWeaveMsgEncAppKeyDiversifier[] = { 0xB1, 0x1D, 0xAE, 0x5B }

Key diversifier used for Weave message encryption key derivation.

This value represents first 4 bytes of the SHA-1 HASH of "Nest Weave Message EK and AK" phrase.

Functions

AppGroupMasterKeyIdFromAuthMode

uint8_t AppGroupMasterKeyIdFromAuthMode(
  WeaveAuthMode authMode
)

Returns the application group master key ID associated with the authentication mode.

CASEAuthMode

WeaveAuthMode CASEAuthMode(
  uint8_t certType
)

Returns a corresponding CASE authentication mode for a given certificate type.

CertTypeFromAuthMode

uint8_t CertTypeFromAuthMode(
  WeaveAuthMode authMode
)

Returns the password source for the given authentication mode.

DecodeHeaderField

void DecodeHeaderField(
  const uint16_t headerField,
  WeaveMessageInfo *msgInfo
)

DefaultOnMessageReceived

void DefaultOnMessageReceived(
  ExchangeContext *ec,
  const IPPacketInfo *pktInfo,
  const WeaveMessageInfo *msgInfo,
  uint32_t profileId,
  uint8_t msgType,
  PacketBuffer *payload
)

EncodeHeaderField

uint16_t EncodeHeaderField(
  const WeaveMessageInfo *msgInfo
)

FindMessageName

const char * FindMessageName(
  uint32_t inProfileId,
  uint8_t inMsgType
)

FindProfileName

const char * FindProfileName(
  uint32_t inProfileId
)

FormatWeaveError

bool FormatWeaveError(
  char *buf,
  uint16_t bufSize,
  int32_t err
)

Given a Weave error, returns a human-readable NULL-terminated C string describing the error.

Details
Parameters
[in] buf
Buffer into which the error string will be placed.
[in] bufSize
Size of the supplied buffer in bytes.
[in] err
The error to be described.
Returns
true If a description string was written into the supplied buffer.
Returns
false If the supplied error was not a Weave error.

GenerateWeaveNodeId

NL_DLL_EXPORT WEAVE_ERROR GenerateWeaveNodeId(
  uint64_t & nodeId
)

Generate random Weave node Id.

This function generates 64-bit locally unique Weave node Id. This function uses cryptographically strong random data source to guarantee uniqueness of generated value. Note that bit 57 of the generated Weave node Id is set to 1 to indicate that generated Weave node Id is locally (not globally) unique.

Details
Parameters
nodeId
A reference to the 64-bit Weave node Id.
Return Values
WEAVE_NO_ERROR
If Weave node Id was successfully generated.

GetFibonacciForIndex

uint32_t GetFibonacciForIndex(
  uint32_t index
)

This function generates 32-bit Fibonacci number for a given 32 bit index.

Details
Returns
32-bit unsigned fibonacci number.

GetMessageName

const char * GetMessageName(
  uint32_t profileId,
  uint8_t msgType
)

GetProfileName

const char * GetProfileName(
  uint32_t profileId
)

GetRandU16

uint16_t GetRandU16(
  void
)

This function generates 16-bit unsigned random number.

Details
Returns
16-bit unsigned random integer.

GetRandU32

uint32_t GetRandU32(
  void
)

This function generates 32-bit unsigned random number.

Details
Returns
32-bit unsigned random integer.

GetRandU64

uint64_t GetRandU64(
  void
)

This function generates 64-bit unsigned random number.

Details
Returns
64-bit unsigned random integer.

GetRandU8

uint8_t GetRandU8(
  void
)

This function generates 8-bit unsigned random number.

Details
Returns
8-bit unsigned random integer.

GetVendorName

const char * GetVendorName(
  uint16_t vendorId
)

GroupKeyAuthMode

WeaveAuthMode GroupKeyAuthMode(
  uint32_t keyId
)

Returns a corresponding group key authentication mode for a given key ID.

IPv6InterfaceIdToWeaveNodeId

uint64_t IPv6InterfaceIdToWeaveNodeId(
  uint64_t interfaceId
)

Convert an IPv6 address interface identifier to a Weave node identifier.

As a convenience to testing, node identifiers less or equal than #kMaxAlwaysLocalWeaveNodeId (65535) are considered 'local', and have their universal/local bit is set to zero. This simplifies the string representation of the corresponding IPv6 addresses. For example a ULA for node identifier 10 would be FD00:0:1:1::A.

Details
Parameters
[in] interfaceId
The 64 bit interface identifier.
Returns
the mapped 64 bit Weave node identifier.

IsCASEAuthMode

bool IsCASEAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based on the Weave CASE protocol.

IsCertAuthMode

bool IsCertAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based on possession of a private key associated with a certificate.

IsGroupKeyAuthMode

bool IsGroupKeyAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based on possession of a shared group key.

IsPASEAuthMode

bool IsPASEAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based on the Weave PASE protocol.

IsPasswordAuthMode

bool IsPasswordAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based possession of a shared password.

IsTAKEAuthMode

bool IsTAKEAuthMode(
  WeaveAuthMode authMode
)

True if the authentication mode is based on the Weave TAKE protocol.

IsWRMPControlMessage

bool IsWRMPControlMessage(
  uint32_t profileId,
  uint8_t msgType
)

J2N_ByteArray

WEAVE_ERROR J2N_ByteArray(
  JNIEnv *env,
  jbyteArray inArray,
  uint8_t *& outArray,
  uint32_t & outArrayLen
)

J2N_ByteArrayFieldVal

WEAVE_ERROR J2N_ByteArrayFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  uint8_t *& outArray,
  uint32_t & outArrayLen
)

J2N_ByteArrayInPlace

WEAVE_ERROR J2N_ByteArrayInPlace(
  JNIEnv *env,
  jbyteArray inArray,
  uint8_t *outArray,
  uint32_t maxArrayLen
)

J2N_EnumFieldVal

WEAVE_ERROR J2N_EnumFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  const char *fieldType,
  int & outVal
)

J2N_EnumVal

WEAVE_ERROR J2N_EnumVal(
  JNIEnv *env,
  jobject enumObj,
  int & outVal
)

J2N_IntFieldVal

WEAVE_ERROR J2N_IntFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  jint & outVal
)

J2N_LongFieldVal

WEAVE_ERROR J2N_LongFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  jlong & outVal
)

J2N_ShortFieldVal

WEAVE_ERROR J2N_ShortFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  jshort & outVal
)

J2N_StringFieldVal

WEAVE_ERROR J2N_StringFieldVal(
  JNIEnv *env,
  jobject obj,
  const char *fieldName,
  char *& outVal
)

MakeClassName

WEAVE_ERROR MakeClassName(
  const char *basePackageName,
  const char *relativeClassName,
  char *& classNameBuf
)

PASEAuthMode

WeaveAuthMode PASEAuthMode(
  uint8_t pwSource
)

Returns a corresponding PASE authentication mode for a given password source.

PasswordSourceFromAuthMode

uint8_t PasswordSourceFromAuthMode(
  WeaveAuthMode authMode
)

Returns the password source for the given authentication mode.

PrintTunnelInfo

void PrintTunnelInfo(
  const WeaveConnectionTunnel & tun,
  const TCPEndPoint & fromEndPoint,
  const TCPEndPoint & toEndPoint,
  const PacketBuffer & data
)

ToHex

char ToHex(
  const uint8_t data
)

ToHexString

void ToHexString(
  const uint8_t *data,
  size_t dataLen,
  char *& outBuf,
  size_t & outBufSize
)

WeaveEncryptionKeyToString

void WeaveEncryptionKeyToString(
  uint8_t encType,
  const WeaveEncryptionKey & key,
  char *buf,
  size_t bufSize
)

WeaveFabricIdToIPv6GlobalId

uint64_t WeaveFabricIdToIPv6GlobalId(
  uint64_t fabricId
)

Convert a Weave fabric identifier to an IPv6 ULA global identifier.

The ULA global identifier for a fabric address is the lower 40 bits of the fabric's 64-bit fabric ID.

Details
Parameters
[in] fabricId
The Weave fabric identifier.
Returns
the mapped IPv6 global identifier.

WeaveMessageSourceToStr

void WeaveMessageSourceToStr(
  char *buf,
  uint32_t bufSize,
  const WeaveMessageInfo *msgInfo
)

DEPRECATED Use WeaveMessageLayer::GetPeerDescription() instead.

WeaveNodeAddrToStr

void WeaveNodeAddrToStr(
  char *buf,
  uint32_t bufSize,
  uint64_t nodeId,
  const IPAddress *addr,
  uint16_t port,
  WeaveConnection *con
)

DEPRECATED Use WeaveMessageLayer::GetPeerDescription() instead.

WeaveNodeIdToIPv6InterfaceId

uint64_t WeaveNodeIdToIPv6InterfaceId(
  uint64_t nodeId
)

Convert a Weave node identifier to an IPv6 address interface identifier.

Weave node identifiers are Universal/Local EUI-64s, which per RFC-3513 are converted to interface identifiers by inverting the universal/local bit (bit 57 counting the LSB as 0).

As a convenience to testing, node identifiers less or equal than #kMaxAlwaysLocalWeaveNodeId (65535) are considered 'local', and have their universal/local bit is set to zero. This simplifies the string representation of the corresponding IPv6 addresses. For example a ULA for node identifier 10 would be FD00:0:1:1::A.

Details
Parameters
[in] nodeId
The 64-bit Weave node identifier.
Returns
the IPv6 interface identifier.

max

const _T & max(
  const _T & a,
  const _T & b
)

min

const _T & min(
  const _T & a,
  const _T & b
)