IP Management#

Functions#

sl_status_t
sl_net_configure_ip(sl_net_interface_t interface, const sl_net_ip_configuration_t *ip_config, uint32_t timeout)

Configure IP address of given interface.

sl_status_t
sl_net_get_ip_address(sl_net_interface_t interface, sl_net_ip_address_t *ip_address, uint32_t timeout)

This function retrieves the IP address of the specified network interface.

sl_status_t
sl_net_nat_enable(const sl_net_nat_config_t *nat_config)

Enables Network Address Translation (NAT) on the specified network interface in concurrent mode.

sl_status_t
sl_net_nat_disable(const sl_net_interface_t interface)

Disables Network Address Translation (NAT) on the specified network interface in concurrent mode.

Function Documentation#

sl_net_configure_ip#

sl_status_t sl_net_configure_ip (sl_net_interface_t interface, const sl_net_ip_configuration_t * ip_config, uint32_t timeout)

Configure IP address of given interface.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

const sl_net_ip_configuration_t *[in]ip_config

Multicast IP address of type sl_net_ip_configuration_t

uint32_t[in]timeout

The maximum time to wait for the IP address Configuration, in milliseconds.

  • Pre-conditions:

Returns

Note

    • This API doesn't support async mode operation, so passing 0 in timeout parameter leads to an error.


sl_net_get_ip_address#

sl_status_t sl_net_get_ip_address (sl_net_interface_t interface, sl_net_ip_address_t * ip_address, uint32_t timeout)

This function retrieves the IP address of the specified network interface.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

sl_net_ip_address_t *[in]ip_address

IP address of type sl_net_ip_address_t

uint32_t[in]timeout

The maximum time to wait for the IP address retrieval, in milliseconds.

  • Pre-conditions:

Returns

Note

    • This API doesn't support async mode operation, so passing 0 in timeout parameter leads to an error.

    • If the interface is setup in SL_IP_MANAGEMENT_STATIC_IP mode, this API only returns its mode and doesn't return ip address.


sl_net_nat_enable#

sl_status_t sl_net_nat_enable (const sl_net_nat_config_t * nat_config)

Enables Network Address Translation (NAT) on the specified network interface in concurrent mode.

Parameters
TypeDirectionArgument NameDescription
const sl_net_nat_config_t *[in]nat_config

Pointer to the NAT configuration structure of type sl_net_nat_config_t.

This function enables NAT on the given network interface. This is a blocking API.

  • Pre-conditions:

sl_net_init should be called before this API on AP and STA interfaces. sl_net_up should be called before this API on AP and STA interfaces.

Returns

  • status of the operation.

    • SL_STATUS_OK: On successful completion of the operation.

    • SL_STATUS_FAIL: If the operation fails.

    • SL_STATUS_INVALID_PARAMETER: If the nat_config parameter is NULL.

Note

  • NAT feature is internal test feature only, not recommended for Production.


sl_net_nat_disable#

sl_status_t sl_net_nat_disable (const sl_net_interface_t interface)

Disables Network Address Translation (NAT) on the specified network interface in concurrent mode.

Parameters
TypeDirectionArgument NameDescription
const sl_net_interface_t[in]interface

The network interface on which to disable NAT. (This parameter is currently unused.)

This function disables NAT on the given network interface. This is a blocking API.

  • Pre-conditions:

sl_net_nat_enable should be called before this API.

Returns

  • Status of the operation.

    • SL_STATUS_OK: On successful completion of the operation.

    • SL_STATUS_FAIL: If the operation fails.

Note

  • NAT feature is internal test feature only, not recommended for Production.