home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / h / netdb < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.7 KB  |  77 lines

  1. /* -*-C-*-
  2.  *
  3.  * $Header: /ax/networking:include/netdb.h:networking  1.1  $
  4.  * $Source: /ax/networking:include/netdb.h: $
  5.  *
  6.  * Copyright (c) 1995 Acorn Computers Ltd., Cambridge, England
  7.  *
  8.  * $Log:    netdb.h,v $
  9.  * Revision 1.1  95/01/11  10:21:37  kwelton
  10.  * Initial revision
  11.  * 
  12.  */
  13.  
  14. /*
  15.  * Copyright (c) 1982, 1986 Regents of the University of California.
  16.  * All rights reserved.
  17.  * 
  18.  * Redistribution and use in source and binary forms are permitted
  19.  * provided that the above copyright notice and this paragraph are
  20.  * duplicated in all such forms and that any documentation,
  21.  * advertising materials, and other materials related to such
  22.  * distribution and use acknowledge that the software was developed
  23.  * by the University of California, Berkeley.  The name of the
  24.  * University may not be used to endorse or promote products derived
  25.  * from this software without specific prior written permission.
  26.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  27.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  28.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  29.  */
  30.  
  31. /*
  32.  * Structures returned by network
  33.  * data base library.  All addresses
  34.  * are supplied in host order, and
  35.  * returned in network order (suitable
  36.  * for use in system calls).
  37.  */
  38. struct  hostent {
  39.         char    *h_name;        /* official name of host */
  40.         char    **h_aliases;    /* alias list */
  41.         int     h_addrtype;     /* host address type */
  42.         int     h_length;       /* length of address */
  43.         char    **h_addr_list;  /* list of addresses returned */
  44. #define h_addr  h_addr_list[0]  /* address, for backward compatibility */
  45. };
  46.  
  47. /*
  48.  * Assumption here is that a network number
  49.  * fits in 32 bits -- probably a poor one.
  50.  */
  51. struct  netent {
  52.         char            *n_name;        /* official name of net */
  53.         char            **n_aliases;    /* alias list */
  54.         int             n_addrtype;     /* net address type */
  55.         unsigned long   n_net;          /* network # */
  56. };
  57.  
  58. struct  servent {
  59.         char    *s_name;        /* official service name */
  60.         char    **s_aliases;    /* alias list */
  61.         int     s_port;         /* port # */
  62.         char    *s_proto;       /* protocol to use */
  63. };
  64.  
  65. struct  protoent {
  66.         char    *p_name;        /* official protocol name */
  67.         char    **p_aliases;    /* alias list */
  68.         int     p_proto;        /* protocol # */
  69. };
  70.  
  71. struct hostent  *gethostbyname(), *gethostbyaddr(), *gethostent();
  72. struct netent   *getnetbyname(), *getnetbyaddr(), *getnetent();
  73. struct servent  *getservbyname(), *getservbyport(), *getservent();
  74. struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();
  75.  
  76. /* EOF netdb.h */
  77.