nl::Weave::Profiles::WeaveTunnel::WeaveTunnelControl

Summary

Constructors and Destructors

WeaveTunnelControl(void)

Public types

TunnelStatusRcvdFunct)(uint8_t tType, StatusReport &tunStatus) typedef
void(*
Function pointer to handler set by a higher layer to act upon receipt of a StatusReport message in response to a Tunnel control message sent.

Public attributes

OnTunStatusRcvd
mCtrlResponseTimeout
uint16_t
The timeout(in seconds) for responses to control messages.
mShortcutTunnelAdvInterval
uint16_t
Interval in seconds for periodic shortcut tunnel advertisements.

Public functions

Close(void)
Close WeaveTunnelControl by closing any outstanding exchange contexts and resetting members.
DisableShortcutTunneling(void)
void
Disable shortcut tunneling of sending advertisments from either the Border gateway or Mobile client and also listening to advertisements from shortcut tunnel counterparts.
EnableShortcutTunneling(void)
void
Enable shortcut tunneling by sending advertisments from either the Border gateway or Mobile client and also listening to advertisements from shortcut tunnel counterparts.
Init(WeaveTunnelAgent *tunAgent, TunnelStatusRcvdFunct statusRcvd)
Initialize WeaveTunnelControl to set relevant members like the Weave Tunnel Agent and callbacks.
IsPeerInShortcutTunnelCache(uint64_t peerId)
bool
Verify if the peer is present in the tunnel shortcut cache for sending locally.
Reconnect(WeaveTunnelConnectionMgr *conMgr)
Reconnect with the peer node.
SendBorderRouterAdvertise(void)
Send a border router advertise message advertising its fabric Id.
SendMessageOverTunnelShortcut(uint64_t peerId, WeaveMessageInfo *msgHdr, PacketBuffer *msg)
Send message over the tunnel shortcut.
SendMobileClientAdvertise(void)
Send a mobile client advertise message advertising its Node Id.
SendTunnelClose(WeaveTunnelConnectionMgr *conMgr)
Send a Tunnel Close control message to the peer node with a set of tunnel routes.
SendTunnelOpen(WeaveTunnelConnectionMgr *conMgr, WeaveTunnelRoute *tunRoute)
Send a Tunnel Open control message to the peer node with a set of tunnel routes.
SendTunnelRouteUpdate(WeaveTunnelConnectionMgr *conMgr, WeaveTunnelRoute *tunRoute)
Send a Tunnel Route Update control message to the peer node with a set of tunnel routes.

Public static functions

HandleShortcutTunnelAdvertiseMessage(ExchangeContext *ec, const IPPacketInfo *pktInfo, const WeaveMessageInfo *msgInfo, uint32_t profileId, uint8_t msgType, PacketBuffer *payload)
void
Function registered with WeaveMessageLayer for listening to Shortcut tunnel advertisments and updating cache.

Public types

TunnelStatusRcvdFunct

void(* TunnelStatusRcvdFunct)(uint8_t tType, StatusReport &tunStatus)

Function pointer to handler set by a higher layer to act upon receipt of a StatusReport message in response to a Tunnel control message sent.

Details
Parameters
[in] tType
The tunnel type, i.e., Primary or Backup.
[in] tunStatus
A reference to the Tunnel control StatusReport message.

Public attributes

OnTunStatusRcvd

TunnelStatusRcvdFunct OnTunStatusRcvd

mCtrlResponseTimeout

uint16_t mCtrlResponseTimeout

The timeout(in seconds) for responses to control messages.

mShortcutTunnelAdvInterval

uint16_t mShortcutTunnelAdvInterval

Interval in seconds for periodic shortcut tunnel advertisements.

Public functions

Close

WEAVE_ERROR Close(
  void
)

Close WeaveTunnelControl by closing any outstanding exchange contexts and resetting members.

Details
Returns
WEAVE_NO_ERROR.

DisableShortcutTunneling

void DisableShortcutTunneling(
  void
)

Disable shortcut tunneling of sending advertisments from either the Border gateway or Mobile client and also listening to advertisements from shortcut tunnel counterparts.

EnableShortcutTunneling

void EnableShortcutTunneling(
  void
)

Enable shortcut tunneling by sending advertisments from either the Border gateway or Mobile client and also listening to advertisements from shortcut tunnel counterparts.

Init

WEAVE_ERROR Init(
  WeaveTunnelAgent *tunAgent,
  TunnelStatusRcvdFunct statusRcvd
)

Initialize WeaveTunnelControl to set relevant members like the Weave Tunnel Agent and callbacks.

Details
Parameters
[in] tunAgent
A pointer to the WeaveTunnelAgent object.
[in] statusRcvd
A pointer to a callback for the StatusRcvd handler.
Returns
WEAVE_NO_ERROR

IsPeerInShortcutTunnelCache

bool IsPeerInShortcutTunnelCache(
  uint64_t peerId
)

Verify if the peer is present in the tunnel shortcut cache for sending locally.

Reconnect

WEAVE_ERROR Reconnect(
  WeaveTunnelConnectionMgr *conMgr
)

Reconnect with the peer node.

SendBorderRouterAdvertise

WEAVE_ERROR SendBorderRouterAdvertise(
  void
)

Send a border router advertise message advertising its fabric Id.

SendMessageOverTunnelShortcut

WEAVE_ERROR SendMessageOverTunnelShortcut(
  uint64_t peerId,
  WeaveMessageInfo *msgHdr,
  PacketBuffer *msg
)

Send message over the tunnel shortcut.

SendMobileClientAdvertise

WEAVE_ERROR SendMobileClientAdvertise(
  void
)

Send a mobile client advertise message advertising its Node Id.

SendTunnelClose

WEAVE_ERROR SendTunnelClose(
  WeaveTunnelConnectionMgr *conMgr
)

Send a Tunnel Close control message to the peer node with a set of tunnel routes.

Send a Tunnel Close control message to the peer node.

Details
Parameters
[in] conMgr
A pointer to the WeaveTunnelConnectionMgr object.
Returns
WEAVE_ERROR WEAVE_NO_ERROR on success, else error.

SendTunnelOpen

WEAVE_ERROR SendTunnelOpen(
  WeaveTunnelConnectionMgr *conMgr,
  WeaveTunnelRoute *tunRoute
)

Send a Tunnel Open control message to the peer node with a set of tunnel routes.

Details
Parameters
[in] conMgr
A pointer to the WeaveTunnelConnectionMgr object.
[in] tunRoutes
List of prefix routes to add to route table.
Returns
WEAVE_ERROR WEAVE_NO_ERROR on success, else error.

SendTunnelRouteUpdate

WEAVE_ERROR SendTunnelRouteUpdate(
  WeaveTunnelConnectionMgr *conMgr,
  WeaveTunnelRoute *tunRoute
)

Send a Tunnel Route Update control message to the peer node with a set of tunnel routes.

Details
Parameters
[in] conMgr
A pointer to the WeaveTunnelConnectionMgr object.
[in] tunRoutes
List of prefix routes to add to route table.
Returns
WEAVE_ERROR WEAVE_NO_ERROR on success, else error.

WeaveTunnelControl

 WeaveTunnelControl(
  void
)

Public static functions

HandleShortcutTunnelAdvertiseMessage

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

Function registered with WeaveMessageLayer for listening to Shortcut tunnel advertisments and updating cache.