
******************************************************

            PROPRIETARY PROGRAM MATERIAL

THIS MATERIAL IS PROPRIETARY TO UNISYS CORPORATION
AND IS NOT TO BE REPRODUCED, USED OR DISCLOSED EXCEPT 
IN ACCORDANCE WITH PROGRAM LICENSE OR UPON WRITTEN
AUTHORIZATION OF UNISYS CORPORATION.

COPYRIGHT  (C)  1991 Unisys CORPORATION


      @()netdb.h 1.2 861007 SMI; from UCB  

******************************************************


ifndef _NETDB_H
define _NETDB_H

ifndef MAXHOSTNAMELEN
define MAXHOSTNAMELEN 64
endif

include syssocompat.h



define _PATH_HEQUIV	<etc>hosts.equiv
define _PATH_HOSTS		<etc>hosts
define _PATH_NETWORKS	<etc>networks
define _PATH_PROTOCOLS	<etc>protocols
define _PATH_SERVICES	<etc>services

*
 * 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).
 *
struct  hostent {
        char FARPTR h_name;        * official name of host *
        char FARPTR FARPTR h_aliases;    * alias list *
        int     h_addrtype;     * host address type *
        int     h_length;       * length of address *
if BSD >= 43
		char FARPTR FARPTR h_addr_list;
define h_addr h_addr_list[0]
else
        char FARPTR h_addr;        * address *
endif
};
 
*
 * Assumption here is that a network number
 * fits in 32 bits  probably a poor one.
 *
struct  netent {
        char FARPTR n_name;        * official name of net *
        char FARPTR FARPTR n_aliases;    * alias list *
        int     n_addrtype;     * net address type *
        u_long  n_net;          * network  *
};
 
struct  servent {
        char FARPTR s_name;        * official service name *
        char FARPTR FARPTR s_aliases;    * alias list *
        int     s_port;         * port  *
        char FARPTR s_proto;       * protocol to use *
};
 
struct  protoent {
        char FARPTR p_name;        * official protocol name *
        char FARPTR FARPTR p_aliases;    * alias list *
        int     p_proto;        * protocol  *
};
 
struct rpcent {
        char FARPTR r_name;        * name of server for this rpc program *
        char FARPTR FARPTR r_aliases;    * alias list *
        u_long   r_number;       * rpc program number *
};


define MAXHOSTLISTLEN 20

struct hostlist {
		int		total;					* total number of hosts on the list *
		char FARPTR host[MAXHOSTLISTLEN];* array of pointers to host names  *
};

*
 * Error return codes from gethostbyname() and gethostbyaddr()
 * (left in extern int h_errno).
 *

define	HOST_NOT_FOUND	1 * Authoritative Answer Host not found *
define	TRY_AGAIN	2 * NonAuthoritive 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 *


int 			 PlmFar(gethostlist) (int FARPTR offset, char FARPTR outbuf, int element);
int 			 PlmFar(gethostname) (char FARPTR n, int sz);


void             PlmFar(sethostent)(int);
void             PlmFar(endhostent)();

struct hostent  FARPTR PlmFar(gethostbyname) (char FARPTR name), 
                FARPTR PlmFar(gethostbyaddr) (char FARPTR , int, int), 

                FARPTR PlmFar(gethostent)();

void             PlmFar(setnetent)(int);
void             PlmFar(endnetent)();
struct netent   FARPTR PlmFar(getnetbyname)(char FARPTR name), 
                FARPTR PlmFar(getnetbyaddr)(), 
                FARPTR PlmFar(getnetent)();

void             PlmFar(setservent)(int);
void             PlmFar(endservent)();
struct servent  FARPTR PlmFar(getservbyname)(char FARPTR name, char FARPTR proto), 
                FARPTR PlmFar(getservbyport)(), 
                FARPTR PlmFar(getservent)();

void             PlmFar(setprotoent)(int);
void             PlmFar(endprotoent)();
struct protoent FARPTR PlmFar(getprotobyname)(char FARPTR name), 
                FARPTR PlmFar(getprotobynumber)(), 
                FARPTR PlmFar(getprotoent)();

void             PlmFar(setrpcent)();
void             PlmFar(endrpcent)();
struct rpcent   FARPTR PlmFar(getrpcbyname)(char FARPTR name), 
                FARPTR PlmFar(getrpcbynumber)(), 
                FARPTR PlmFar(getrpcent)();

endif
