class WeaveTunnelAgent

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

Public Members

WeaveServiceManager * mServiceMgr
OnServiceTunnelStatusNotifyFunct OnServiceTunStatusNotify
OnServiceTunnelReconnectNotifyFunct OnServiceTunReconnectNotify
OnPacketTransitFunct OnTunneledPacketTransit
PlatformNetworkOnlineCheck NetworkOnlineCheck

Public Methods

fuchsia::net::interfaces::admin::ControlSyncPtr * GetInterfaceControlSyncPtr ()

Get a pointer to the Tun Interface's `fuchsia.net.interfaces.admin/Control`

handle.

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

void WeaveTunnelAgent ()
WEAVE_ERROR Init (InetLayer * inet, WeaveExchangeManager * exchMgr, uint64_t dstNodeId, WeaveAuthMode authMode, WeaveServiceManager * svcMgr, const char * intfName, uint8_t role, void * appContext)

Initialize the Tunnel agent. This creates te Tunnel endpoint object, sets up the tunnel

interface, initializes member variables, callbacks and WeaveTunnelControl.

WEAVE_ERROR Init (InetLayer * inet, WeaveExchangeManager * exchMgr, uint64_t dstNodeId, IPAddress dstIPAddr, WeaveAuthMode authMode, const char * intfName, uint8_t role, void * appContext)

Initialize the Tunnel agent. This creates te Tunnel endpoint object, sets up the tunnel

interface, initializes member variables, callbacks and WeaveTunnelControl.

void SetAuthMode (const WeaveAuthMode authMode)

Set the WeaveAuthMode for the Tunnel.

void SetDestination (const uint64_t nodeId, const IPAddress ipAddr, const uint16_t servicePort)

Set the destination nodeId, IPAddress and port for the Tunnel.

void SetTunnelingDeviceRole (const Role role)

Set the Tunneling device role(BorderGateway, StandaloneDevice, MobileDevice) for the Tunnel.

AgentState GetWeaveTunnelAgentState ()

Get the TunnelAgent state.

nl::Weave::WeaveConnection * GetPrimaryTunnelConnection ()

Get the Primary Tunnel Connection

WEAVE_ERROR ConfigurePrimaryTunnelTimeout (uint16_t maxTimeoutSecs)

Configure the TCP user timeout option on the primary tunnel connection.

void ConfigurePrimaryTunnelLivenessInterval (uint16_t livenessIntervalSecs)

Configure the Primary Tunnel Liveness interval.

bool IsPrimaryTunnelEnabled ()

Check if the primary tunnel is enabled.

void EnablePrimaryTunnel ()

Enable Primary Tunnel.

void DisablePrimaryTunnel ()

Disable Primary Tunnel.

bool IsPrimaryTunnelRoutingRestricted ()

Check if the primary tunnel is subject to routing restrictions by the service.

WEAVE_ERROR ResetPrimaryReconnectBackoff (bool reconnectImmediately)

Reset the Reconnect time for the primary tunnel

WEAVE_ERROR Shutdown ()

Shutdown the Tunnel Agent. This tears down connection to the Service and closes the TunEndPoint

interface after removing addresses and routes associated with the tunnel interface.

WEAVE_ERROR StartServiceTunnel ()

Start the Service Tunnel. This enables the tunnel and tries to establish a connection

to the Service.

WEAVE_ERROR StartServiceTunnel (uint64_t dstNodeId, IPAddress dstIPAddr, WeaveAuthMode authMode)

Start the Service Tunnel. This enables the tunnel and tries to establish a connection

to the Service.

void StopServiceTunnel ()

Close the Tunnel connection to the Service.

void StopServiceTunnel (WEAVE_ERROR err)

Close the Tunnel connection to the Service.

bool IsTunnelRoutingRestricted ()

Check if the tunnel is subject to routing restrictions by the service.

WEAVE_ERROR GetWeaveTunnelStatistics (WeaveTunnelStatistics & tunnelStats)

Get the WeaveTunnel statistics counters.

Parameters

tunnelStats [out] A reference to the WeaveTunnelStatistics structure.

Returns

WEAVE_ERROR Weave error encountered when getting tunnel statistics.

void RecvdFromTunnelEndPoint (TunEndPoint * tunEP, PacketBuffer * message)

Handler to receive IPv6 packets from the Tunnel EndPoint interface and forward, either to the Service

via the Service TCP connection after encapsulating IPv6 packet inside the tunnel header or to the Mobile

client over a shortcut tunnel. If the Service connection is not yet up, the message is queued until the

connection is set up. For tunneling to the Mobile client device, the nexthop neighbor table is referenced.

void RecvdFromShortcutUDPTunnel (WeaveMessageLayer * msgLayer, PacketBuffer * message)

Handler to receive tunneled IPv6 packets over the shortcut UDP tunnel between the border gateway and the mobile

device and forward to the Tunnel EndPoint interface after decapsulating the raw IPv6 packet from inside the

tunnel header.

const char * GetAgentStateName (const AgentState state)

Get the WeaveTunnelAgentState name

uint64_t GetTimeMsec ()

Get the system time in milliseconds

void NetworkOnlineCheckResult (TunnelType tunType, bool isOnline)

Callback invoked by the platform when the result of the network online

checker is available.

void ~WeaveTunnelAgent ()

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

Enumerations

enum AgentState
Name Value
kState_NotInitialized 0
kState_Initialized_NoTunnel 1
kState_PrimaryTunModeEstablished 2
kState_BkupOnlyTunModeEstablished 3
kState_PrimaryAndBkupTunModeEstablished 4

States of the Tunnel Agent in relation to its connection(s) to

the Service.

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

enum WeaveTunnelFlags
Name Value
kTunnelFlag_PrimaryEnabled 0x01
kTunnelFlag_BackupEnabled 0x02
kTunnelFlag_PrimaryRestricted 0x04
kTunnelFlag_BackupRestricted 0x08

Weave Tunnel flag bits.

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

Friends

class WeaveTunnelConnectionMgr
class WeaveTunnelControl