nl:: Weave:: Binding:: Configuration
#include <src/lib/core/WeaveBinding.h>
Provides a declarative-style interface for configuring and preparing a Binding object.
Summary
When configuring a Binding, applications must call at least one method from each of the following configuration groups: Target, Transport, and Security. Other methods may be called as needed to override default behavior.
If mutually exclusive configurations are invoked (e.g., Transport_TCP() followed by Transport_UDP()), the last one to be called wins.
Public functions |
|
---|---|
ConfigureFromMessage(const WeaveMessageInfo *aMsgInfo, const Inet::IPPacketInfo *aPacketInfo)
|
Configure the binding to allow communication with the sender of a received message.
|
DNS_Options(uint8_t dnsOptions)
|
When resolving the host name of the peer, use the specified DNS options.
|
Exchange_ResponseTimeoutMsec(uint32_t aResponseTimeoutMsec)
|
Set default response timeout for exchange contexts created from this Binding object.
|
GetError(void) const
|
Return any error that has occurred while configuring the Binding.
|
PrepareBinding(void)
|
Being the process of preparing the Binding for communication with the peer.
|
Security_AppGroupKey(uint32_t aAppGroupGlobalId, uint32_t aRootKeyId, bool aUseRotatingKey)
|
When communicating with the peer, send and receive messages encrypted for a specified Weave Application Group.
|
Security_AuthenticationMode(WeaveAuthMode aAuthMode)
|
Set the requested authentication mode to be used to authenticate the peer.
|
Security_CASESession(void)
|
When communicating with the peer, send and receive messages encrypted using a CASE session key established with the peer node.
|
Security_EncryptionType(uint8_t aEncType)
|
When communicating with the peer, send and receive messages encrypted using the specified message encryption type.
|
Security_Key(uint32_t aKeyId)
|
When communicating with the peer, send and receive messages encrypted using a specified key.
|
Security_None(void)
|
When communicating with the peer, send and receive unencrypted (i.e.
|
Security_PASESession(uint8_t aPasswordSource)
|
When communicating with the peer, send and receive messages encrypted using a PASE session key established with the peer node.
|
Security_SharedCASESession(void)
|
When communicating with the peer, send and receive messages encrypted using a shared CASE session key established with the Nest core router.
|
Security_SharedCASESession(uint64_t aRouterNodeId)
|
When communicating with the peer, send and receive messages encrypted using a shared CASE session key established with a specified router node.
|
Security_TAKESession()
|
When communicating with the peer, send and receive messages encrypted using a TAKE session key established with the peer node.
|
TargetAddress_IP(nl::Inet::IPAddress aPeerAddress, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
When communicating with the peer, use the specific IP address, port and network interface.
|
TargetAddress_IP(const char *aHostName, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
When communicating with the peer, use the specific host name, port and network interface.
|
TargetAddress_IP(const char *aHostName, size_t aHostNameLen, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
When communicating with the peer, use the specific host name, port and network interface.
|
TargetAddress_WeaveFabric(uint16_t aSubnetId)
|
When communicating with the peer, use a Weave fabric address derived from the peer's node id and a specified subnet.
|
TargetAddress_WeaveService(void)
|
When communicating with the peer, use a Weave service fabric address derived from the peer's node id.
|
Target_NodeId(uint64_t aPeerNodeId)
|
Configure the binding to communicate with a specific Weave node id.
|
Target_ServiceEndpoint(uint64_t aPeerNodeId)
|
Configure the binding to communicate with a specific Weave service endpoint.
|
Transport_DefaultWRMPConfig(const WRMPConfig & aWRMPConfig)
|
Set the default WRMP configuration for exchange contexts created from this Binding object.
|
Transport_ExistingConnection(WeaveConnection *apConnection)
|
Use an existing Weave connection to communicate with the peer.
|
Transport_TCP(void)
|
Use TCP to communicate with the peer.
|
Transport_UDP(void)
|
Use UDP to communicate with the peer.
|
Transport_UDP_PathMTU(uint32_t aPathMTU)
|
Set the expected path MTU for UDP packets travelling to the peer.
|
Transport_UDP_WRM(void)
|
Use the Weave Reliable Messaging protocol when communicating with the peer.
|
Public functions
ConfigureFromMessage
Configuration & ConfigureFromMessage( const WeaveMessageInfo *aMsgInfo, const Inet::IPPacketInfo *aPacketInfo )
Configure the binding to allow communication with the sender of a received message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
DNS_Options
Configuration & DNS_Options( uint8_t dnsOptions )
When resolving the host name of the peer, use the specified DNS options.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Exchange_ResponseTimeoutMsec
Configuration & Exchange_ResponseTimeoutMsec( uint32_t aResponseTimeoutMsec )
Set default response timeout for exchange contexts created from this Binding object.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
GetError
WEAVE_ERROR GetError( void ) const
Return any error that has occurred while configuring the Binding.
PrepareBinding
WEAVE_ERROR PrepareBinding( void )
Being the process of preparing the Binding for communication with the peer.
Security_AppGroupKey
Configuration & Security_AppGroupKey( uint32_t aAppGroupGlobalId, uint32_t aRootKeyId, bool aUseRotatingKey )
When communicating with the peer, send and receive messages encrypted for a specified Weave Application Group.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A reference to the Binding object.
|
Security_AuthenticationMode
Configuration & Security_AuthenticationMode( WeaveAuthMode aAuthMode )
Set the requested authentication mode to be used to authenticate the peer.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the Binding object.
|
Security_CASESession
Configuration & Security_CASESession( void )
When communicating with the peer, send and receive messages encrypted using a CASE session key established with the peer node.
If the necessary session is not available, it will be established automatically as part of preparing the binding.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Security_EncryptionType
Configuration & Security_EncryptionType( uint8_t aEncType )
When communicating with the peer, send and receive messages encrypted using the specified message encryption type.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the Binding object.
|
Security_Key
Configuration & Security_Key( uint32_t aKeyId )
When communicating with the peer, send and receive messages encrypted using a specified key.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the Binding object.
|
Security_None
Configuration & Security_None( void )
When communicating with the peer, send and receive unencrypted (i.e.
unsecured) messages.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Security_PASESession
Configuration & Security_PASESession( uint8_t aPasswordSource )
When communicating with the peer, send and receive messages encrypted using a PASE session key established with the peer node.
If the necessary session is not available, it will be established automatically as part of preparing the binding.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Security_SharedCASESession
Configuration & Security_SharedCASESession( void )
When communicating with the peer, send and receive messages encrypted using a shared CASE session key established with the Nest core router.
If the necessary session is not available, it will be established automatically as part of preparing the binding.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Security_SharedCASESession
Configuration & Security_SharedCASESession( uint64_t aRouterNodeId )
When communicating with the peer, send and receive messages encrypted using a shared CASE session key established with a specified router node.
If the necessary session is not available, it will be established automatically as part of preparing the binding.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Security_TAKESession
Configuration & Security_TAKESession()
When communicating with the peer, send and receive messages encrypted using a TAKE session key established with the peer node.
If the necessary session is not available, it will be established automatically as part of preparing the binding.
Details | |
---|---|
Returns |
A reference to the binding object.
|
TargetAddress_IP
Configuration & TargetAddress_IP( nl::Inet::IPAddress aPeerAddress, uint16_t aPeerPort, InterfaceId aInterfaceId )
When communicating with the peer, use the specific IP address, port and network interface.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A reference to the binding object.
|
TargetAddress_IP
Configuration & TargetAddress_IP( const char *aHostName, uint16_t aPeerPort, InterfaceId aInterfaceId )
When communicating with the peer, use the specific host name, port and network interface.
NOTE: The caller must ensure that the supplied host name string remains valid until the binding preparation phase completes.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A reference to the binding object.
|
TargetAddress_IP
Configuration & TargetAddress_IP( const char *aHostName, size_t aHostNameLen, uint16_t aPeerPort, InterfaceId aInterfaceId )
When communicating with the peer, use the specific host name, port and network interface.
NOTE: The caller must ensure that the supplied host name string remains valid until the binding preparation phase completes.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
A reference to the binding object.
|
TargetAddress_WeaveFabric
Configuration & TargetAddress_WeaveFabric( uint16_t aSubnetId )
When communicating with the peer, use a Weave fabric address derived from the peer's node id and a specified subnet.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
TargetAddress_WeaveService
Configuration & TargetAddress_WeaveService( void )
When communicating with the peer, use a Weave service fabric address derived from the peer's node id.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Target_NodeId
Configuration & Target_NodeId( uint64_t aPeerNodeId )
Configure the binding to communicate with a specific Weave node id.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Target_ServiceEndpoint
Configuration & Target_ServiceEndpoint( uint64_t aPeerNodeId )
Configure the binding to communicate with a specific Weave service endpoint.
If not otherwise configured, the peer address is set to the Weave fabric address of the service endpoint.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Transport_DefaultWRMPConfig
Configuration & Transport_DefaultWRMPConfig( const WRMPConfig & aWRMPConfig )
Set the default WRMP configuration for exchange contexts created from this Binding object.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Transport_ExistingConnection
Configuration & Transport_ExistingConnection( WeaveConnection *apConnection )
Use an existing Weave connection to communicate with the peer.
NOTE: The reference count on the connection object is incremented when binding preparation succeeds. Thus the application is responsible for ensuring the connection object remain alive until that time.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Transport_TCP
Configuration & Transport_TCP( void )
Use TCP to communicate with the peer.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Transport_UDP
Configuration & Transport_UDP( void )
Use UDP to communicate with the peer.
Details | |
---|---|
Returns |
A reference to the binding object.
|
Transport_UDP_PathMTU
Configuration & Transport_UDP_PathMTU( uint32_t aPathMTU )
Set the expected path MTU for UDP packets travelling to the peer.
For some Weave protocols this will be used to dynamically adjust the Weave message payload size.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A reference to the binding object.
|
Transport_UDP_WRM
Configuration & Transport_UDP_WRM( void )
Use the Weave Reliable Messaging protocol when communicating with the peer.
Details | |
---|---|
Returns |
A reference to the binding object.
|