2 /****** bsdsocket.library/gethostbyaddr *************************************
7 *****************************************************************************
11 /****** bsdsocket.library/gethostbyname *************************************
14 * gethostbyname, gethostbyaddr - get network host entry
17 * #include <sys/types.h>
18 * #include <sys/socket.h>
21 * hostent = gethostbyname(name)
24 * struct hostent *gethostbyname(char *);
26 * hostent = gethostbyaddr(addr, len, type)
29 * struct hostent *gethostbyaddr(caddr_t, LONG, LONG);
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>.
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 *\
49 * The members of this structure are:
51 * h_name Official name of the host.
53 * h_aliases A zero terminated array of alternate
56 * h_addrtype The type of address being returned;
57 * currently always AF_INET.
59 * h_length The length, in bytes, of the address.
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.
66 * A NULL pointer is returned if no matching entry was found or
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.
75 * AmiTCP/IP configuration
77 *****************************************************************************
82 /****** bsdsocket.library/getnetbyaddr **************************************
87 *****************************************************************************
91 /****** bsdsocket.library/getnetbyname **************************************
94 * getnetbyname, getnetbyaddr - get network entry
99 * netent = getnetbyname(name)
102 * struct netent *getnetbyname(char *);
104 * netent = getnetbyaddr(net, type)
107 * struct netent *getnetbyaddr(long, long);
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.
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 *\
121 * The members of this structure are:
123 * n_name The official name of the network.
125 * n_aliases A zero terminated list of alternate
126 * names for the network.
128 * n_addrtype The type of the network number returned;
129 * currently only AF_INET.
131 * n_net The network number. Network numbers are
132 * returned in machine byte order.
134 * Network numbers are supplied in host order.
136 * Type specifies the address type to use, currently only
137 * AF_INET is supported.
140 * A NULL pointer is returned if no matching entry was found or
144 * All information is contained in a static area so it must be
145 * copied if it is to be saved.
147 * Only Internet network numbers are currently understood.
150 * AmiTCP/IP configuration
152 *****************************************************************************
156 /****** bsdsocket.library/getprotobyname ************************************
159 * getprotobyname, getprotobynumber - get protocol entry
164 * protoent = getprotobyname(name)
167 * struct protoent *getprotobyname(char *);
169 * protoent = getprotobynumber(proto)
172 * struct protoent *getprotobynumber(long);
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
180 * char *p_name; \* official name of protocol *\
181 * char **p_aliases; \* alias list *\
182 * int p_proto; \* protocol number *\
185 * The members of this structure are:
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.
194 * A NULL pointer is returned if no matching entry was found or
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.
203 * AmiTCP/IP configuration
205 *****************************************************************************
210 /****** bsdsocket.library/getprotobynumber **********************************
215 *****************************************************************************
219 /****** bsdsocket.library/getservbyname *************************************
222 * getservbyname, getservbyport - get service entry
227 * servent = getservbyname(name, proto)
230 * struct servent *getservbyname(char *, char *)
232 * servent = getservbyport(port, proto)
235 * struct servent *getservbyport(long, char *);
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.
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 *\
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
257 * s_proto The name of the protocol to use
258 * when contacting the service.
260 * The proto argument specifies the protocol for which to the
261 * sercive is to use. It is a normal C string, e.g. "tcp" or
265 * A NULL pointer is returned if no matching entry was found or
269 * All information is contained in a static area so it must be
270 * copied if it is to be saved. Expecting port numbers to fit
271 * in a 32 bit quantity is probably naive.
274 * AmiTCP/IP configuration
276 *****************************************************************************
281 /****** bsdsocket.library/getservbyport *************************************
286 *****************************************************************************