Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_net_interface.h File Reference
#include "legato.h"
#include "taf_types_interface.h"
#include "taf_net_common.h"

Go to the source code of this file.

Typedefs

typedef void(* taf_net_DisconnectHandler_t) (void *)
 

Functions

void taf_net_ConnectService (void)
 
le_result_t taf_net_TryConnectService (void)
 
LE_FULL_API void taf_net_SetServerDisconnectHandler (taf_net_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
LE_FULL_API void taf_net_SetNonExitServerDisconnectHandler (taf_net_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void taf_net_DisconnectService (void)
 
taf_net_RouteChangeHandlerRef_t taf_net_AddRouteChangeHandler (taf_net_RouteChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_net_RemoveRouteChangeHandler (taf_net_RouteChangeHandlerRef_t handlerRef)
 
taf_net_GatewayChangeHandlerRef_t taf_net_AddGatewayChangeHandler (taf_net_GatewayChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_net_RemoveGatewayChangeHandler (taf_net_GatewayChangeHandlerRef_t handlerRef)
 
taf_net_DNSChangeHandlerRef_t taf_net_AddDNSChangeHandler (taf_net_DNSChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_net_RemoveDNSChangeHandler (taf_net_DNSChangeHandlerRef_t handlerRef)
 
taf_net_DestNatChangeHandlerRef_t taf_net_AddDestNatChangeHandler (taf_net_DestNatChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_net_RemoveDestNatChangeHandler (taf_net_DestNatChangeHandlerRef_t handlerRef)
 
le_result_t taf_net_GetInterfaceList (taf_net_InterfaceInfo_t *ifInfoListPtr, size_t *ifInfoListSizePtr)
 
le_result_t taf_net_ChangeRoute (const char *LE_NONNULL interfaceName, const char *LE_NONNULL destAddr, const char *LE_NONNULL subnetMask, uint16_t metric, taf_net_NetAction_t isAdd)
 
le_result_t taf_net_BackupDefaultGW (void)
 
le_result_t taf_net_RestoreDefaultGW (void)
 
le_result_t taf_net_SetDefaultGW (const char *LE_NONNULL ifName)
 
le_result_t taf_net_GetInterfaceGW (const char *LE_NONNULL ifName, char *ipv4Addr, size_t ipv4AddrSize, char *ipv6Addr, size_t ipv6AddrSize)
 
le_result_t taf_net_SetDNS (const char *LE_NONNULL ifName)
 
le_result_t taf_net_GetInterfaceDNS (const char *LE_NONNULL ifName, taf_net_DnsServerAddresses_t *dnsServerAddressesPtr)
 
le_result_t taf_net_AddDestNatEntryOnDefaultPdn (const char *LE_NONNULL privateIpAddr, uint16_t privatePort, uint16_t globalPort, taf_net_IpProto_t ipProto)
 
le_result_t taf_net_RemoveDestNatEntryOnDefaultPdn (const char *LE_NONNULL privateIpAddr, uint16_t privatePort, uint16_t globalPort, taf_net_IpProto_t ipProto)
 
le_result_t taf_net_AddDestNatEntryOnDemandPdn (uint32_t profileId, const char *LE_NONNULL privateIpAddr, uint16_t privatePort, uint16_t globalPort, taf_net_IpProto_t ipProto)
 
le_result_t taf_net_RemoveDestNatEntryOnDemandPdn (uint32_t profileId, const char *LE_NONNULL privateIpAddr, uint16_t privatePort, uint16_t globalPort, taf_net_IpProto_t ipProto)
 
taf_net_DestNatEntryListRef_t taf_net_GetDestNatEntryListOnDefaultPdn (void)
 
taf_net_DestNatEntryListRef_t taf_net_GetDestNatEntryListOnDemandPdn (uint32_t profileId)
 
taf_net_DestNatEntryRef_t taf_net_GetFirstDestNatEntry (taf_net_DestNatEntryListRef_t destNatEntryListRef)
 
taf_net_DestNatEntryRef_t taf_net_GetNextDestNatEntry (taf_net_DestNatEntryListRef_t destNatEntryListRef)
 
le_result_t taf_net_GetDestNatEntryDetails (taf_net_DestNatEntryRef_t destNatEntryRef, char *privateIpAddr, size_t privateIpAddrSize, uint16_t *privatePortPtr, uint16_t *globalPortPtr, taf_net_IpProto_t *ipProtoPtr)
 
le_result_t taf_net_DeleteDestNatEntryList (taf_net_DestNatEntryListRef_t destNatEntryListRef)
 
taf_net_VlanRef_t taf_net_CreateVlan (uint16_t vlanId, bool isAccelerated)
 
le_result_t taf_net_SetVlanPriority (taf_net_VlanRef_t vlanRef, uint8_t priority)
 
le_result_t taf_net_RemoveVlan (taf_net_VlanRef_t vlanRef)
 
taf_net_VlanRef_t taf_net_GetVlanById (uint16_t vlanId)
 
le_result_t taf_net_AddVlanInterface (taf_net_VlanRef_t vlanRef, taf_net_VlanIfType_t ifType)
 
le_result_t taf_net_RemoveVlanInterface (taf_net_VlanRef_t vlanRef, taf_net_VlanIfType_t ifType)
 
taf_net_VlanIfListRef_t taf_net_GetVlanInterfaceList (taf_net_VlanRef_t vlanRef)
 
taf_net_VlanIfRef_t taf_net_GetFirstVlanInterface (taf_net_VlanIfListRef_t vlanIfListRef)
 
taf_net_VlanIfRef_t taf_net_GetNextVlanInterface (taf_net_VlanIfListRef_t vlanIfListRef)
 
le_result_t taf_net_DeleteVlanInterfaceList (taf_net_VlanIfListRef_t vlanIfListRef)
 
taf_net_VlanIfType_t taf_net_GetVlanInterfaceType (taf_net_VlanIfRef_t vlanIfRef)
 
le_result_t taf_net_GetVlanPriority (taf_net_VlanIfRef_t vlanIfRef, uint8_t *priorityPtr)
 
taf_net_VlanEntryListRef_t taf_net_GetVlanEntryList (void)
 
taf_net_VlanEntryRef_t taf_net_GetFirstVlanEntry (taf_net_VlanEntryListRef_t vlanEntryListRef)
 
taf_net_VlanEntryRef_t taf_net_GetNextVlanEntry (taf_net_VlanEntryListRef_t vlanEntryListRef)
 
le_result_t taf_net_DeleteVlanEntryList (taf_net_VlanEntryListRef_t vlanEntryListRef)
 
int16_t taf_net_GetVlanId (taf_net_VlanEntryRef_t vlanEntryRef)
 
le_result_t taf_net_IsVlanAccelerated (taf_net_VlanEntryRef_t vlanEntryRef, bool *isAcceleratedPtr)
 
int32_t taf_net_GetVlanBoundProfileId (taf_net_VlanEntryRef_t vlanEntryRef)
 
le_result_t taf_net_GetVlanBoundPhoneId (taf_net_VlanEntryRef_t vlanEntryRef, uint8_t *phoneIdPtr)
 
le_result_t taf_net_BindVlanWithProfile (taf_net_VlanRef_t vlanRef, uint32_t profileId)
 
le_result_t taf_net_BindVlanWithProfileEx (taf_net_VlanRef_t vlanRef, uint8_t phoneId, uint32_t profileId)
 
le_result_t taf_net_UnbindVlanFromProfile (taf_net_VlanRef_t vlanRef)
 
le_result_t taf_net_EnableL2tp (bool enableMss, bool enableMtu, uint32_t mtuSize)
 
void taf_net_EnableL2tpAsync (bool enableMss, bool enableMtu, uint32_t mtuSize, taf_net_AsyncL2tpHandlerFunc_t handlerPtr, void *contextPtr)
 
le_result_t taf_net_DisableL2tp (void)
 
void taf_net_DisableL2tpAsync (taf_net_AsyncL2tpHandlerFunc_t handlerPtr, void *contextPtr)
 
bool taf_net_IsL2tpEnabled (void)
 
bool taf_net_IsL2tpMssEnabled (void)
 
bool taf_net_IsL2tpMtuEnabled (void)
 
uint32_t taf_net_GetL2tpMtuSize (void)
 
taf_net_TunnelRef_t taf_net_CreateTunnel (taf_net_L2tpEncapProtocol_t encaProto, uint32_t locId, uint32_t peerId, const char *LE_NONNULL peerIpAddr, const char *LE_NONNULL ifName)
 
le_result_t taf_net_RemoveTunnel (taf_net_TunnelRef_t tunnelRef)
 
le_result_t taf_net_SetTunnelUdpPort (taf_net_TunnelRef_t tunnelRef, uint32_t localUdpPort, uint32_t peerUdpPort)
 
le_result_t taf_net_AddSession (taf_net_TunnelRef_t tunnelRef, uint32_t locId, uint32_t peerId)
 
le_result_t taf_net_RemoveSession (taf_net_TunnelRef_t tunnelRef, uint32_t locId, uint32_t peerId)
 
le_result_t taf_net_StartTunnel (taf_net_TunnelRef_t tunnelRef)
 
void taf_net_StartTunnelAsync (taf_net_TunnelRef_t tunnelRef, taf_net_AsyncTunnelHandlerFunc_t handlerPtr, void *contextPtr)
 
le_result_t taf_net_StopTunnel (taf_net_TunnelRef_t tunnelRef)
 
void taf_net_StopTunnelAsync (taf_net_TunnelRef_t tunnelRef, taf_net_AsyncTunnelHandlerFunc_t handlerPtr, void *contextPtr)
 
taf_net_TunnelRef_t taf_net_GetTunnelRefById (uint32_t locId)
 
taf_net_TunnelEntryListRef_t taf_net_GetTunnelEntryList (void)
 
taf_net_TunnelEntryRef_t taf_net_GetFirstTunnelEntry (taf_net_TunnelEntryListRef_t tunnelEntryListRef)
 
taf_net_TunnelEntryRef_t taf_net_GetNextTunnelEntry (taf_net_TunnelEntryListRef_t tunnelEntryListRef)
 
le_result_t taf_net_DeleteTunnelEntryList (taf_net_TunnelEntryListRef_t tunnelEntryListRef)
 
taf_net_L2tpEncapProtocol_t taf_net_GetTunnelEncapProto (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
uint32_t taf_net_GetTunnelLocalId (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
uint32_t taf_net_GetTunnelPeerId (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
uint32_t taf_net_GetTunnelLocalUdpPort (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
uint32_t taf_net_GetTunnelPeerUdpPort (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
le_result_t taf_net_GetTunnelPeerIpv6Addr (taf_net_TunnelEntryRef_t tunnelEntryRef, char *peerIpv6Addr, size_t peerIpv6AddrSize)
 
le_result_t taf_net_GetTunnelPeerIpv4Addr (taf_net_TunnelEntryRef_t tunnelEntryRef, char *peerIpv4Addr, size_t peerIpv4AddrSize)
 
le_result_t taf_net_GetTunnelInterfaceName (taf_net_TunnelEntryRef_t tunnelEntryRef, char *ifName, size_t ifNameSize)
 
taf_net_IpFamilyType_t taf_net_GetTunnelIpType (taf_net_TunnelEntryRef_t tunnelEntryRef)
 
le_result_t taf_net_GetSessionConfig (taf_net_TunnelEntryRef_t tunnelEntryRef, taf_net_L2tpSessionConfig_t *sessionConfigPtr, size_t *sessionConfigSizePtr)
 
le_result_t taf_net_EnableSocks (void)
 
void taf_net_EnableSocksAsync (taf_net_AsyncSocksHandlerFunc_t handlerPtr, void *contextPtr)
 
le_result_t taf_net_DisableSocks (void)
 
void taf_net_DisableSocksAsync (taf_net_AsyncSocksHandlerFunc_t handlerPtr, void *contextPtr)
 
le_result_t taf_net_SetSocksAuthMethod (taf_net_AuthMethod_t authMethod)
 
taf_net_AuthMethod_t taf_net_GetSocksAuthMethod (void)
 
le_result_t taf_net_SetSocksLanInterface (const char *LE_NONNULL ifName)
 
le_result_t taf_net_GetSocksLanInterface (char *ifName, size_t ifNameSize)
 
le_result_t taf_net_AddSocksAssociation (const char *LE_NONNULL userName, uint32_t profileId)
 
le_result_t taf_net_RemoveSocksAssociation (const char *LE_NONNULL userName)
 
le_result_t taf_net_AddGsb (const char *LE_NONNULL ifName, taf_net_GsbIfType_t ifType, uint32_t bandwidth)
 
le_result_t taf_net_RemoveGsb (const char *LE_NONNULL ifName)
 
le_result_t taf_net_EnableGsb (void)
 
le_result_t taf_net_DisableGsb (void)
 
taf_net_GsbListRef_t taf_net_GetGsbList (void)
 
taf_net_GsbRef_t taf_net_GetFirstGsb (taf_net_GsbListRef_t gsbListRef)
 
taf_net_GsbRef_t taf_net_GetNextGsb (taf_net_GsbListRef_t gsbListRef)
 
le_result_t taf_net_DeleteGsbList (taf_net_GsbListRef_t gsbListRef)
 
le_result_t taf_net_GetGsbInterfaceName (taf_net_GsbRef_t gsbRef, char *IfName, size_t IfNameSize)
 
taf_net_GsbIfType_t taf_net_GetGsbInterfaceType (taf_net_GsbRef_t gsbRef)
 
int32_t taf_net_GetGsbBandWidth (taf_net_GsbRef_t gsbRef)
 

Typedef Documentation

◆ taf_net_DisconnectHandler_t

typedef void(* taf_net_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ taf_net_ConnectService()

void taf_net_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.

This function is created automatically.

◆ taf_net_TryConnectService()

le_result_t taf_net_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.

◆ taf_net_SetServerDisconnectHandler()

LE_FULL_API void taf_net_SetServerDisconnectHandler ( taf_net_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ taf_net_SetNonExitServerDisconnectHandler()

LE_FULL_API void taf_net_SetNonExitServerDisconnectHandler ( taf_net_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected without exiting.

When a server connection is lost, call this handler without exit.

Warning
When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.

◆ taf_net_DisconnectService()

void taf_net_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see apiFilesC_client.

This function is created automatically.

◆ taf_net_AddRouteChangeHandler()

taf_net_RouteChangeHandlerRef_t taf_net_AddRouteChangeHandler ( taf_net_RouteChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_net_RouteChange'

Event to report route changes.

Parameters
[in]handlerPtrHandler for route changes.
[in]contextPtr

◆ taf_net_RemoveRouteChangeHandler()

void taf_net_RemoveRouteChangeHandler ( taf_net_RouteChangeHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_net_RouteChange'

Parameters
[in]handlerRef

◆ taf_net_AddGatewayChangeHandler()

taf_net_GatewayChangeHandlerRef_t taf_net_AddGatewayChangeHandler ( taf_net_GatewayChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_net_GatewayChange'

Event to report gateway changes.

Parameters
[in]handlerPtrHandler for gateway changes.
[in]contextPtr

◆ taf_net_RemoveGatewayChangeHandler()

void taf_net_RemoveGatewayChangeHandler ( taf_net_GatewayChangeHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_net_GatewayChange'

Parameters
[in]handlerRef

◆ taf_net_AddDNSChangeHandler()

taf_net_DNSChangeHandlerRef_t taf_net_AddDNSChangeHandler ( taf_net_DNSChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_net_DNSChange'

Event to report DNS changes.

Parameters
[in]handlerPtrHandler for DNS changes.
[in]contextPtr

◆ taf_net_RemoveDNSChangeHandler()

void taf_net_RemoveDNSChangeHandler ( taf_net_DNSChangeHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_net_DNSChange'

Parameters
[in]handlerRef

◆ taf_net_AddDestNatChangeHandler()

taf_net_DestNatChangeHandlerRef_t taf_net_AddDestNatChangeHandler ( taf_net_DestNatChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_net_DestNatChange'

Event to report destination NAT change.

Parameters
[in]handlerPtrHandler for destination NAT changes.
[in]contextPtr

◆ taf_net_RemoveDestNatChangeHandler()

void taf_net_RemoveDestNatChangeHandler ( taf_net_DestNatChangeHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_net_DestNatChange'

Parameters
[in]handlerRef

◆ taf_net_GetInterfaceList()

le_result_t taf_net_GetInterfaceList ( taf_net_InterfaceInfo_t ifInfoListPtr,
size_t *  ifInfoListSizePtr 
)

Gets the interface information list.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[out]ifInfoListPtrInterface information list.
[in,out]ifInfoListSizePtr

◆ taf_net_ChangeRoute()

le_result_t taf_net_ChangeRoute ( const char *LE_NONNULL  interfaceName,
const char *LE_NONNULL  destAddr,
const char *LE_NONNULL  subnetMask,
uint16_t  metric,
taf_net_NetAction_t  isAdd 
)

Adds or removes a route.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]interfaceNameThe interface name.
[in]destAddrDestination IP address.
[in]subnetMaskDestination's subnet mask or length string.
[in]metricMetric.
[in]isAddAdd or delete.

◆ taf_net_BackupDefaultGW()

le_result_t taf_net_BackupDefaultGW ( void  )

Backs up the current default gateway of the system into DB, including both IPv4 and IPv6.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – No default gateway.

◆ taf_net_RestoreDefaultGW()

le_result_t taf_net_RestoreDefaultGW ( void  )

Restores the default gateway of the system from the last backed up one, including IPv4 and/or IPv6. Only gateways backed up and set by the same client session can be restored.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – No backup.
  • LE_FAULT – Failed.

◆ taf_net_SetDefaultGW()

le_result_t taf_net_SetDefaultGW ( const char *LE_NONNULL  ifName)

Sets the default gateway address received from the interface into the system.

Returns
  • LE_OK – Succeded.
  • LE_NOT_FOUND – No gateway address from the interface.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameThe interface from which to get the default gateway addresses.

◆ taf_net_GetInterfaceGW()

le_result_t taf_net_GetInterfaceGW ( const char *LE_NONNULL  ifName,
char *  ipv4Addr,
size_t  ipv4AddrSize,
char *  ipv6Addr,
size_t  ipv6AddrSize 
)

Gets the gateway addresses from the specified interface.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – No gateway address from the interface.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameInteraface name to get the gateway.
[out]ipv4AddrIPv4 address.
[in]ipv4AddrSize
[out]ipv6AddrIPv6 address.
[in]ipv6AddrSize

◆ taf_net_SetDNS()

le_result_t taf_net_SetDNS ( const char *LE_NONNULL  ifName)

Sets the DNS addresses received from the interface into the system.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – No DNS addresses from the interface.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameThe interface from which to get the DNS addresses.

◆ taf_net_GetInterfaceDNS()

le_result_t taf_net_GetInterfaceDNS ( const char *LE_NONNULL  ifName,
taf_net_DnsServerAddresses_t dnsServerAddressesPtr 
)

Gets the DNS addresses from the interface, including IPv4 and IPv6 addresses.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found DNS addresses from the interface.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameThe interface name from which to get the DNS addresses.
[out]dnsServerAddressesPtrDNS addresses structure.

◆ taf_net_AddDestNatEntryOnDefaultPdn()

le_result_t taf_net_AddDestNatEntryOnDefaultPdn ( const char *LE_NONNULL  privateIpAddr,
uint16_t  privatePort,
uint16_t  globalPort,
taf_net_IpProto_t  ipProto 
)

Adds a destination NAT entry on the default PDN.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]privateIpAddrPrivate IP address.
[in]privatePortPrivate port.
[in]globalPortGlobal port.
[in]ipProtoIP protocol number.

◆ taf_net_RemoveDestNatEntryOnDefaultPdn()

le_result_t taf_net_RemoveDestNatEntryOnDefaultPdn ( const char *LE_NONNULL  privateIpAddr,
uint16_t  privatePort,
uint16_t  globalPort,
taf_net_IpProto_t  ipProto 
)

Deletes a destination NAT entry on the default PDN.

Returns
  • LE_OK – Success
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failure.
Parameters
[in]privateIpAddrPrivate IP address.
[in]privatePortPrivate port.
[in]globalPortGlobal port.
[in]ipProtoIP protocol number.

◆ taf_net_AddDestNatEntryOnDemandPdn()

le_result_t taf_net_AddDestNatEntryOnDemandPdn ( uint32_t  profileId,
const char *LE_NONNULL  privateIpAddr,
uint16_t  privatePort,
uint16_t  globalPort,
taf_net_IpProto_t  ipProto 
)

Adds a destination NAT entry to the specified PDN.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]profileIdProfile ID.
[in]privateIpAddrPrivate IP address.
[in]privatePortPrivate port.
[in]globalPortGlobal port.
[in]ipProtoIP protocol number.

◆ taf_net_RemoveDestNatEntryOnDemandPdn()

le_result_t taf_net_RemoveDestNatEntryOnDemandPdn ( uint32_t  profileId,
const char *LE_NONNULL  privateIpAddr,
uint16_t  privatePort,
uint16_t  globalPort,
taf_net_IpProto_t  ipProto 
)

Deletes a destination NAT entry from the specified PDN.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]profileIdProfile ID.
[in]privateIpAddrPrivate IP address.
[in]privatePortPrivate port.
[in]globalPortGlobal port.
[in]ipProtoIP protocol number.

◆ taf_net_GetDestNatEntryListOnDefaultPdn()

taf_net_DestNatEntryListRef_t taf_net_GetDestNatEntryListOnDefaultPdn ( void  )

Gets the reference to the destination NAT entry list on the default PDN.

Returns
  • NULL – If there was some other error.
  • Others – The reference to the destination NAT entry list.

◆ taf_net_GetDestNatEntryListOnDemandPdn()

taf_net_DestNatEntryListRef_t taf_net_GetDestNatEntryListOnDemandPdn ( uint32_t  profileId)

Gets the reference to the destination NAT entry list on the specified PDN.

Returns
  • NULL – If there was some other error.
  • Others – The reference to the destination NAT entry list.
Parameters
[in]profileIdThe profile ID.

◆ taf_net_GetFirstDestNatEntry()

taf_net_DestNatEntryRef_t taf_net_GetFirstDestNatEntry ( taf_net_DestNatEntryListRef_t  destNatEntryListRef)

Gets the reference to the first destination NAT entry with a list reference.

Returns
  • NULL – Error.
  • Others – The reference to the first destination NAT entry.
Parameters
[in]destNatEntryListRefThe reference of a destination entry list.

◆ taf_net_GetNextDestNatEntry()

taf_net_DestNatEntryRef_t taf_net_GetNextDestNatEntry ( taf_net_DestNatEntryListRef_t  destNatEntryListRef)

Gets the reference to the next destination NAT entry with a list reference.

Returns
  • NULL – Error.
  • Others – The reference of the next destination NAT entry.
Parameters
[in]destNatEntryListRefThe reference of a destination entry list.

◆ taf_net_GetDestNatEntryDetails()

le_result_t taf_net_GetDestNatEntryDetails ( taf_net_DestNatEntryRef_t  destNatEntryRef,
char *  privateIpAddr,
size_t  privateIpAddrSize,
uint16_t *  privatePortPtr,
uint16_t *  globalPortPtr,
taf_net_IpProto_t ipProtoPtr 
)

Gets the information of a destination NAT entry with an entry reference.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]destNatEntryRefEntry reference.
[out]privateIpAddrPrivate IP address.
[in]privateIpAddrSize
[out]privatePortPtrPrivate port.
[out]globalPortPtrGlobal port.
[out]ipProtoPtrIP protocol number.

◆ taf_net_DeleteDestNatEntryList()

le_result_t taf_net_DeleteDestNatEntryList ( taf_net_DestNatEntryListRef_t  destNatEntryListRef)

Deletes the reference to the destination NAT entry list.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]destNatEntryListRefThe reference of a destination entry list.

◆ taf_net_CreateVlan()

taf_net_VlanRef_t taf_net_CreateVlan ( uint16_t  vlanId,
bool  isAccelerated 
)

Creates a VLAN.

Note
To use VLAN bridge and VLAN binding features, set device mode with value 0 first.
Returns
  • NULL – Failure.
  • Others – The reference of VLAN.
Parameters
[in]vlanIdVLAN identifier, i.e., 1-4094.
[in]isAcceleratedIs acceleration allowed.

◆ taf_net_SetVlanPriority()

le_result_t taf_net_SetVlanPriority ( taf_net_VlanRef_t  vlanRef,
uint8_t  priority 
)

Sets the priority to a VLAN.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.
[in]priorityPriority.

◆ taf_net_RemoveVlan()

le_result_t taf_net_RemoveVlan ( taf_net_VlanRef_t  vlanRef)

Removes a VLAN.

Note
The system is not allowed to remove a VLAN if the VLAN interface list is not empty.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.

◆ taf_net_GetVlanById()

taf_net_VlanRef_t taf_net_GetVlanById ( uint16_t  vlanId)

Gets VLAN by the VLAN ID.

Returns
  • NULL – Not found.
  • Others – The VLAN reference.
Parameters
[in]vlanIdVLAN ID.

◆ taf_net_AddVlanInterface()

le_result_t taf_net_AddVlanInterface ( taf_net_VlanRef_t  vlanRef,
taf_net_VlanIfType_t  ifType 
)

Adds a VLAN interface into the VLAN interface list.

Note
Adding the first interface into the VLAN interface list with the same interface type triggers a system reboot if VLAN acceleration is enabled.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_DUPLICATE – ifType already added into the VLAN.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.
[in]ifTypeInterface type.

◆ taf_net_RemoveVlanInterface()

le_result_t taf_net_RemoveVlanInterface ( taf_net_VlanRef_t  vlanRef,
taf_net_VlanIfType_t  ifType 
)

Removes a VLAN interface from the VLAN interface list.

Note
Removing the last interface from the VLAN interface list with the same interface type triggers a system reboot if VLAN acceleration is enabled.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.
[in]ifTypeInterface type.

◆ taf_net_GetVlanInterfaceList()

taf_net_VlanIfListRef_t taf_net_GetVlanInterfaceList ( taf_net_VlanRef_t  vlanRef)

Gets the VLAN interface list.

Returns
  • NULL – If the VLAN was not found or the VLAN interface list is empty.
  • Others – The VLAN interface list reference.
Parameters
[in]vlanRefVLAN reference.

◆ taf_net_GetFirstVlanInterface()

taf_net_VlanIfRef_t taf_net_GetFirstVlanInterface ( taf_net_VlanIfListRef_t  vlanIfListRef)

Gets the first VLAN interface reference with a list.

Returns
  • NULL – The interface list doesn't exist.
  • Others – The first VLAN interface reference.
Parameters
[in]vlanIfListRefReference of a VLAN interface list.

◆ taf_net_GetNextVlanInterface()

taf_net_VlanIfRef_t taf_net_GetNextVlanInterface ( taf_net_VlanIfListRef_t  vlanIfListRef)

Gets the next VLAN interface reference with a list.

Returns
  • NULL – The VLAN interface list or the next interface doesn't exist.
  • Others – The next VLAN interface reference.
Parameters
[in]vlanIfListRefReference of a VLAN interface list.

◆ taf_net_DeleteVlanInterfaceList()

le_result_t taf_net_DeleteVlanInterfaceList ( taf_net_VlanIfListRef_t  vlanIfListRef)

Deletes the VLAN interface list.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN interface list was not found.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]vlanIfListRefReference of a VLAN interface list.

◆ taf_net_GetVlanInterfaceType()

taf_net_VlanIfType_t taf_net_GetVlanInterfaceType ( taf_net_VlanIfRef_t  vlanIfRef)

Gets the interface type of a VLAN interface.

Returns
  • taf_net_VlanIfType_t – VLAN interface type.
  • TAF_NET_IFACE_UNKNOWN – VLAN interface was not found.
Parameters
[in]vlanIfRefVLAN interface reference.

◆ taf_net_GetVlanPriority()

le_result_t taf_net_GetVlanPriority ( taf_net_VlanIfRef_t  vlanIfRef,
uint8_t *  priorityPtr 
)

Gets the VLAN priority of a VLAN interface.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]vlanIfRefVLAN interface reference.
[out]priorityPtrPriority.

◆ taf_net_GetVlanEntryList()

taf_net_VlanEntryListRef_t taf_net_GetVlanEntryList ( void  )

Gets the VLAN entry list.

Returns
  • NULL – The VLAN entry list is empty.
  • Others – The VLAN entry list reference.

◆ taf_net_GetFirstVlanEntry()

taf_net_VlanEntryRef_t taf_net_GetFirstVlanEntry ( taf_net_VlanEntryListRef_t  vlanEntryListRef)

Gets the reference of the first VLAN entry with a list.

Returns
  • NULL – The VLAN entry list doesn't exist.
  • Others – The first VLAN entry reference.
Parameters
[in]vlanEntryListRefReference of a VLAN entry list.

◆ taf_net_GetNextVlanEntry()

taf_net_VlanEntryRef_t taf_net_GetNextVlanEntry ( taf_net_VlanEntryListRef_t  vlanEntryListRef)

Gets the reference of the next VLAN entry with a list.

Returns
  • NULL – The VLAN entry list or the next VLAN doesn't exist.
  • Others – The reference of the next VLAN entry.
Parameters
[in]vlanEntryListRefReference of a VLAN entry list.

◆ taf_net_DeleteVlanEntryList()

le_result_t taf_net_DeleteVlanEntryList ( taf_net_VlanEntryListRef_t  vlanEntryListRef)

Deletes the VLAN entry list.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Failed to delete the reference.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]vlanEntryListRefReference of a VLAN entry list.

◆ taf_net_GetVlanId()

int16_t taf_net_GetVlanId ( taf_net_VlanEntryRef_t  vlanEntryRef)

Gets the VLAN ID by the VLAN entry reference.

Returns
  • 1-4094 – Succeeded.
  • others – Failed.
Parameters
[in]vlanEntryRefVLAN entry reference.

◆ taf_net_IsVlanAccelerated()

le_result_t taf_net_IsVlanAccelerated ( taf_net_VlanEntryRef_t  vlanEntryRef,
bool *  isAcceleratedPtr 
)

Determines if the VLAN is accelerated or not by the VLAN entry reference.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]vlanEntryRefVLAN entry reference.
[out]isAcceleratedPtrIs accelerated or not.

◆ taf_net_GetVlanBoundProfileId()

int32_t taf_net_GetVlanBoundProfileId ( taf_net_VlanEntryRef_t  vlanEntryRef)

Gets the profile ID bound with a VLAN by the VLAN entry reference.

Returns
  • Others – Succeeded.
  • -1 – No binding.
Parameters
[in]vlanEntryRefVLAN entry reference.

◆ taf_net_GetVlanBoundPhoneId()

le_result_t taf_net_GetVlanBoundPhoneId ( taf_net_VlanEntryRef_t  vlanEntryRef,
uint8_t *  phoneIdPtr 
)

Gets the phone ID bound with a VLAN by the VLAN entry reference.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN was not found.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]vlanEntryRefVLAN entry reference.
[out]phoneIdPtrPhone ID for VLAN association.

◆ taf_net_BindVlanWithProfile()

le_result_t taf_net_BindVlanWithProfile ( taf_net_VlanRef_t  vlanRef,
uint32_t  profileId 
)

Binds a VLAN with a specified profile ID.

Note
Binding VLAN with the default profile ID results in the system automatically rebooting after 5 seconds.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN wass not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.
[in]profileIdProfile ID for VLAN association.

◆ taf_net_BindVlanWithProfileEx()

le_result_t taf_net_BindVlanWithProfileEx ( taf_net_VlanRef_t  vlanRef,
uint8_t  phoneId,
uint32_t  profileId 
)

Binds a VLAN with a specified phone ID and profile index.

Note
Binding a VLAN with the default profile ID results in the system automatically rebooting after 5 seconds.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN wass not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.
[in]phoneIdPhone for VLAN association.
[in]profileIdProfile ID for VLAN association.

◆ taf_net_UnbindVlanFromProfile()

le_result_t taf_net_UnbindVlanFromProfile ( taf_net_VlanRef_t  vlanRef)

Unbinds a VLAN from previous profile ID.

Note
Unbinding VLAN from the default profile ID results in the system automatically rebooting after 5 seconds.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – VLAN wass not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]vlanRefVLAN reference.

◆ taf_net_EnableL2tp()

le_result_t taf_net_EnableL2tp ( bool  enableMss,
bool  enableMtu,
uint32_t  mtuSize 
)

Enables (synchronously) L2TP for unmanaged tunnel state.

Note
To use the L2TP feature set device mode with value 1 first.
Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_FAULT – Failed.
Parameters
[in]enableMssEnable TCP MSS to be clamped on L2TP interfaces.
[in]enableMtuEnable MTU size to be set on underlying interfaces.
[in]mtuSizeOptional MTU size in bytes; default is 1422.

◆ taf_net_EnableL2tpAsync()

void taf_net_EnableL2tpAsync ( bool  enableMss,
bool  enableMtu,
uint32_t  mtuSize,
taf_net_AsyncL2tpHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Enables (asynchronously) L2TP for unmanaged tunnel state.

Parameters
[in]enableMssEnable TCP MSS to be clamped on L2TP interfaces.
[in]enableMtuEnable MTU size to be set on underlying interfaces.
[in]mtuSizeoptional MTU size in bytes; default is 1422.
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_DisableL2tp()

le_result_t taf_net_DisableL2tp ( void  )

Disables (synchronously) L2TP for unmanaged tunnel state.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_FAULT – Failed.

◆ taf_net_DisableL2tpAsync()

void taf_net_DisableL2tpAsync ( taf_net_AsyncL2tpHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Disables (asynchronously) L2TP for unmanaged tunnel state.

Returns
None.
Parameters
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_IsL2tpEnabled()

bool taf_net_IsL2tpEnabled ( void  )

Determines if L2TP is enabled.

Returns
  • false – L2TP is disabled.
  • true – L2TP is enabled.

◆ taf_net_IsL2tpMssEnabled()

bool taf_net_IsL2tpMssEnabled ( void  )

Determines if maximum segment size (MSS) is enabled.

Returns
  • false – MSS is disabled for L2TP.
  • true – MSS is enabled for L2TP.

◆ taf_net_IsL2tpMtuEnabled()

bool taf_net_IsL2tpMtuEnabled ( void  )

Determines if maximum transmission unit (MTU) is enabled.

Returns
  • false – MTU is disabled for L2TP.
  • true – MTU is enabled for L2TP.

◆ taf_net_GetL2tpMtuSize()

uint32_t taf_net_GetL2tpMtuSize ( void  )

Gets L2TP MTU size.

Returns
  • 0 – Failed.
  • Others – Succeeded.

◆ taf_net_CreateTunnel()

taf_net_TunnelRef_t taf_net_CreateTunnel ( taf_net_L2tpEncapProtocol_t  encaProto,
uint32_t  locId,
uint32_t  peerId,
const char *LE_NONNULL  peerIpAddr,
const char *LE_NONNULL  ifName 
)

Creates an L2TP tunnel.

Returns
  • NULL – Failed.
  • Others – The tunnel reference.
Parameters
[in]encaProtoEncapsulation protocol, UDP or IP.
[in]locIdLocal tunnel ID.
[in]peerIdPeer tunnel ID.
[in]peerIpAddrPeer IP address.
[in]ifNameInterface name.

◆ taf_net_RemoveTunnel()

le_result_t taf_net_RemoveTunnel ( taf_net_TunnelRef_t  tunnelRef)

Removes an L2TP tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.

◆ taf_net_SetTunnelUdpPort()

le_result_t taf_net_SetTunnelUdpPort ( taf_net_TunnelRef_t  tunnelRef,
uint32_t  localUdpPort,
uint32_t  peerUdpPort 
)

Sets UDP ports for a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.
[in]localUdpPortLocal UDP port, if UDP encapsulation is used.
[in]peerUdpPortPeer UDP port, if IP encapsulation is used.

◆ taf_net_AddSession()

le_result_t taf_net_AddSession ( taf_net_TunnelRef_t  tunnelRef,
uint32_t  locId,
uint32_t  peerId 
)

Adds a session into a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.
[in]locIdLocal session ID.
[in]peerIdPeer session ID.

◆ taf_net_RemoveSession()

le_result_t taf_net_RemoveSession ( taf_net_TunnelRef_t  tunnelRef,
uint32_t  locId,
uint32_t  peerId 
)

Removes a session from a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.
[in]locIdLocal session ID.
[in]peerIdPeer session ID.

◆ taf_net_StartTunnel()

le_result_t taf_net_StartTunnel ( taf_net_TunnelRef_t  tunnelRef)

Starts (synchronously) a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.

◆ taf_net_StartTunnelAsync()

void taf_net_StartTunnelAsync ( taf_net_TunnelRef_t  tunnelRef,
taf_net_AsyncTunnelHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Starts (asynchronously) a tunnel.

Parameters
[in]tunnelRefTunnel reference.
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_StopTunnel()

le_result_t taf_net_StopTunnel ( taf_net_TunnelRef_t  tunnelRef)

Stops (synchronously) a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelRefTunnel reference.

◆ taf_net_StopTunnelAsync()

void taf_net_StopTunnelAsync ( taf_net_TunnelRef_t  tunnelRef,
taf_net_AsyncTunnelHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Stops (asynchronously) a tunnel.

Returns
None.
Parameters
[in]tunnelRefTunnel reference.
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_GetTunnelRefById()

taf_net_TunnelRef_t taf_net_GetTunnelRefById ( uint32_t  locId)

Gets tunnel reference by the local tunnel ID.

Returns
  • NULL – Failed.
  • Others – The created tunnel reference.
Parameters
[in]locIdLocal tunnel ID.

◆ taf_net_GetTunnelEntryList()

taf_net_TunnelEntryListRef_t taf_net_GetTunnelEntryList ( void  )

Gets the tunnel entry list.

Returns
  • NULL – Failed.
  • Others – The tunnel entry list reference.

◆ taf_net_GetFirstTunnelEntry()

taf_net_TunnelEntryRef_t taf_net_GetFirstTunnelEntry ( taf_net_TunnelEntryListRef_t  tunnelEntryListRef)

Gets the reference of the first tunnel entry.

Returns
  • NULL – Failed.
  • Others – The first tunnel entry reference.
Parameters
[in]tunnelEntryListRefReference of a tunnel entry list.

◆ taf_net_GetNextTunnelEntry()

taf_net_TunnelEntryRef_t taf_net_GetNextTunnelEntry ( taf_net_TunnelEntryListRef_t  tunnelEntryListRef)

Gets the reference of the next tunnel entry.

Returns
  • NULL – Failed.
  • Others – The next tunnel entry reference.
Parameters
[in]tunnelEntryListRefReference of a tunnel entry list.

◆ taf_net_DeleteTunnelEntryList()

le_result_t taf_net_DeleteTunnelEntryList ( taf_net_TunnelEntryListRef_t  tunnelEntryListRef)

Deletes a tunnel entry list.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelEntryListRefReference of a tunnel entry list.

◆ taf_net_GetTunnelEncapProto()

taf_net_L2tpEncapProtocol_t taf_net_GetTunnelEncapProto ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the encapsulation protocol of a tunnel.

Returns
  • TAF_NET_L2TP_NONE – Failed.
  • TAF_NET_L2TP_IP – IP protocol used for encapsulation.
  • TAF_NET_L2TP_UDP – UDP protocol used for encapsulation.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetTunnelLocalId()

uint32_t taf_net_GetTunnelLocalId ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the local ID of a tunnel.

Returns
  • 0 – Failed.
  • Others – Succeeded.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetTunnelPeerId()

uint32_t taf_net_GetTunnelPeerId ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the peer ID of a tunnel.

Returns
  • 0 – Failed.
  • Others – Succeeded.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetTunnelLocalUdpPort()

uint32_t taf_net_GetTunnelLocalUdpPort ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the local UDP port of a tunnel.

Returns
  • 0 – Failed.
  • Others – Succeeded.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetTunnelPeerUdpPort()

uint32_t taf_net_GetTunnelPeerUdpPort ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the peer UDP port of a tunnel.

Returns
  • 0 – Failed.
  • Others – Succeeded.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetTunnelPeerIpv6Addr()

le_result_t taf_net_GetTunnelPeerIpv6Addr ( taf_net_TunnelEntryRef_t  tunnelEntryRef,
char *  peerIpv6Addr,
size_t  peerIpv6AddrSize 
)

Gets the peer IPv6 address of a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelEntryRefTunnel entry reference.
[out]peerIpv6AddrPeer IPv6 address.
[in]peerIpv6AddrSize

◆ taf_net_GetTunnelPeerIpv4Addr()

le_result_t taf_net_GetTunnelPeerIpv4Addr ( taf_net_TunnelEntryRef_t  tunnelEntryRef,
char *  peerIpv4Addr,
size_t  peerIpv4AddrSize 
)

Gets the peer IPv4 address of a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelEntryRefTunnel entry reference.
[out]peerIpv4AddrPeer IPv4 address.
[in]peerIpv4AddrSize

◆ taf_net_GetTunnelInterfaceName()

le_result_t taf_net_GetTunnelInterfaceName ( taf_net_TunnelEntryRef_t  tunnelEntryRef,
char *  ifName,
size_t  ifNameSize 
)

Gets the interface name of a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
Parameters
[in]tunnelEntryRefTunnel entry reference.
[out]ifNameInterface name.
[in]ifNameSize

◆ taf_net_GetTunnelIpType()

taf_net_IpFamilyType_t taf_net_GetTunnelIpType ( taf_net_TunnelEntryRef_t  tunnelEntryRef)

Gets the IP type of a tunnel.

  • TAF_NET_L2TP_UNKNOWN – Failed.
  • TAF_NET_L2TP_IPV4 – IPv4.
  • TAF_NET_L2TP_IPV6 – IPv6.
Parameters
[in]tunnelEntryRefTunnel entry reference.

◆ taf_net_GetSessionConfig()

le_result_t taf_net_GetSessionConfig ( taf_net_TunnelEntryRef_t  tunnelEntryRef,
taf_net_L2tpSessionConfig_t sessionConfigPtr,
size_t *  sessionConfigSizePtr 
)

Gets the session configuration of a tunnel.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]tunnelEntryRefTunnel entry reference.
[out]sessionConfigPtrSession configuration.
[in,out]sessionConfigSizePtr

◆ taf_net_EnableSocks()

le_result_t taf_net_EnableSocks ( void  )

Enables (synchronously) the SOCKS proxy service.

Note
To use the SOCKS feature, set device mode with value 2 first.
Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.

◆ taf_net_EnableSocksAsync()

void taf_net_EnableSocksAsync ( taf_net_AsyncSocksHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Enables (asynchronously) the SOCKS proxy service.

Returns
None.
Parameters
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_DisableSocks()

le_result_t taf_net_DisableSocks ( void  )

Disables (synchronously) the SOCKS proxy service.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.

◆ taf_net_DisableSocksAsync()

void taf_net_DisableSocksAsync ( taf_net_AsyncSocksHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Disables (asynchronously) the SOCKS proxy service.

Returns
None.
Parameters
[in]handlerPtrThe handler.
[in]contextPtr

◆ taf_net_SetSocksAuthMethod()

le_result_t taf_net_SetSocksAuthMethod ( taf_net_AuthMethod_t  authMethod)

Sets the SOCKS authentication method.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[in]authMethodAuthentication method.

◆ taf_net_GetSocksAuthMethod()

taf_net_AuthMethod_t taf_net_GetSocksAuthMethod ( void  )

Gets the SOCKS authentication method.

Returns
  • TAF_NET_SOCKS_UNKNOWN – Unknown.
  • TAF_NET_SOCKS_NONE – No authentication.
  • TAF_NET_SOCKS_USER_PASSWD – Username and password.

◆ taf_net_SetSocksLanInterface()

le_result_t taf_net_SetSocksLanInterface ( const char *LE_NONNULL  ifName)

Sets SOCKS LAN interface.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[in]ifNameInterface name.

◆ taf_net_GetSocksLanInterface()

le_result_t taf_net_GetSocksLanInterface ( char *  ifName,
size_t  ifNameSize 
)

Gets SOCKS LAN interface.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[out]ifNameInterface name.
[in]ifNameSize

◆ taf_net_AddSocksAssociation()

le_result_t taf_net_AddSocksAssociation ( const char *LE_NONNULL  userName,
uint32_t  profileId 
)

Adds a username/profile association.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[in]userNameUsername.
[in]profileIdProfile ID.

◆ taf_net_RemoveSocksAssociation()

le_result_t taf_net_RemoveSocksAssociation ( const char *LE_NONNULL  userName)

Deletes a username/profile association.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
Parameters
[in]userNameUsername.

◆ taf_net_AddGsb()

le_result_t taf_net_AddGsb ( const char *LE_NONNULL  ifName,
taf_net_GsbIfType_t  ifType,
uint32_t  bandwidth 
)

Adds GSB configuration for an interface.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameInterface name.
[in]ifTypeInterface type.
[in]bandwidthBandwidth (in Mbps).

◆ taf_net_RemoveGsb()

le_result_t taf_net_RemoveGsb ( const char *LE_NONNULL  ifName)

Removes GSB configuration for an interface.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]ifNameInterface name.

◆ taf_net_EnableGsb()

le_result_t taf_net_EnableGsb ( void  )

Enables GSB in the system.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.

◆ taf_net_DisableGsb()

le_result_t taf_net_DisableGsb ( void  )

Disables GSB in the system.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.

◆ taf_net_GetGsbList()

taf_net_GsbListRef_t taf_net_GetGsbList ( void  )

Gets GSB list.

Returns
  • NULL – Failed.
  • Others – The GSB list reference.

◆ taf_net_GetFirstGsb()

taf_net_GsbRef_t taf_net_GetFirstGsb ( taf_net_GsbListRef_t  gsbListRef)

Gets the reference of the first GSB.

Returns
  • NULL – Failed.
  • Others – The first GSB reference.
Parameters
[in]gsbListRefReference of a GSB list.

◆ taf_net_GetNextGsb()

taf_net_GsbRef_t taf_net_GetNextGsb ( taf_net_GsbListRef_t  gsbListRef)

Gets the reference of the next GSB.

Returns
  • NULL – Failed.
  • Others – The next GSB reference.
Parameters
[in]gsbListRefReference of a GSB list.

◆ taf_net_DeleteGsbList()

le_result_t taf_net_DeleteGsbList ( taf_net_GsbListRef_t  gsbListRef)

Deletes the GSB list.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]gsbListRefReference of a GSB list.

◆ taf_net_GetGsbInterfaceName()

le_result_t taf_net_GetGsbInterfaceName ( taf_net_GsbRef_t  gsbRef,
char *  IfName,
size_t  IfNameSize 
)

Gets the interface name of a GSB.

Returns
  • LE_OK – Succeeded.
  • LE_NOT_FOUND – Not found.
  • LE_BAD_PARAMETER – Bad parameter.
  • LE_FAULT – Failed.
Parameters
[in]gsbRefGSB reference.
[out]IfNameInterface name.
[in]IfNameSize

◆ taf_net_GetGsbInterfaceType()

taf_net_GsbIfType_t taf_net_GetGsbInterfaceType ( taf_net_GsbRef_t  gsbRef)

Gets the interface type of a GSB.

Returns
  • GSB_UNKNOWN – Unknown type.
  • GSB_WLAN_AP – WLAN AP.
  • GSB_WLAN_STA – WLAN station.
  • GSB_ETH – Ethernet.
Parameters
[in]gsbRefGSB reference.

◆ taf_net_GetGsbBandWidth()

int32_t taf_net_GetGsbBandWidth ( taf_net_GsbRef_t  gsbRef)

Gets the bandwidth of a GSB.

Returns
  • -1 – Failed.
  • Others – Succeeded.
Parameters
[in]gsbRefGSB reference.