home *** CD-ROM | disk | FTP | other *** search
- /*
- * This file was automatically generated by vpp on Tue Aug 18 19:28:28 1998
- * based on version template file: ./netdb.vh
- */
- /*
- * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
- *
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
- * SANTA CRUZ OPERATION INC.
- *
- * The copyright notice above does not evidence any actual or intended
- * publication of such source code.
- */
-
- #ident "@(#)netdb.vh 1.4"
-
- /*
- * Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved.
- * Portions of this document are derived from
- * software developed by the University of
- * California, Berkeley, and its contributors.
- */
-
- /*
- * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- * PROPRIETARY NOTICE (Combined)
- *
- * This source code is unpublished proprietary information
- * constituting, or derived under license from AT&T's UNIX(r) System V.
- * In addition, portions of such source code were derived from Berkeley
- * 4.3 BSD under license from the Regents of the University of
- * California.
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Copyright Notice
- *
- * Notice of copyright on this source code product does not indicate
- * publication.
- *
- * (c) 1986,1987,1988.1989 Sun Microsystems, Inc
- * (c) 1983,1984,1985,1986,1987,1988,1989,1990 AT&T.
- * (c) 1990,1991 UNIX System Laboratories, Inc.
- * All rights reserved.
- *
- */
-
- /*
- * Structures returned by network data base library.
- * All addresses are supplied in host order, and
- * returned in network order (suitable for use in system calls).
- */
-
- #ifndef _NETDB_H
- #define _NETDB_H
-
- #include <sys/bitypes.h>
- #include <sys/cdefs.h>
- #include <sys/convsa.h>
- #include <netinet/in.h>
-
- __BEGIN_DECLS
-
- /* XPG4 Version 2 typedefs */
- #ifndef _SIZE_T
- #define _SIZE_T
- typedef unsigned int size_t;
- #endif
-
- struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
- #define h_addr h_addr_list[0] /* address, for backward compatiblity */
- };
-
- /*
- * Assumption here is that a network number
- * fits in 32 bits -- probably a poor one.
- */
- struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- in_addr_t n_net; /* network # = XPG4 V2 type */
- };
-
- struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
- };
-
- struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
- };
-
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)
- /*
- * Flag values for getaddrinfo()
- */
- #define AI_PASSIVE 0x01 /* socket address is intended for bind() */
- #define AI_CANONNAME 0x02 /* request for canonical name */
-
- /*
- * Error values for getaddrinfo()
- */
- #define EAI_BADFLAGS 1 /* invalid value for ai_flags */
- #define EAI_NONAME 2 /* neither name nor service provided/found */
- #define EAI_AGAIN 3 /* temporary failure in name resolution */
- #define EAI_FAIL 4 /* non-recoverable failure in name resoln */
- #define EAI_NODATA 5 /* no address associated with name */
- #define EAI_FAMILY 6 /* ai_family not supported */
- #define EAI_SOCKTYPE 7 /* ai_socktype not supported */
- #define EAI_SERVICE 8 /* service not supported for ai_socktype */
- #define EAI_ADDRFAMILY 9 /* address family for name not supported */
- #define EAI_MEMORY 10 /* memory allocation failure */
- #define EAI_SYSTEM 11 /* system error */
-
- /*
- * Structure used by getaddrinfo()
- */
- struct addrinfo {
- int ai_flags; /* input flags */
- int ai_family; /* protofamily for socket */
- int ai_socktype; /* socket type */
- int ai_protocol; /* protocol for socket */
- int ai_addrlen; /* length of socket address */
- struct sockaddr *ai_addr; /* socket address */
- char *ai_canonname; /* canonical name for service locn */
- struct addrinfo *ai_next; /* pointer to next in list */
- };
-
- /*
- * Size hints for getnameinfo()
- */
- #define NI_MAXHOST 1025 /* Maximum host name including nul */
- #define NI_MAXSERV 32 /* Maximum service name incl. nul */
-
- /*
- * Flags used as 7th argument to getnameinfo()
- */
- #define NI_NOFQDN 0x0001 /* Return only hostname */
- #define NI_NUMERICHOST 0x0002 /* Return numeric host address */
- #define NI_NUMERICSERV 0x0004 /* Return numeric service port no. */
- #define NI_DGRAM 0x0008 /* Assume udp instead of tcp */
- #define NI_NAMEREQD 0x0010 /* Fail if no textual hostname */
-
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1) */
-
- #ifdef _REENTRANT
-
- #define h_errno (*_h_errno())
-
- #else /* ! _REENTRANT */
-
- extern int h_errno;
-
- #endif /* _REENTRANT */
-
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)
- #define MAXHOSTNAMELEN 256
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1) */
-
- /*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (when using the resolver)
- */
-
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)
- #define NETDB_INTERNAL -1 /* see errno */
- #define NETDB_SUCCESS 0 /* no problem */
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1) */
- #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
- #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
- #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
- #define NO_DATA 4 /* Valid name, no data record of requested type */
- #define NO_ADDRESS NO_DATA /* no address, look for MX record */
- #define NO_ERRORMEM 99 /* No memory could be allocated for error variable.*/
-
- void endhostent __P((void));
- void endnetent __P((void));
- void endprotoent __P((void));
- void endservent __P((void));
- struct hostent *gethostbyaddr __P((const void *, size_t, int));
- struct hostent *gethostbyname __P((const char *));
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)
- struct hostent *gethostbyname2 __P((const char *, int));
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1) */
- struct hostent *gethostent __P((void));
- struct netent *getnetbyaddr __P((in_addr_t, int));
- struct netent *getnetbyname __P((const char *));
- struct netent *getnetent __P((void));
- struct protoent *getprotobyname __P((const char *));
- struct protoent *getprotobynumber __P((int));
- struct protoent *getprotoent __P((void));
- struct servent *getservbyname __P((const char *, const char *));
- struct servent *getservbyport __P((int, const char *));
- struct servent *getservent __P((void));
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)
- const char *hstrerror __P((int));
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1) */
- void sethostent __P((int));
- void setnetent __P((int));
- void setprotoent __P((int));
- void setservent __P((int));
-
- #if !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED -0 >= 1)
- extern int rcmd __P((char **, unsigned short, char *, char *, char *,
- int *));
- extern int rexec __P((char **, int, char *, char *, char *, int *));
- extern int rresvport __P((int *));
- extern int ruserok __P((char *, int, char *, char *));
- extern int set_h_errno __P((int));
- extern int get_h_errno __P((void));
- extern const int *_h_errno __P((void));
- extern int ifignore __P((const char *, const char *));
- extern int getnetgrent __P((char **, char **, char **));
- extern int setnetgrent __P((char *));
- extern int endnetgrent __P((void));
- extern int innetgr __P((char *, char *, char *, char *));
-
- extern void freeaddrinfo __P((struct addrinfo *));
- extern char *gai_strerror __P((int));
-
-
-
- extern int _xgetaddrinfo __P((int, const char *, const char *, const struct addrinfo *, struct addrinfo **));
- extern int _xgetnameinfo __P((int, const struct sockaddr *, size_t, char *, size_t, char *, size_t, int));
-
- #ifdef _EFTSAFE
-
- #define getaddrinfo(__a1, __a2, __a3, __a4) _xgetaddrinfo(__NETLIB_VERSION__, __a1, __a2, __a3, __a4)
- #define getnameinfo(__a1, __a2, __a3, __a4, __a5, __a6, __a7) _xgetnameinfo(__NETLIB_VERSION__, __a1, __a2, __a3, __a4, __a5, __a6, __a7)
-
- #else /* !_EFTSAFE */
-
- #pragma weak _xgetaddrinfo
- #pragma weak _xgetnameinfo
-
- static int getaddrinfo(const char *__a1, const char *__a2, const struct addrinfo *__a3, struct addrinfo **__a4)
- {
- return _xgetaddrinfo(__NETLIB_VERSION__, __a1, __a2, __a3, __a4);
- }
-
- static int getnameinfo(const struct sockaddr *__a1, size_t __a2, char *__a3, size_t __a4, char *__a5, size_t __a6, int __a7)
- {
- return _xgetnameinfo(__NETLIB_VERSION__, __a1, __a2, __a3, __a4, __a5, __a6, __a7);
- }
-
- #endif /* !_EFTSAFE */
-
-
- /*
- * Do not use the following functions, they are internal non-standard
- * functions, they may change or be removed at any time.
- */
- extern struct hostent *
- __parse_hostent(char *, struct hostent *, int, int, int);
- extern struct servent *
- __parse_servent(char *, struct servent *, int);
-
- #endif /* !(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED -0 >= 1)*/
-
- __END_DECLS
-
- #endif /*!_NETDB_H*/
-