hostent

Defines an internet host.

Service:Networking

Structure

  #include <netdb.h>
  
  struct hostent 
  {
     char    *h_name; 
     char   **h_aliases; 
     short    h_addrtype; 
     short    h_length;   
     char   **h_addr_list;
  #define h_addr   h_addr_list[0] 
  };
  

Fields

h_name

Points to the official name of the host.

h_aliases

Points to the first element in a list of addresses of alternative names for the host (zero terminates the list).

h_addrtype

Specifies the type of address being returned (always AF_INET).

h_length

Specifies the length in bytes of the host’s address.

h_addr_list

Points to the first element (in network byte order) containing the addresses for the host (zero terminates the list).

h_addr

Specifies the first address in h_addr_list (for backward compatibility).