unofficial-rtos-docs

Chapter 3 - Description of NetX Duo AutoIP services

This chapter contains a description of all NetX Duo AutoIP services (listed below) in alphabetic order.

In the “Return Values” section in the following API descriptions, values in BOLD are not affected by the NX_DISABLE_ERROR_CHECKING define that is used to disable API error checking, while non-bold values are completely disabled.

nx_auto_ip_create

Create AutoIP instance

Prototype

UINT nx_auto_ip_create(
    NX_AUTO_IP *auto_ip_ptr,
    CHAR *name,
    NX_IP *ip_ptr,
    VOID *stack_ptr,
    ULONG stack_size,
    UINT priority);

Description

This service creates an AutoIP instance on the specified IP instance.

Input Parameters

Note: If DHCP is used, the DHCP thread must have a higher priority than the IP instance thread and the AutoIP thread.

Return Values

Allowed From

Initialization, Threads

Example

/* Create the AutoIP instance "auto_ip_0" on "ip_0". */
status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 1);

/* If status is NX_SUCCESS an AutoIP instance was successfully created. */

See Also

nx_auto_ip_delete, nx_auto_ip_set_interface, nx_auto_ip_get_address, nx_auto_ip_start, nx_auto_ip_stop

nx_auto_ip_delete

Delete AutoIP instance

Prototype

UINT nx_auto_ip_delete(NX_AUTO_IP *auto_ip_ptr);

Description

This service deletes a previously created AutoIP instance on the specified IP instance.

Input Parameters

Return Values

Allowed From

Threads

Example

/* Delete the AutoIP instance "auto_ip_0." */
status = nx_auto_ip_delete(&auto_ip_0);

/* If status is NX_SUCCESS an AutoIP instance was successfully deleted. */

See Also

nx_auto_ip_create, nx_auto_ip_set_interface, nx_auto_ip_get_address, nx_auto_ip_start, nx_auto_ip_stop

nx_auto_ip_get_address

Get current AutoIP address

Prototype

UINT nx_auto_ip_get_address(
    NX_AUTO_IP *auto_ip_ptr,
    ULONG *local_ip_address);

Description

This service retrieves the currently setup AutoIP address. If there isn’t one, an IP address of 0.0.0.0 is returned.

Input Parameters

Return Values

Allowed From

Initialization, Timers, Threads, ISRs

Example

ULONG local_address;

/* Get the AutoIP address resolved by the instance "auto_ip_0." */
status = nx_auto_ip_get_address(&auto_ip_0, &local_address);

/* If status is NX_SUCCESS the local IP address is in "local_address." */

See Also

nx_auto_ip_create, nx_auto_ip_set_interface, nx_auto_ip_delete, nx_auto_ip_start, nx_auto_ip_stop

nx_auto_ip_set_interface

Set network interface for AutoIP

Prototype

UINT nx_auto_ip_set_interface(
    NX_AUTO_IP *auto_ip_ptr,
    UINT interface_index);

Description

This service sets the index for the network interface AutoIP will probe for a network IP address. The default is zero (the primary network interface). Only applicable for multihomed devices.

Input Parameters

Return Values

Allowed From

Initialization, Timers, Threads, ISRs

Example

ULONG interface_index;

/* Set the network interface on which AutoIP probes for host address. */
status = nx_auto_ip_set_interface(&auto_ip_0, interface_index);

/* If status is NX_SUCCESS the network interface is valid and set in the AutoIP control block *auto_ip_0*. */

See Also

nx_auto_ip_create, nx_auto_ip_get_address, nx_auto_ip_delete, nx_auto_ip_start, nx_auto_ip_stop

nx_auto_ip_start

Start AutoIP processing

Prototype

UINT nx_auto_ip_start(
    NX_AUTO_IP *auto_ip_ptr,
    ULONG starting_local_address);

Description

This service starts the AutoIP protocol on a previously created AutoIP instance.

Input Parameters

Return Values

Allowed From

Initialization, Threads

Example

/* Start the AutoIP instance "auto_ip_0." */
status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(0,0,0,0));

/* If status is NX_SUCCESS an AutoIP instance was successfully started. */

See Also

nx_auto_ip_create, nx_auto_ip_set_interface, nx_auto_ip_delete, nx_auto_ip_get_address, nx_auto_ip_stop

nx_auto_ip_stop

Stop AutoIP processing

Prototype

UINT nx_auto_ip_stop(NX_AUTO_IP *auto_ip_ptr);

Description

This service stops the AutoIP protocol on a previously created and started AutoIP instance. This service is typically used when the IP address is changed via DHCP or manually to a non-AutoIP address.

Input Parameters

Return Values

Allowed From

Threads

Example

/* Stop the AutoIP instance "auto_ip_0." */
status = nx_auto_ip_stop(&auto_ip_0);

/* If status is NX_SUCCESS an AutoIP instance was successfully stopped. */

See Also

nx_auto_ip_create, nx_auto_ip_set_interface, nx_auto_ip_delete, nx_auto_ip_get_address, nx_auto_ip_start