Hosts Map Type

This section explains the hosts map type.

The following is the required prototype for a user-defined hosts map class:

  void * ho_pvtinit();
  void ho_close(void *private);
  struct hostent * ho_byname(void *private, const char *name);
  struct hostent * ho_byname2(void *private, const char *name, int af);
  struct hostent * ho_byaddr(void *private, const void *addr, size_t len, int af);
  struct hostent * ho_next(void *private);
  void ho_rewind(void *private);
  void ho_minimize(void *private);

Function ho_pvtinit must exist. It is not required to return anything more than NULL. For example, the function can return NULL if the calling routine does not need private data.

Functions other than ho_pvtinit are optional for this class. The module can provide none or only part of the optional functions in its definition.