ThreadX docsThreadX docs
ThreadX
ThreadX Modules
NetX Duo
FileX
GUIX
USBX
TraceX
LevelX
ThreadX
ThreadX Modules
NetX Duo
FileX
GUIX
USBX
TraceX
LevelX
  • NetX Duo Documentation

    • Understand NetX Duo
    • NetX Duo documentation
    • Chapter 1 - Introduction to NetX Duo
    • Chapter 2 - Installation and Use of NetX Duo
    • Chapter 3 - Functional Components of NetX Duo
    • Chapter 4 - Description of NetX Duo Services
    • Chapter 5 - NetX Duo Network Drivers
    • Appendix A - NetX Duo Services
    • Appendix B - NetX Duo Constants
    • Appendix C - NetX Duo Data Types
    • Appendix D - NetX Duo BSD-Compatible Socket API
    • Appendix E - NetX Duo ASCII Character Codes
    • Auto-IP

      • Chapter 1 - Introduction to NetX Duo AutoIP
      • Chapter 2 - Installation and use of NetX Duo AutoIP
      • Chapter 3 - Description of NetX Duo AutoIP services
    • BSD

      • Chapter 1 - Introduction to NetX Duo BSD
      • Chapter 2 - Installation and use of NetX Duo BSD
      • Chapter 3 - NetX Duo BSD Services
    • Crypto

      • Chapter 1 - Introduction to NetX Duo Crypto
      • Chapter 2 - Installation and use of NetX Duo Crypto
      • Chapter 3 - Functional description of NetX Duo Crypto
      • Chapter 4 - NetX Duo Crypto API description
      • Appendix - NetX Duo Crypto CAVS test
    • DHCP Client

      • Chapter 1 - Introduction to the NetX Duo DHCP Client
      • Chapter 2 - Installation and use of NetX Duo DHCP Client
      • Chapter 3 - Description of NetX Duo DHCP Client services
      • Appendix A - Description of the Restore state feature for NetX Duo DHCP Client services
    • DHCP Server

      • Chapter 1 - Introduction to NetX Duo DHCP Server
      • Chapter 2 - Installation and Use of the NetX Duo DHCP Server
      • Chapter 3 - Description of NetX Duo DHCP server services
    • DHCPv6 Client

      • Chapter 1 - Introduction to NetX Duo DHCPv6 Client
      • Chapter 2 - Installation and use of NetX Duo DHCPv6 Client
      • Chapter 3 - NetX Duo DHCPv6 configuration options
      • Chapter 4 - NetX Duo DHCPv6 Client services
      • Appendix A - Description of the Restore State Feature for NetX Duo DHCPv6 Client
    • DHCPv6 Server

      • Chapter 1 - Introduction to NetX Duo DHCPv6 server
      • Chapter 2 - Installation and use of NetX Duo DHCPv6 server
      • Chapter 3 - NetX Duo DHCPv6 server configuration options
      • Chapter 4 - NetX Duo DHCPv6 server services
      • Appendix A – NetX Duo DHCPv6 option codes
      • Appendix B - NetX Duo DHCPv6 server status codes
      • Appendix C - NetX Duo DHCPv6 unique identifiers (DUIDs)
      • Appendix D - NetX Duo Advanced DHCPv6 server example
    • DNS

      • Chapter 1 - Introduction to the NetX Duo DNS Client
      • Chapter 2 - Installation and Use of NetX Duo DNS Client
      • Chapter 3 - Description of NetX Duo DNS Client Services
    • FTP

      • Chapter 1 - Introduction to NetX Duo FTP
      • Chapter 2 - Installation and use of FTP
      • Chapter 3 - Description of FTP services
    • HTTP

      • Chapter 1 - Introduction to NetX Duo HTTP
      • Chapter 2 - Installation and Use of NetX Duo HTTP
      • Chapter 3 - Description of NetX Duo HTTP Services
    • iperf

      • Chapter 1 - Introduction to NetX Duo Iperf
      • Chapter 2 - Installing and using NetX Duo Iperf
      • Chapter 3 - Running the UDP Transmit Test
    • mDNS

      • Chapter 1 - Introduction to NetX Duo mDNS/DNS-SD
      • Chapter 2 - Installation and use of mDNS
      • Chapter 3 - Description of internal service cache
      • Chapter 4 - Description of mDNS services
    • mqtt

      • Chapter 1 - Introduction to NetX Duo MQTT
      • Chapter 2 - Installation and use of NetX Duo MQTT client
      • Chapter 3 - Description of NetX Duo MQTT Client Services
    • NAT

      • Chapter 1 - An introduction to Network Address Translation
      • Chapter 2 - Installation and use of NAT
      • Chapter 3 - NAT configuration options
      • Chapter 4 - Description of NAT services
    • POP3 Client

      • Chapter 1 - Introduction to NetX Duo POP3
      • Chapter 2 - Installation and use of NetX Duo POP3 Client
      • Chapter 3 - Description of POP3 Client services
    • PPP

      • Chapter 1 - Introduction to the NetX Duo Point-to-Point Protocol (PPP)
      • Chapter 2 - Installation and use of NetX Duo Point-to-Point Protocol (PPP)
      • Chapter 3 - Description of NetX Duo Point-to-Point Protocol (PPP) services
    • PTP Client

      • Chapter 1 - Introduction to NetX Duo PTP Client
      • Chapter 2 - Installation and Use of NetX Duo PTP Client
      • Chapter 3 - Description of NetX Duo PTP Client Services
    • rtp

      • Chapter 1 - Introduction to the NetX Duo RTP Sender
      • Chapter 2 - Installation and use of NetX Duo RTP Sender
      • Chapter 3 - Description of NetX Duo RTP Sender Services
    • rtsp

      • Chapter 1 - Introduction to the NetX Duo RTSP Server
      • Chapter 2 - Installation and use of NetX Duo RTSP Server
      • Chapter 3 - Description of NetX Duo RTSP Server Services
    • Secure DTLS

      • Chapter 1 - Introduction to NetX Duo Secure DTLS
      • Chapter 2 - Installation and use of NetX Duo Secure DTLS
      • Chapter 3 - Functional description of NetX Duo Secure DTLS
      • Chapter 4 - Description of NetX Duo Secure DTLS services
      • Appendix A - NetX Duo Secure DTLS return/error codes
    • Secure TLS

      • Chapter 1 - Introduction to NetX Duo Secure
      • Chapter 2 - Installation and use of NetX Duo Secure
      • Chapter 3 - Functional description of NetX Duo Secure
      • Chapter 4 - Description of NetX Duo Secure services
      • Appendix A - NetX Duo Secure return/error codes
    • SMTP Client

      • Chapter 1 - Introduction to NetX Duo SMTP client
      • Chapter 2 - Installation and use of NetX Duo SMTP client
      • Chapter 3 - Client description of SMTP Client services
    • snmp

      • Chapter 1 - Introduction to NetX Duo SNMP
      • Chapter 2 - Installation and use of the NetX Duo SNMP agent
      • Chapter 3 - Description of NetX Duo SNMP agent services
    • sntp client

      • Chapter 1 - Introduction to NetX Duo SNTP
      • Chapter 2 - Installation and Use of NetX Duo SNTP Client
      • Chapter 3 - Description of NetX Duo SNTP Client Services
      • Appendix A - NetX Duo SNTP Fatal Error Codes
    • telnet

      • Chapter 1 - Introduction to NetX Duo Telnet
      • Chapter 2 - Installation and use of NetX Duo Telnet
      • Chapter 3 - Description of NetX Duo Telnet services
    • TFTP

      • Chapter 1 - Introduction to NetX Duo TFTP
      • Chapter 2 - Installation and use of NetX Duo TFTP
      • Chapter 3 - Description of NetX Duo TFTP services
    • Web HTTP

      • Chapter 1 - Introduction to HTTP and HTTPS
      • Chapter 2 - Installation and use of HTTP and HTTPS
      • Chapter 3 - Description of HTTP services
    • About the NetX Duo User Guide

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

  • auto_ip_ptr: Pointer to AutoIP control block.
  • name: Name of AutoIP instance.
  • ip_ptr: Pointer to IP instance.
  • stack_ptr: Pointer to AutoIP thread stack area.
  • stack_size: Size of the AutoIP thread stack area.
  • priority: Priority of the AutoIP thread.

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

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP create.
  • NX_AUTO_IP_ERROR: (0xA00) AutoIP create error.
  • NX_PTR_ERROR: (0x16) Invalid AutoIP, ip_ptr, or stack pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

  • auto_ip_ptr: Pointer to AutoIP control block.

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP delete.
  • NX_AUTO_IP_ERROR: (0xA00) AutoIP delete error.
  • NX_PTR_ERROR: (0x16) Invalid AutoIP pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

  • auto_ip_ptr: Pointer to AutoIP control block.
  • local_ip_address: Destination for return IP address.

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP address get.
  • NX_AUTO_IP_NO_LOCAL: (0xA01) No valid AutoIP address.
  • NX_PTR_ERROR: (0x16) Invalid AutoIP pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

  • auto_ip_ptr: Pointer to AutoIP control block.
  • interface_index: Interface to probe IP address for

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP interface set
  • NX_AUTO_IP_BAD_INTERFACE_INDEX: (0xA02) Invalid network interface NX_PTR_ERROR (0x16) Invalid AutoIP pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

  • auto_ip_ptr: Pointer to AutoIP control block.
  • starting_local_address: Optional AutoIP starting address. A value of IP_ADDRESS(0,0,0,0) specifies that a random AutoIP address should be derived. Otherwise, if a valid AutoIP address is specified, NetX Duo AutoIP attempts to assign that address.

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP start.
  • NX_AUTO_IP_ERROR: (0xA00) AutoIP start error.
  • NX_PTR_ERROR: (0x16) Invalid AutoIP pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

  • auto_ip_ptr: Pointer to AutoIP control block.

Return Values

  • NX_SUCCESS: (0x00) Successful AutoIP stop.
  • NX_AUTO_IP_ERROR: (0xA00) AutoIP stop error.
  • NX_PTR_ERROR: (0x16) Invalid AutoIP pointer.
  • NX_CALLER_ERROR: (0x11) Invalid caller of this service.

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

Prev
Chapter 2 - Installation and use of NetX Duo AutoIP