Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SRC/netaddr.h File Reference


Detailed Description

Definition in file netaddr.h.

Go to the source code of this file.

Functions

W32_FUNC DWORD aton (const char *str)
 Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
W32_FUNC BOOL isaddr (const char *text)
 Check if 'str' is simply an ip address.
W32_FUNC int priv_addr (DWORD ip)
W32_FUNC DWORD aton_dotless (const char *str)
 Converts `[dotless]' or `dotless' to 32 bit long (host order).
W32_FUNC BOOL isaddr_dotless (const char *str, DWORD *ip)
 Check if 'str' is a dotless ip address.
W32_FUNC char * _inet_ntoa (char *s, DWORD x)
 Convert an IP-address 'ip' into a string.
W32_FUNC DWORD _inet_addr (const char *s)
 Convert a string into an IP-address.
W32_FUNC const char * _inet_atoeth (const char *src, eth_address *eth)
 Parse string "ether-addr, ip-addr".
W32_FUNC const char * _inet6_ntoa (const void *ip)
 Convert an IPv6-address 'ip' into a string.
W32_FUNC const ip6_address_inet6_addr (const char *str)
 Convert a string 'str' into an IPv6-address.


Function Documentation

W32_FUNC const ip6_address* _inet6_addr const char *  str  ) 
 

Convert a string 'str' into an IPv6-address.

Return values:
static buffer for address.
NULL 'str' isn't a valid IPv6 address.
Definition at line 411 of file netaddr.c.

References inet_pton(), and ip6_address.

W32_FUNC const char* _inet6_ntoa const void *  ip  ) 
 

Convert an IPv6-address 'ip' into a string.

Return values:
static string.
Warning:
Not reentrant.
Definition at line 393 of file netaddr.c.

References inet_ntop().

W32_FUNC DWORD _inet_addr const char *  s  ) 
 

Convert a string into an IP-address.

Return values:
address on host order.
0 string isn't a (dotless) address.
Definition at line 66 of file netaddr.c.

W32_FUNC const char* _inet_atoeth const char *  src,
eth_address p_eth
 

Parse string "ether-addr, ip-addr".

DOSX == 0: Assumes 'src' contain only legal hex-codes and ':' separators. Doesn't waste precious memory using sscanf() if DOSX==0.

Read 'src', dump to ethernet buffer ('*p_eth') and return pointer to "ip-addr". Definition at line 202 of file netaddr.c.

References atox(), BYTE, eth_address, and strltrim().

W32_FUNC char* _inet_ntoa char *  s,
DWORD  ip
 

Convert an IP-address 'ip' into a string.

Return values:
'p'. 
Note:
'ip' is on host order.
Definition at line 40 of file netaddr.c.

W32_FUNC DWORD aton const char *  str  ) 
 

Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.

Return values:
0 on error (safer than -1)
IPv4 address (host order)
Definition at line 83 of file netaddr.c.

W32_FUNC DWORD aton_dotless const char *  str  ) 
 

Converts `[dotless]' or `dotless' to 32 bit long (host order).

Return values:
0 on error (safer than -1)
Definition at line 112 of file netaddr.c.

References DWORD, and isaddr_dotless().

W32_FUNC BOOL isaddr const char *  str  ) 
 

Check if 'str' is simply an ip address.

Accepts 'a.b.c.d' or '[a.b.c.d]' forms.

Return values:
TRUE if 'str' is an IPv4 address.
Definition at line 125 of file netaddr.c.

W32_FUNC BOOL isaddr_dotless const char *  str,
DWORD ip
 

Check if 'str' is a dotless ip address.

Accept "[ 0-9\[\]]+". Doesn't accept octal base.

Return values:
TRUE if 'str' is a dotless address.
Definition at line 145 of file netaddr.c.

References DWORD.


Generated on Wed Aug 4 08:55:56 2010 for Watt-32 tcp/ip by doxygen 1.3.8