User`s guide
156
K
A
DAK
KwikNet Low Level Services
kn_ifaddress kn_ifaddress
Purpose Get the IP Address for a Network Interface
Used by
n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file KN_API.H.
#include "KN_LIB.H"
int kn_ifaddress(KN_NETDP netdp, struct in_addr *inadrp);
Description Netdp is a network descriptor pointer, the KwikNet handle used to identify
the network interface of interest.
Inadrp is a pointer to a structure into which the network's IPv4 address in
net endian form will be stored. 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) */
};
Returns If successful, a value of 0 is returned.
On failure, one of the following error status codes is returned:
KN_ERPARAM Parameter netdp does not refer to a valid network or
parameter inadrp is NULL.
KN_ERNETWORK The network interface is not up and hence does not
yet have a valid IP address.
On failure, the storage at *inadrp is unaltered.
See Also kn_ifinfo(), kn_netstats()