home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
nsu
/
root
/
usr
/
include
/
netdir.h
/
netdir
Wrap
Text File
|
1998-08-19
|
8KB
|
232 lines
/*
* This file was automatically generated by vpp on Mon Mar 9 19:49:20 1998
* based on version template file: ./netdir.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 "@(#)netdir.vh 1.3"
#ident "$Header: $"
/*
* netdir.h
*
* This is the include file that defines various structures and
* constants used by the netdir routines.
*/
#ifndef _NETDIR_H
#define _NETDIR_H
#include <netconfig.h>
#include <sys/cdefs.h>
#include <sys/convsa.h>
__BEGIN_DECLS
#ifdef _REENTRANT
#define _nderror (*_netdir_nderror())
#else /* !_REENTRANT */
extern int _nderror;
#endif /* _REENTRANT */
struct nd_addrlist {
int n_cnt; /* number of netbufs */
struct netbuf *n_addrs; /* the netbufs */
};
struct nd_hostservlist {
int h_cnt; /* number of nd_hostservs */
struct nd_hostserv *h_hostservs; /* the entries */
};
struct nd_hostserv {
char *h_host; /* the host name */
char *h_serv; /* the service name */
};
struct nd_mergearg {
char *s_uaddr; /* servers universal address */
char *c_uaddr; /* clients universal address */
char *m_uaddr; /* merged universal address */
};
extern int _xnetdir_options __P((int, const struct netconfig *, int, int, const char *));
extern int _xnetdir_getbyname __P((int, const struct netconfig *, const struct nd_hostserv *, struct nd_addrlist **));
extern int _xnetdir_getbyaddr __P((int, const struct netconfig *, struct nd_hostservlist **, const struct netbuf *));
extern struct netbuf * _xuaddr2taddr __P((int, const struct netconfig *, const char *));
extern char * _xtaddr2uaddr __P((int, const struct netconfig *, const struct netbuf *));
#ifdef _EFTSAFE
#define netdir_options(__a1, __a2, __a3, __a4) _xnetdir_options(__NETLIB_VERSION__, __a1, __a2, __a3, __a4)
#define netdir_getbyname(__a1, __a2, __a3) _xnetdir_getbyname(__NETLIB_VERSION__, __a1, __a2, __a3)
#define netdir_getbyaddr(__a1, __a2, __a3) _xnetdir_getbyaddr(__NETLIB_VERSION__, __a1, __a2, __a3)
#define uaddr2taddr(__a1, __a2) _xuaddr2taddr(__NETLIB_VERSION__, __a1, __a2)
#define taddr2uaddr(__a1, __a2) _xtaddr2uaddr(__NETLIB_VERSION__, __a1, __a2)
#else /* !_EFTSAFE */
#pragma weak _xnetdir_options
#pragma weak _xnetdir_getbyname
#pragma weak _xnetdir_getbyaddr
#pragma weak _xuaddr2taddr
#pragma weak _xtaddr2uaddr
static int netdir_options(const struct netconfig *__a1, int __a2, int __a3, const char *__a4)
{
return _xnetdir_options(__NETLIB_VERSION__, __a1, __a2, __a3, __a4);
}
static int netdir_getbyname(const struct netconfig *__a1, const struct nd_hostserv *__a2, struct nd_addrlist **__a3)
{
return _xnetdir_getbyname(__NETLIB_VERSION__, __a1, __a2, __a3);
}
static int netdir_getbyaddr(const struct netconfig *__a1, struct nd_hostservlist **__a2, const struct netbuf *__a3)
{
return _xnetdir_getbyaddr(__NETLIB_VERSION__, __a1, __a2, __a3);
}
static struct netbuf * uaddr2taddr(const struct netconfig *__a1, const char *__a2)
{
return _xuaddr2taddr(__NETLIB_VERSION__, __a1, __a2);
}
static char * taddr2uaddr(const struct netconfig *__a1, const struct netbuf *__a2)
{
return _xtaddr2uaddr(__NETLIB_VERSION__, __a1, __a2);
}
#endif /* !_EFTSAFE */
extern void netdir_free __P((void *, int));
extern void netdir_perror __P((const char *));
extern char * netdir_sperror __P(());
/*
* These are unadvertised interfaces, they should not be called by user
* applications.
*/
extern struct nd_addrlist *
_netdir_getbyname __P((const struct netconfig *,
const struct nd_hostserv *));
extern struct nd_hostservlist *
_netdir_getbyaddr __P((const struct netconfig *,
const struct netbuf *));
extern struct netbuf * _uaddr2taddr __P((const struct netconfig *,
const char *));
extern char * _taddr2uaddr __P((const struct netconfig *,
const struct netbuf *));
extern int set_nderror __P((int));
extern int get_nderror __P((void));
extern const int * _netdir_nderror __P((void));
/*
* Library helper applications and definitions, they should definately not
* be called by user applications and are subject to change or disappear
* without notice. You have been warned.
*/
typedef struct hostent *_FP_gethostbyname2(const char *, int);
typedef struct servent *_FP_getservbyname(const char *, const char *);
typedef struct hostent *_FP_gethostbyaddr(const char *, int, int);
typedef struct servent *_FP_getservbyport(int, const char *);
extern struct nd_addrlist *
_netdir_inet_getbyname __P((const struct netconfig *,
const struct nd_hostserv *,
_FP_gethostbyname2 *,
_FP_getservbyname *));
extern struct nd_hostservlist *
_netdir_inet_getbyaddr __P((const struct netconfig *,
const struct netbuf *,
_FP_gethostbyaddr *,
_FP_getservbyport *));
extern char *
_netdir_inet_taddr2uaddr __P((const struct netconfig *,
const struct netbuf *));
extern struct netbuf *
_netdir_inet_uaddr2taddr __P((const struct netconfig *,
const char *));
extern int
_netdir_inet_options __P((const struct netconfig *, int, int,
const char *));
/*
* These are all objects that can be freed by netdir_free
*/
#define ND_HOSTSERV 0
#define ND_HOSTSERVLIST 1
#define ND_ADDR 2
#define ND_ADDRLIST 3
/*
* These are the various errors that can be encountered while attempting
* to translate names to addresses. Note that none of them (except maybe
* no memory) are truely fatal unless the ntoa deamon is on its last attempt
* to translate the name.
*
* Negative errors terminate the search resolution process, positive errors
* are treated as warnings.
*/
#define ND_BADARG (-2) /* Bad arguments passed */
#define ND_NOMEM (-1) /* No virtual memory left */
#define ND_OK 0 /* Translation successful */
#define ND_NOHOST 1 /* Hostname was not resolvable */
#define ND_NOSERV 2 /* Service was unknown */
#define ND_NOSYM 3 /* Couldn't resolve symbol */
#define ND_OPEN 4 /* File couldn't be opened */
#define ND_ACCESS 5 /* File is not accessable */
#define ND_UKNWN 6 /* Unknown object to be freed */
#define ND_NOCTRL 7 /* Unknown option passed to netdir_options */
#define ND_FAILCTRL 8 /* Option failed in netdir_options */
#define ND_SYSTEM 9 /* Other System error */
#define ND_NOERRMEM 10 /* No memory for error variable */
#define ND_NOLIB 11 /* No library in netconfig list was found */
#define ND_XTIERROR 12 /* An xti call failed; check get_t_errno */
#define ND_BADSTATE 13 /* Incorrect state to attempt t_bind */
/*
* The following netdir_options commands can be given to the fd. This is
* a way of providing for any transport-specific action which the caller
* may want to initiate. It is up to the transport provider
* to choose which netdir options to support.
*/
#define ND_SET_BROADCAST 1 /* Do t_optmgmt to support broadcast*/
#define ND_SET_RESERVEDPORT 2 /* bind to reserve address */
#define ND_CHECK_RESERVEDPORT 3 /* check if address is reserved */
#define ND_MERGEADDR 4 /* Merge universal address */
#define ND_CLEAR_BROADCAST 5 /* Do t_optmgmt to prevent broadcast*/
#define ND_SET_REUSEADDR 6 /* Do t_optmgmt to support address reuse*/
#define ND_CLEAR_REUSEADDR 7 /* Do t_optmgmt to prevent address reuse*/
#define ND_MERGEADDR_ 8 /* Merge universal address */
/*
* The following special host names are used to give the underlying
* transport provider a clue as to the intent of the request.
*/
#define HOST_SELF "\\1"
#define HOST_ANY "\\2"
#define HOST_BROADCAST "\\3"
__END_DECLS
#endif /* !_NETDIR_H */