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 string with a ``dotted-decimal'' representation of IP host h (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 * h )

str2ipHost

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

xkern_return_t str2ipHost ( IPhost * h, char * str )

ethHostStr

Returns a string with a representation of Ethernet host h (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 * h )

str2ethHost

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

xkern_return_t str2ethHost ( ETHhost * h, char * str )


Tue Nov 29 16:28:56 MST 1994