class WeaveTunnelConnectionMgr

Defined at line 80 of file gen/third_party/openweave-core/src/include/Weave/Profiles/weave-tunneling/WeaveTunnelConnectionMgr.h

This class encapsulates all the Weave tunnel connection states

and the associated management logic and functions. An instance

of this class would be used to manage the tunnel over each

interface through which the Weave tunnel to the Service would

exist.

Public Members

ConnectPolicyCallback mServiceConnDelayPolicyCallback

Public Methods

void WeaveTunnelConnectionMgr ()
WEAVE_ERROR Init (WeaveTunnelAgent * tunAgent, TunnelType tunType, SrcInterfaceType srcIntfType, const char * connIntfName)

Initialize the WeaveTunnelConnectionMgr.

void Shutdown ()

Shutdown the WeaveTunnelConnectionMgr.

WEAVE_ERROR ConfigureConnTimeout (uint16_t maxTimeoutSecs)

Configure the TCP user timeout.

void ConfigureTunnelLivenessInterval (uint16_t livenessIntervalSecs)

Configure the Tunnel Liveness interval.

void SetInterfaceName (const char * intfName)

Set InterfaceName for Tunnel connection.

void SetInterfaceType (const SrcInterfaceType srcIntfType)

Set SrcInterfaceType for Tunnel connection.

void ServiceMgrStatusHandler (void * appState, WEAVE_ERROR err, StatusReport * report)

Handler invoked if the Service Manager failed to establish the TCP connection to the Service.

void HandleServiceConnectionComplete (WeaveConnection * con, WEAVE_ERROR conErr)

Handler invoked when Service TCP connection is completed. The device proceeds to initiate Tunnel control

commands to the Service from this function.

void HandleServiceConnectionClosed (WeaveConnection * con, WEAVE_ERROR conErr)

Handler invoked when Service TCP connection is closed. The device tries to re-establish the connection to

the Service if the mServiceConKeepAlive is set to true.

void RecvdFromService (WeaveConnection * con, const WeaveMessageInfo * msgInfo, PacketBuffer * message)

Handler to receive tunneled IPv6 packets from the Service TCP connection and forward to the Tunnel

EndPoint interface after decapsulating the raw IPv6 packet from inside the tunnel header.

void DefaultReconnectPolicyCallback (void *const appstate, ReconnectParam & reconnectParam, uint32_t & delayMsec)
WEAVE_ERROR TryConnectingNow ()

Attempt to establish a connection to the Service.

void ServiceTunnelClose (WEAVE_ERROR err)

Close the Service tunnel.

void StopAndReconnectTunnelConn (ReconnectParam & reconnParam)

Stop Service tunnel connection and attempt to reconnect again.

nl::Weave::WeaveConnection * GetTunnelConnection ()

Get a pointer to the Weave Tunnel Connection object for this

Tunnel Connection Manager.

Enumerations

enum TunnelConnectionState
Name Value Comments
kState_NotConnected 0

Used to indicate that the Weave Tunnel is not connected

kState_Connecting 1

Used to indicate that the Weave Tunnel connection has been initiated

kState_ConnectionEstablished 2

Used to indicate that the Weave Tunnel connection is established and route information is being exchanged

kState_TunnelOpen 3

Used to indicate that the Weave Tunnel is open and ready for data traffic transit

kState_TunnelClosing 4

Used to indicate that the Weave Tunnel is closing and the connection is being torn down

kState_ReconnectRecvd 5

Used to indicate that the Service wants the border gateway to reconnect after a directory lookup

Defined at line 86 of file gen/third_party/openweave-core/src/include/Weave/Profiles/weave-tunneling/WeaveTunnelConnectionMgr.h

enum TunnelConnNotifyReasons
Name Value Comments
kStatus_TunDown 0

Used to indicate that the Weave tunnel has gone down

kStatus_TunPrimaryUp 1

Used to indicate that the primary Weave tunnel is up

kStatus_TunPrimaryConnError 2

Used to indicate that a primary tunnel connection attempt has failed or an existing one was locally aborted or closed by peer

kStatus_TunBackupConnError 3

Used to indicate that a backup tunnel connection attempt has failed or an existing one was locally aborted or closed by peer

kStatus_TunFailoverToBackup 4

Used to indicate that the primary tunnel is down and switchover to backup tunnel has occurred

kStatus_TunBackupOnlyDown 5

Used to indicate that the backup tunnel is down

kStatus_TunBackupUp 6

Used to indicate that the Backup Weave tunnel is up

kStatus_TunPrimaryAndBackupUp 7

Used to indicate that both the Primary and Backup Weave tunnel are up

kStatus_TunPrimaryReconnectRcvd 8

Used to indicate that the Service has requested a reconnect for the Primary Weave tunnel

kStatus_TunBackupReconnectRcvd 9

Used to indicate that the Service has requested a reconnect for the Backup Weave tunnel

kStatus_TunPrimaryLiveness 10

Used to indicate information about the Tunnel Liveness probe on the Primary Weave tunnel

kStatus_TunBackupLiveness 11

Used to indicate information about the Tunnel Liveness probe on the Backup Weave tunnel

kStatus_TunPrimaryConnEstablished 12

Used to indicate that the primary Weave tunnel TCP connection is up

kStatus_TunBackupConnEstablished 13

Used to indicate that the backup Weave tunnel TCP connection is up

Defined at line 96 of file gen/third_party/openweave-core/src/include/Weave/Profiles/weave-tunneling/WeaveTunnelConnectionMgr.h

Friends

class WeaveTunnelControl
class WeaveTunnelAgent