next up previous contents index
Next: Host Name Service Up: Utility Routines Previous: Checksum

Strings to Hosts

 

Utility routines exist for converting from string representations of IP and Ethernet addresses to their structural counterparts and vice-versa.

ipHostStr

 

Returns a pointer to a string with a ``dotted-decimal'' representation of IP host host (e.g., ``192.12.69.1''). This string is in a static buffer, so it must be copied if its value is to be preserved.

char *ipHostStr(IPhost *host)

str2ipHost

 

Interprets str as a ``dotted-decimal'' representation of an IP host and assigns the fields of host accordingly. The operation fails if str does not seem to be in dotted-decimal form.

XkReturn str2ipHost(IPhost *host, char *str)

ethHostStr

 

Returns a pointer to a string with a representation of Ethernet host host (e.g., ``8:0:2b:ef:23:11''). This string is in a static buffer, so it must be copied if its value is to be preserved.

char *ethHostStr(ETHhost *host)

str2ethHost

 

Interprets str as a six-hex-digit-colon-separated representation of an Ethernet host and assigns the fields of host accordingly. The operation fails if str does not seem to be in the correct format.

XkReturn str2ethHost(ETHhost *host, char *str)



Larry Peterson
Tue Jul 1 14:50:34 MST 1997