Generic Support Calls
5-3
Network Tools Library Support Functions
This function actually calls inet_aton(), which is the better form of the function.
Convert IP Address from String and Return in in_addr Structure
inet_aton
Syntax
int inet_aton( char *strptr, struct in_addr *pa );
Parameter(s)
strptr
Pointer character string
pa
Pointer to address structure
Return Value
1 on success or 0 on failure
Description
This function converts an IP address printed in a character string to a 32bit net-
work ordered IP address value. Note that leading 0’s in the address string are
interpreted as octal. The function returns write the IP address into the in_addr
structure pointed to by the pa parameter. The function returns 1 on success
and 0 on failure.
Add Host Network to Interface by IF Handle
NtAddNetwork
Syntax
HANDLE NtAddNetwork( HANDLE hIF, IPN IPHost, IPN IPMask );
Parameter(s)
hIF
Handle to target interface
IPHost
IP Host Address (in network format)
IPMask
IP Host Subnet Mask (in network format)
Return Value
Handle to network binding on success or NULL on failure.
Description
This function attempts to add the specified IP host address (and mask) to the
specified logical interface handle. The function returns a handle to the binding
that binds the IP address to the interface. On an error, the function returns
NULL. The most common error would be that adding the host address caused
a “duplicate IP” indication from another host.
Note: In place of this function, the caller should consider using the con-
figuration system with the CFGTAG_IPNET configuration entry (see sec-
tion 4.4.4).
Remove Host Network from Interface
NtRemoveNetwork
Syntax
void NtRemoveNetwork( HANDLE hBind );
Parameter(s)
hBind
Handle to network binding returned by NtAddNetwork()
Return Value
nothing
Description
This function removes a network that was previously added with NtAddNet-
work().