home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / contrib / dvx / inc / netdb.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  2.0 KB  |  71 lines

  1. /*
  2.  * DESQview/X Socket Library. Copyright (c) 1991 Quarterdeck Office Systems.
  3.  */
  4.  
  5. /*
  6.  * Copyright (c) 1983 Regents of the University of California.
  7.  * All rights reserved.  The Berkeley software License Agreement
  8.  * specifies the terms and conditions for redistribution.
  9.  */
  10.  
  11. /*      @(#)netdb.h    */
  12.  
  13. #ifndef __NETDB_H__
  14. #define __NETDB_H__
  15.  
  16. /*
  17.  * Structures returned by network data base library.  All addresses are
  18.  * supplied in host order, and returned in network order (suitable for
  19.  * use in system calls).
  20.  */
  21. struct    hostent {
  22.     char    *h_name;    /* official name of host */
  23.     char    **h_aliases;    /* alias list */
  24.     int    h_addrtype;    /* host address type */
  25.     int    h_length;    /* length of address */
  26.     char    **h_addr_list;    /* list of addresses from name server */
  27. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  28. };
  29.  
  30. struct  servent {
  31.         char    *s_name;        /* primary name of service */
  32.         char    **s_aliases;    /* other names of service */
  33.         short   s_port;         /* port number to use */
  34.         char    *s_proto;       /* protocol service is offered on */
  35. };
  36.  
  37. struct  protoent {
  38.         char    *p_name;        /* primary name of protocol */
  39.         char    **p_aliases;    /* other names of protocol */
  40.         short   p_proto;        /* protocol number */
  41. };
  42.  
  43.  
  44. #ifndef NO_PROTO
  45.  
  46. /* hosts C functions */
  47.  
  48.   struct hostent *gethostbyname(char *);
  49.   struct hostent *gethostbyaddr(char *,int,int);
  50.  
  51. /* services C functions */
  52.  
  53.   struct servent *getservbyname(char *,char *);
  54.   struct servent *getservbyport(int,char *);
  55.  
  56. /* protocol C functions */
  57.  
  58.   struct protoent *getprotobyname(char *);
  59.   struct protoent *getprotobynumber(int);
  60.  
  61. #else /* NO_PROTO */
  62.  
  63.     struct hostent      *gethostbyname(), *gethostbyaddr();
  64.     struct servent      *getservbyname(), *getservbyport();
  65.     struct protoent     *getprotobyname(), *getprotobynumber();
  66.  
  67. #endif /* NO_PROTO */
  68.  
  69. #endif /* __NETDB_H__ */
  70.  
  71.