

Please wait until the page is fully downloaded and then press the "Expand" button or the blue line numbers.
0090000 /*-
0090001 * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
0090002 * All rights reserved.
0090003 *
0090004 * Redistribution and use in source and binary forms, with or without
0090005 * modification, are permitted provided that the following conditions
0090006 * are met:
0090007 * 1. Redistributions of source code must retain the above copyright
0090008 * notice, this list of conditions and the following disclaimer.
0090009 * 2. Redistributions in binary form must reproduce the above copyright
0090010 * notice, this list of conditions and the following disclaimer in the
0090011 * documentation and/or other materials provided with the distribution.
0090012 * 3. All advertising materials mentioning features or use of this software
0090013 * must display the following acknowledgement:
0090014 * This product includes software developed by the University of
0090015 * California, Berkeley and its contributors.
0090016 * 4. Neither the name of the University nor the names of its contributors
0090017 * may be used to endorse or promote products derived from this software
0090018 * without specific prior written permission.
0090019 *
0090020 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
0090021 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0090022 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0090023 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
0090024 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0090025 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0090026 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0090027 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0090028 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0090029 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0090030 * SUCH DAMAGE.
0090031 *
0090032 * @(#)netdb.h 5.15 (Berkeley) 4/3/91
0090033 */
0090034
0090035 #ifndef _NETDB_H_
0090036 #define _NETDB_H_
0090037
0090038 #define _PATH_HEQUIV "/etc/hosts.equiv"
0090039 #define _PATH_HOSTS "/etc/hosts"
0090040 #define _PATH_NETWORKS "/etc/networks"
0090041 #define _PATH_PROTOCOLS "/etc/protocols"
0090042 #define _PATH_SERVICES "/etc/services"
0090043 #define _PATH_SERVACCES "/etc/serv.access"
0090044
0090045 /*
0090046 * Structures returned by network data base library. All addresses are
0090047 * supplied in host order, and returned in network order (suitable for
0090048 * use in system calls).
0090049 */
0090050 struct hostent {
0090051 char *h_name; /* official name of host */
0090052 char **h_aliases; /* alias list */
0090053 int h_addrtype; /* host address type */
0090054 int h_length; /* length of address */
0090055 char **h_addr_list; /* list of addresses from name server */
0090056 #define h_addr h_addr_list[0] /* address, for backward compatiblity */
0090057 };
0090058
0090059 /*
0090060 * Assumption here is that a network number
0090061 * fits in 32 bits -- probably a poor one.
0090062 */
0090063 struct netent {
0090064 char *n_name; /* official name of net */
0090065 char **n_aliases; /* alias list */
0090066 int n_addrtype; /* net address type */
0090067 unsigned long n_net; /* network # */
0090068 };
0090069
0090070 struct servent {
0090071 char *s_name; /* official service name */
0090072 char **s_aliases; /* alias list */
0090073 int s_port; /* port # */
0090074 char *s_proto; /* protocol to use */
0090075 };
0090076
0090077 struct protoent {
0090078 char *p_name; /* official protocol name */
0090079 char **p_aliases; /* alias list */
0090080 int p_proto; /* protocol # */
0090081 };
0090082
0090083 /*
0090084 * Error return codes from gethostbyname() and gethostbyaddr()
0090085 * (left in extern int h_errno).
0090086 */
0090087 extern int h_errno;
0090088
0090089 #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
0090090 #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
0090091 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
0090092 #define NO_DATA 4 /* Valid name, no data record of requested type */
0090093 #define NO_ADDRESS NO_DATA /* no address, look for MX record */
0090094
0090095 #ifndef _ANSI_H
0090096 #include <ansi.h>
0090097 #endif
0090098
0090099 void endhostent _ARGS((void));
0090100 void endnetent _ARGS((void));
0090101 void endprotoent _ARGS((void));
0090102 void endservent _ARGS((void));
0090103 struct hostent *gethostbyaddr _ARGS((const char *, int, int));
0090104 struct hostent *gethostbyname _ARGS((const char *));
0090105 struct hostent *gethostent _ARGS((void));
0090106 struct netent *getnetbyaddr _ARGS((long, int)); /* u_long? */
0090107 struct netent *getnetbyname _ARGS((const char *));
0090108 struct netent *getnetent _ARGS((void));
0090109 struct protoent *getprotobyname _ARGS((const char *));
0090110 struct protoent *getprotobynumber _ARGS((int));
0090111 struct protoent *getprotoent _ARGS((void));
0090112 struct servent *getservbyname _ARGS((const char *, const char *));
0090113 struct servent *getservbyport _ARGS((int, const char *));
0090114 struct servent *getservent _ARGS((void));
0090115 void herror _ARGS((const char *));
0090116 void sethostent _ARGS((int));
0090117 /* void sethostfile _ARGS((const char *)); */
0090118 void setnetent _ARGS((int));
0090119 void setprotoent _ARGS((int));
0090120 void setservent _ARGS((int));
0090121 #ifdef _MINIX
0090122 int servxcheck _ARGS((int _fd, const char *_service,
0090123 void (*_logf) _ARGS((int _pass, const char *_name))));
0090124 char *servxfile _ARGS((const char *_file));
0090125 #endif
0090126
0090127 #endif /* !_NETDB_H_ */