The <inet.h>
header defines several functions useful for Internet address manipulation.
Functions and Macros
inet_addr Function
Purpose
Interprets the specified character string and returns a number suitable for use as an Internet address.
Declared In
posix/arpa/inet.h
Prototype
in_addr_t inet_addr (
const char *cp
)
Parameters
Returns
Returns a number suitable for use as an Internet address.
Comments
This is a standard network function.
Compatibility
This function is not in the C99 specification.
See Also
inet_aton Function
Purpose
Interprets the specified character string as an Internet address, placing the address into the structure provided.
Declared In
posix/arpa/inet.h
Prototype
int inet_aton ( const char *cp
, struct in_addr *addr
)
Parameters
Returns
Returns 1 if the string was successfully interpreted, or zero (0) if the string is invalid.
Comments
This is a non-standard network function.
Compatibility
This function is not in the C99 specification.
This function is a Palm OS extension (not present in C99 or Unix).
inet_lnaof Function
Purpose
Breaks apart the specified Internet host address and returns the local network address part (in host order).
Declared In
posix/arpa/inet.h
Prototype
in_addr_t inet_lnaof (
struct in_addr in
)
Parameters
Returns
Returns the local network address (in host order).
Comments
This is a non-standard network function.
Compatibility
This function is not in the C99 specification.
This function is a Palm OS extension (not present in C99 or Unix).
See Also
inet_makeaddr Function
Purpose
Takes an Internet network number and a local network address (both in host order) and constructs an Internet address from it.
Declared In
posix/arpa/inet.h
Prototype
struct in_addr inet_makeaddr ( intnet
, intlna
)
Parameters
Returns
Comments
This is a non-standard network function.
Compatibility
This function is not in the C99 specification.
This function is a Palm OS extension (not present in C99 or Unix).
inet_netof Function
Purpose
Breaks apart the specified Internet host address and returns the network number part (in host order).
Declared In
posix/arpa/inet.h
Prototype
in_addr_t inet_netof (
struct in_addr in
)
Parameters
Returns
Returns the network number (in host order).
Comments
This is a non-standard network function.
Compatibility
This function is not in the C99 specification.
This function is a Palm OS extension (not present in C99 or Unix).
See Also
inet_network Function
Purpose
Interprets the specified character string and returns a number suitable for use as an Internet network number.
Declared In
posix/arpa/inet.h
Prototype
in_addr_t inet_network (
const char *cp
)
Parameters
Returns
Returns a number suitable for use as an Internet network number.
Comments
This is a non-standard network function.
Compatibility
This function is not in the C99 specification.
This function is a Palm OS extension (not present in C99 or Unix).
See Also
inet_ntoa Function
Purpose
Takes an Internet address and returns an ASCII string representing the address.
Declared In
posix/arpa/inet.h
Prototype
const char *inet_ntoa (
struct in_addr in
)
Parameters
Returns
Returns a pointer to an ASCII string representing the address.
Comments
This is a standard network function.
Compatibility
This function is not in the C99 specification.
inet_ntop Function
Purpose
Converts a network format address to presentation format.
Declared In
posix/arpa/inet.h
Prototype
const char *inet_ntop ( intaf
, const void *src
, char *dst
, size_tsize
)
Parameters
-
→ af
- The address family.
-
→ src
- The source buffer.
-
→ dst
- The destination buffer.
-
→ size
- The size of the destination buffer.
Returns
Returns a pointer to the destination buffer. Otherwise, NULL
is returned if a system error occurs and the global variable errno
is set to indicate the error.
Comments
This is a standard network function.
Compatibility
This function is not in the C99 specification.
inet_pton Function
Purpose
Converts a presentation format address to network format.
Declared In
posix/arpa/inet.h
Prototype
int inet_pton ( intaf
, const char *src
, void *dst
)
Parameters
-
→ af
- The address family.
-
→ src
- The printable form as specified in a character string.
-
→ dst
- The destination string.
Returns
Returns 1 if the address was valid for the specified address family, or zero (0) if the address was not parseable in the specified address family, or -1 if some system error occurred (in which case the global variable errno
is set to indicate the error).
Comments
This is a standard network function.
Compatibility
This function is not in the C99 specification.