home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / comm / amitcp-3.0ß2.lha / AmiTCP / src / amitcp / api / auto_netdb.c < prev    next >
Text File  |  1994-02-28  |  9KB  |  289 lines

  1. #define NOTEX
  2. /****** bsdsocket.library/gethostbyaddr *************************************
  3. *
  4. *   SEE ALSO
  5. *        gethostbyname()
  6. *
  7. *****************************************************************************
  8. *
  9. */
  10.  
  11. /****** bsdsocket.library/gethostbyname *************************************
  12. *
  13. *   NAME
  14. *        gethostbyname, gethostbyaddr  - get network host entry
  15. *
  16. *   SYNOPSIS
  17. *        #include <sys/types.h>
  18. *        #include <sys/socket.h>
  19. *        #include <netdb.h>
  20. *
  21. *        hostent = gethostbyname(name)
  22. *        D0                      A0
  23. *
  24. *        struct hostent *gethostbyname(char *);
  25. *
  26. *        hostent = gethostbyaddr(addr, len, type)
  27. *        D0                      A0    D0   D1
  28. *
  29. *        struct hostent *gethostbyaddr(caddr_t, LONG, LONG);
  30. *
  31. *
  32. *   DESCRIPTION 
  33. *        gethostbyname() and gethostbyaddr() both return a pointer
  34. *        to an object with the following structure containing the
  35. *        data received from a name server or the broken-out fields
  36. *        of a line in netdb configuration file.  In the case of
  37. *        gethostbyaddr(), addr is a pointer to the binary format
  38. *        address of length len (not a character string) and type is
  39. *        an address family as defined in <sys/socket.h>. 
  40. *
  41. *          struct hostent {
  42. *            char *h_name;       /* official name of host */
  43. *            char **h_aliases;   /* alias list */
  44. *            int  h_addrtype;    /* address type */
  45. *            int  h_length;      /* length of address */
  46. *            char **h_addr_list; /* list of addresses from name server */
  47. *          };
  48. *
  49. *        The members of this structure are:
  50. *
  51. *        h_name              Official name of the host.
  52. *
  53. *        h_aliases           A zero  terminated  array  of  alternate
  54. *                            names for the host.
  55. *
  56. *        h_addrtype          The  type  of  address  being  returned;
  57. *                            currently always AF_INET.
  58. *
  59. *        h_length            The length, in bytes, of the address.
  60. *
  61. *        h_addr_list         A pointer to a list of network addresses
  62. *                            for  the named host.  Host addresses are
  63. *                            returned in network byte order.
  64. *
  65. *   DIAGNOSTICS
  66. *        A NULL pointer is returned if no matching entry was found or 
  67. *        error occured.
  68. *
  69. *   BUGS
  70. *        All information is contained in a static area so it must  be
  71. *        copied if it is to be saved.  Only the Internet address for-
  72. *        mat is currently understood.
  73. *
  74. *   SEE ALSO
  75. *        AmiTCP/IP configuration
  76. *
  77. *****************************************************************************
  78. *
  79. */
  80.  
  81. #define NOTEX
  82. /****** bsdsocket.library/getnetbyaddr **************************************
  83. *
  84. *   SEE ALSO
  85. *        getnetbyname()
  86. *
  87. *****************************************************************************
  88. *
  89. */
  90.  
  91. /****** bsdsocket.library/getnetbyname **************************************
  92. *
  93. *   NAME
  94. *        getnetbyname, getnetbyaddr - get network entry
  95. *
  96. *   SYNOPSIS
  97. *        #include <netdb.h>
  98. *
  99. *        netent = getnetbyname(name)
  100. *        D0                    A0
  101. *
  102. *        struct netent *getnetbyname(char *);
  103. *
  104. *        netent = getnetbyaddr(net, type)
  105. *        D0                    D0   D1
  106. *
  107. *        struct netent *getnetbyaddr(long, long);
  108. *
  109. *   DESCRIPTION
  110. *        getnetbyname(), and getnetbyaddr() both return  a  pointer to
  111. *        an  object  with  the  following  structure  containing   the
  112. *        broken-out fields of a line in netdb configuration file.
  113. *
  114. *          struct netent {
  115. *            char *n_name;       /* official name of net */
  116. *            char **n_aliases;   /* alias list */
  117. *            int  n_addrtype;    /* net number type */
  118. *            long n_net;         /* net number */
  119. *          };
  120. *
  121. *        The members of this structure are:
  122. *
  123. *        n_name              The official name of the network.
  124. *
  125. *        n_aliases           A  zero  terminated  list  of  alternate
  126. *                            names for the network.
  127. *
  128. *        n_addrtype          The type of the network number returned;
  129. *                            currently only AF_INET.
  130. *
  131. *        n_net               The network number.  Network numbers are
  132. *                            returned in machine byte order.
  133. *
  134. *        Network numbers are supplied in host order.
  135. *
  136. *        Type specifies the address type to use, currently only
  137. *        AF_INET is supported.
  138. *
  139. *   DIAGNOSTICS
  140. *        A NULL pointer is returned if no matching entry was found or 
  141. *        error occured.
  142. *
  143. *   BUGS
  144. *        All information is contained in a static area so it must  be
  145. *        copied if it is to be saved.
  146. *
  147. *        Only Internet network numbers are currently understood.
  148. *
  149. *   SEE ALSO
  150. *        AmiTCP/IP configuration
  151. *
  152. *****************************************************************************
  153. *
  154. */
  155.  
  156. /****** bsdsocket.library/getprotobyname ************************************
  157. *
  158. *   NAME
  159. *        getprotobyname, getprotobynumber - get protocol entry
  160. *
  161. *   SYNOPSIS
  162. *        #include <netdb.h>
  163. *
  164. *        protoent = getprotobyname(name)
  165. *        D0                        A0
  166. *
  167. *        struct protoent *getprotobyname(char *);
  168. *
  169. *        protoent = getprotobynumber(proto)
  170. *        D0                          D0
  171. *
  172. *        struct protoent *getprotobynumber(long);
  173. *
  174. *   DESCRIPTION
  175. *        getprotobyname() and getprotobynumber() both return a pointer
  176. *        to  an  object with the  following structure  containing  the
  177. *        broken-out fields of a line in netdb configuration file
  178. *
  179. *          struct    protoent {
  180. *            char *p_name;       /* official name of protocol */
  181. *            char **p_aliases;   /* alias list */
  182. *            int  p_proto;       /* protocol number */
  183. *         };
  184. *
  185. *        The members of this structure are:
  186. *
  187. *        p_name              The official name of the protocol.
  188. *        p_aliases           A  zero  terminated  list  of  alternate
  189. *                            names for the protocol.
  190. *        p_proto             The protocol number.
  191. *
  192. *
  193. *   DIAGNOSTICS
  194. *        A NULL pointer is returned if no matching entry was found or 
  195. *        error occured.
  196. *
  197. *   BUGS
  198. *        All information is contained in a static area so it must  be
  199. *        copied  if  it  is to be saved.  Only the Internet protocols
  200. *        are currently understood.
  201. *
  202. *   SEE ALSO
  203. *        AmiTCP/IP configuration
  204. *
  205. *****************************************************************************
  206. *
  207. */
  208.  
  209. #define NOTEX
  210. /****** bsdsocket.library/getprotobynumber **********************************
  211. *
  212. *   SEE ALSO
  213. *        getprotobyname()
  214. *
  215. *****************************************************************************
  216. *
  217. */
  218.  
  219. /****** bsdsocket.library/getservbyname *************************************
  220. *
  221. *   NAME
  222. *        getservbyname, getservbyport - get service entry
  223. *
  224. *   SYNOPSIS
  225. *        #include <netdb.h>
  226. *
  227. *        servent = getservbyname(name, proto)
  228. *        D0                      A0    A1
  229. *
  230. *        struct servent *getservbyname(char *, char *)
  231. *
  232. *        servent = getservbyport(port, proto)
  233. *        D0                      D0    A0
  234. *
  235. *        struct servent *getservbyport(long, char *);
  236. *
  237. *   DESCRIPTION
  238. *        getservbyname() and getservbyport() both return a pointer  to
  239. *        an   object  with  the  following  structure  containing  the
  240. *        broken-out fields of a line in netdb configuration file.
  241. *
  242. *          struct    servent {
  243. *            char *s_name;       /* official name of service */
  244. *            char **s_aliases;   /* alias list */
  245. *            int  s_port;        /* port service resides at */
  246. *            char *s_proto;      /* protocol to use */
  247. *          };
  248. *
  249. *        The members of this structure are:
  250. *             s_name              The official name of the service.
  251. *             s_aliases           A zero terminated list of alternate
  252. *                                 names for the service.
  253. *             s_port              The port number at which  the  ser-
  254. *                                 vice  resides.   Port  numbers  are
  255. *                                 returned  in  network  short   byte
  256. *                                 order.
  257.