Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Convert an IPv4 address in host-order into an IPv4 dotted-decimal notation ASCII string.

Files

net_ascii.h/net_ascii.c

Prototype

Arguments

addr_ip

IPv4 address (in host-order).

...

Select formatting the IPv4 address string with leading zeros (‘0’) prior to the first non-zero digit in each IP IPv4 address byte. The number of leading zeros added is such that each byte’s total number of decimal digits is equal to the maximum number of digits for each byte (i.e., 3).

...

Prepend leading zeros to each IP address byte

perrp_err

Pointer to variable that will receive the return error code from this function:

NET_ASCII_ERR_NONE
NET_ASCIIERR_ERRFAULT_NULL_PTR
NET_ASCII_ERR_INVALID_CHAR_LEN

Returned Value

None.

Required Configuration

None.

Notes / Warnings

RFC 1983 states that “dotted-decimal notation... refers [to] IP IPv4 addresses of the form A.B.C.D; where each letter represents, in decimal, one byte of a four-byte IP IPv4 address.” In other words, the dotted-decimal notation separates four decimal byte values by the dot, or period, character (‘.’). Each decimal value represents one byte of the IP IPv4 address starting with the most significant byte in network order.

...

Most Significant Byte in Dotted-Decimal IP IPv4 Address

LSB

Least Significant Byte in Dotted-Decimal IP IPv4 Address