www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


inet_addr

Converts a dotted decimal IP address string to an unsigned long.

int inet_addr ( const char far *IPAddressStringPtr,
                unsigned long far *IPAddress );

Parameters

IPAddressStringPtr

Pointer to null terminated ASCII string of network address in dot notation.

IPAddress

Output parameter:  Pointer to a 32 bit location where binary equivalent to the provided ASCII IP address will be output. This IP address is stored in network byte order.

Return Value

0: success
non-zero: Invalid IP address.

SC1x3/SC2x Comments

This function applies only to IPv4 addresses.   The inet_pton API can be used for either IPv4 or IPv6 address conversions.

This legacy version of inet_addr() specified here is not compatible to the BSD 4.4 Socket API.   The inet_addr() function can be used in BSD 4.4 compatible mode if the compilation switch

     #define BSD44_SOCKET_API_STYLE

is defined in the user application prior to including the Beck C-Library header files.   Using this switch the C-Library TCPIP_Socket.H include file redefines inet_addr() to inet_addr_bsd().  The parameters to inet_addr_bsd() are identical to the parameters of the BSD4.4 socket inet_addr() function.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.00V1.00V1.00V0.90V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document