le_net_interface.h
Go to the documentation of this file.
17 * When applications need to exchange data with other devices on the packet switched data network,24 * interface provides APIs for starting (associating with), stopping (disassociating from) selected27 * @warning Since these @c le_net APIs generate network and route changes that affect all services39 * The @c le_net interface provides. More details for these APIs can be found in later subsections.45 * | -------------------------------| ---------------------------------------------------------------------------------------------------|46 * | le_net_ChangeRoute() | Add or remove host or network route onto the network interface of a given data channel |47 * | le_net_SetDefaultGW() | Set a device's default gateway addresses to those assigned for a given channel use |49 * | le_net_RestoreDefaultGW() | Restore the default gateway addresses of a device previously backed up by le_net_BackupDefaultGW() |51 * | le_net_RestoreDNS() | Remove the DNS server addresses previously added to the device's name server address table |56 * An application can use the le_net_ChangeRoute() function to add or remove a host or network route57 * onto the network interface of a given channel. The channel reference as an API input identifies61 * The IP address and mask input arguments specify the destination address and mask for the route.107 * used. This will save both the default gateway address and the network interface on which it is112 * with the channel reference of the channel provided, which assigned default gateway address will219 //--------------------------------------------------------------------------------------------------223 //--------------------------------------------------------------------------------------------------226 //--------------------------------------------------------------------------------------------------229 * Connect the current client thread to the service providing this API. Block until the service is232 * For each thread that wants to use this API, either ConnectService or TryConnectService must be233 * called before any other functions in this API. Normally, ConnectService is automatically called238 //--------------------------------------------------------------------------------------------------244 //--------------------------------------------------------------------------------------------------247 * Try to connect the current client thread to the service providing this API. Return with an error250 * For each thread that wants to use this API, either ConnectService or TryConnectService must be251 * called before any other functions in this API. Normally, ConnectService is automatically called260 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).263 //--------------------------------------------------------------------------------------------------269 //--------------------------------------------------------------------------------------------------273 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants276 //--------------------------------------------------------------------------------------------------283 //--------------------------------------------------------------------------------------------------289 * longer a connection to the service, and the functions in this API can't be used. For details, see294 //--------------------------------------------------------------------------------------------------301 //--------------------------------------------------------------------------------------------------303 * Add or remove a route on the given channel according to the input flag in the last argument for304 * the given destination address its given subnet, which is a subnet mask for IPv4 and subnet mask's307 * The channel reference in the first input argument identifies the network interface which a route308 * is to be added onto or removed from. Whether the operation is an add or a remove depends on the314 * "route -A inet6 add -net <ipAddr/prefixLength> dev <netInterface>" for IPv6. If the route is a320 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------341 //--------------------------------------------------------------------------------------------------349 //--------------------------------------------------------------------------------------------------353 //--------------------------------------------------------------------------------------------------359 //--------------------------------------------------------------------------------------------------363 //--------------------------------------------------------------------------------------------------369 //--------------------------------------------------------------------------------------------------376 //--------------------------------------------------------------------------------------------------384 //--------------------------------------------------------------------------------------------------388 //--------------------------------------------------------------------------------------------------void le_net_RestoreDNS(void)le_result_t le_net_TryConnectService(void)le_result_t le_net_ChangeRoute(le_dcs_ChannelRef_t channelRef, const char *LE_NONNULL destAddr, const char *LE_NONNULL destSubnet, bool isAdd)void le_net_BackupDefaultGW(void)le_result_t le_net_SetDNS(le_dcs_ChannelRef_t channelRef)LE_FULL_API void le_net_SetServerDisconnectHandler(le_net_DisconnectHandler_t disconnectHandler, void *contextPtr)void le_net_ConnectService(void)le_result_t le_net_RestoreDefaultGW(void)le_result_t le_net_SetDefaultGW(le_dcs_ChannelRef_t channelRef)void le_net_DisconnectService(void)void(* le_net_DisconnectHandler_t)(void *)Definition: le_net_interface.h:224