Next: , Previous: Sockets, Up: Sockets


5.13.1 Host and Other Inquiries

— Constant: af_inet
— Constant: af_unix

Integer family codes for Internet and Unix sockets, respectively.

— Function: gethost host-spec
— Function: gethost

Returns a vector of information for the entry for HOST-SPEC or the next entry if HOST-SPEC isn't given. The information is:

  1. host name string
  2. list of host aliases strings
  3. integer address type (AF_INET)
  4. integer size of address entries (in bytes)
  5. list of integer addresses

— Function: sethostent stay-open
— Function: sethostent

Rewinds the host entry table back to the begining if given an argument. If the argument stay-open is #f queries will be be done using UDP datagrams. Otherwise, a connected TCP socket will be used. When called without an argument, the host table is closed.

— Function: getnet name-or-number
— Function: getnet

Returns a vector of information for the entry for name-or-number or the next entry if an argument isn't given. The information is:

  1. official network name string
  2. list of network aliases strings
  3. integer network address type (AF_INET)
  4. integer network number

— Function: setnetent stay-open
— Function: setnetent

Rewinds the network entry table back to the begining if given an argument. If the argument stay-open is #f the table will be closed between calls to getnet. Otherwise, the table stays open. When called without an argument, the network table is closed.

— Function: getproto name-or-number
— Function: getproto

Returns a vector of information for the entry for name-or-number or the next entry if an argument isn't given. The information is:

  1. official protocol name string
  2. list of protocol aliases strings
  3. integer protocol number

— Function: setprotoent stay-open
— Function: setprotoent

Rewinds the protocol entry table back to the begining if given an argument. If the argument stay-open is #f the table will be closed between calls to getproto. Otherwise, the table stays open. When called without an argument, the protocol table is closed.

— Function: getserv name-or-port-number protocol
— Function: getserv

Returns a vector of information for the entry for name-or-port-number and protocol or the next entry if arguments aren't given. The information is:

  1. official service name string
  2. list of service aliases strings
  3. integer port number
  4. protocol

— Function: setservent stay-open
— Function: setservent

Rewinds the service entry table back to the begining if given an argument. If the argument stay-open is #f the table will be closed between calls to getserv. Otherwise, the table stays open. When called without an argument, the service table is closed.