indexing
	description: "A host address."
	status: "See notice at end of class"
	date: "$Date$"
	revision: "$Revision$"

class interface
	HOST_ADDRESS

create 

	make
			-- Create a host address object.

	make_local
			-- Create a local host address object.

	make_from_name (a_name: STRING)
			-- Create host address from host name a_name.

	make_from_ip_number (an_ip_address: STRING)
			-- Create host address from IP number in dotted format.

feature -- Initialization

	make
			-- Create a host address object.

	make_from_ip_number (an_ip_address: STRING)
			-- Create host address from IP number in dotted format.

	make_from_name (a_name: STRING)
			-- Create host address from host name a_name.

	make_local
			-- Create a local host address object.
	
feature -- Access

	address_host: SPECIAL [CHARACTER]
			-- Special data zone
			-- (from TO_SPECIAL)
	
feature -- Measurement

	count: INTEGER
			-- Object address size
	
feature -- Comparison

	is_equal (other: like Current): BOOLEAN
			-- Are the two host address areas equal ?
		require -- from ANY
			other_not_void: other /= void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result
	
feature -- Conversion

	from_c (ptr: POINTER)
			-- Converts a c host address structure (address_in)
			-- to an eiffel address object.
	
feature -- Duplication

	copy (other: like Current)
			-- Reinitialize by copying the characters of other.
			-- (This is also used by clone)
		require -- from ANY
			other_not_void: other /= void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)
		ensure then
			new_result_count: count = other.count or else count = in_addr_size
	
feature -- Status_report

	host_address: STRING
			-- IP number (dotted format) of current address

	host_number: INTEGER
			-- IP number in long integer form of current address

	local_host_name: STRING
			-- Host name of the local machine
	
feature -- Status_setting

	set_address_from_name (a_name: STRING)
			-- Set the host address using the name provided in 'a_name'.
		require
			name_valid: a_name /= void and then not a_name.is_empty

	set_host_address (host_id: STRING)
			-- Set host address from dotted format string.
		require
			dotted_address_not_void: host_id /= void

	set_in_address_any
			-- Set host address to "in address any".
			-- This is a special address selected by the host machine.
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class HOST_ADDRESS