home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1999 February / MACPOWER-1999-02.ISO.7z / MACPOWER-1999-02.ISO / 9902⁄AMUG / UTILITY / mac06-0.95.sit / mac06-0.95 / usr / include / netdb.h < prev    next >
Text File  |  1998-11-01  |  1KB  |  47 lines

  1. /* mac06ゥ1997,98 by HNS/DSITRI hns@computer.org
  2. ** netdb.h
  3. */
  4.  
  5. #pragma once
  6.  
  7. /* host lookup */
  8.  
  9. struct hostent
  10.     {
  11.     char *h_name;        /* primary host name */
  12.     char **h_aliases;    /* NULL terminated list of aliases */
  13.     int h_addrtype;        /* type of address AF_INET */
  14.     int h_len;            /* length of addr in h_addr_list (4) */
  15.     void **h_addr_list;    /* NULL terminated list of addresses */
  16. #define h_addr h_addr_list[0]    /* for compatibility */
  17.     };
  18.  
  19. struct hostent *gethostbyname(char *name);
  20. struct hostent *gethostbyaddr(void *addr, int len, int family);
  21.  
  22. /* service (well known port) lookup */
  23.  
  24. struct servent
  25.     {
  26.     unsigned short s_port;
  27.     char *s_proto;
  28.     char *s_name;
  29.     char **s_aliases;
  30.     };
  31.  
  32. struct servent *getservbyname(char *name, char *proto);
  33. struct servent *getservbyport(short port, char *proto);
  34.  
  35. struct protoent
  36.     {
  37.     int p_family;    /* protocol family */
  38.     char *p_name;
  39.     char **p_aliases;
  40.     int p_proto;    /* protocol name */
  41.     int p_type;        /* socket type for this protocol */
  42.     };
  43.  
  44. struct protoent *getprotobyname(char *name, int family);
  45. struct protoent *getprotobynumber(short number, int family);
  46.  
  47. /* EOF */