User`s guide
166
K
A
DAK
KwikNet Low Level Services
kn_inet_ntoa kn_inet_ntoa
Purpose Convert a Numeric IP Address to Dotted Decimal String Form
Used by
n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure
Setup Prototype is in file KN_API.H.
#include "KN_LIB.H"
int kn_inet_ntoa(struct in_addr *inadrp, char *sp);
Description Inadrp is a pointer to a structure containing an IPv4 address in net endian
form. The BSD structure in_addr is defined in Treck header file
TRSOCKET.H as follows:
struct in_addr {
u_long s_addr; /* IP address (net endian) */
};
Sp
is a pointer to storage for the string showing the IPv4 address in dotted
decimal form.
Returns The formatted string is stored at *sp and the length of that string is
returned. The length is a positive value. The string is terminated with a
'\0' character.
The IP address 0x7F000017 will produce the string "127.0.0.23".
Note Unlike its BSD counterpart inet_ntoa(), this KwikNet procedure is
reentrant. It also uses structure in_addr to hold the IP address.
Example See example in the description of kn_dprintf().
See Also
kn_inet_addr()