Home | History | Annotate | Line # | Download | only in include
netconfig.h revision 1.1
      1 /*	$NetBSD: netconfig.h,v 1.1 2000/06/02 22:57:54 fvdl Exp $	*/
      2 
      3 
      4 #ifndef _NETCONFIG_H_
      5 #define _NETCONFIG_H_
      6 
      7 #include <sys/cdefs.h>
      8 
      9 #define NETCONFIG	"/etc/netconfig"
     10 #define NETPATH		"NETPATH"
     11 
     12 struct netconfig {
     13 	char *nc_netid;			/* Network ID */
     14 	unsigned long nc_semantics;	/* Semantics (see below) */
     15 	unsigned long nc_flag;		/* Flags (see below) */
     16 	char *nc_protofmly;		/* Protocol family */
     17 	char *nc_proto;			/* Protocol name */
     18 	char *nc_device;		/* Network device pathname */
     19 	unsigned long nc_nlookups;	/* Number of directory lookup libs */
     20 	char **nc_lookups;		/* Names of the libraries */
     21 	unsigned long nc_unused[9];	/* reserved */
     22 };
     23 
     24 typedef struct {
     25 	struct netconfig **nc_head;
     26 	struct netconfig **nc_curr;
     27 } NCONF_HANDLE;
     28 
     29 /*
     30  * nc_semantics values
     31  */
     32 #define NC_TPI_CLTS	1
     33 #define NC_TPI_COTS	2
     34 #define NC_TPI_COTS_ORD	3
     35 #define NC_TPI_RAW	4
     36 
     37 /*
     38  * nc_flag values
     39  */
     40 #define NC_NOFLAG	0x00
     41 #define NC_VISIBLE	0x01
     42 #define NC_BROADCAST	0x02
     43 
     44 /*
     45  * nc_protofmly values
     46  */
     47 #define NC_NOPROTOFMLY	"-"
     48 #define NC_LOOPBACK	"loopback"
     49 #define NC_INET		"inet"
     50 #define NC_INET6	"inet6"
     51 #define NC_IMPLINK	"implink"
     52 #define NC_PUP		"pup"
     53 #define NC_CHAOS	"chaos"
     54 #define NC_NS		"ns"
     55 #define NC_NBS		"nbs"
     56 #define NC_ECMA		"ecma"
     57 #define NC_DATAKIT	"datakit"
     58 #define NC_CCITT	"ccitt"
     59 #define NC_SNA		"sna"
     60 #define NC_DECNET	"decnet"
     61 #define NC_DLI		"dli"
     62 #define NC_LAT		"lat"
     63 #define NC_HYLINK	"hylink"
     64 #define NC_APPLETALK	"appletalk"
     65 #define NC_NIT		"nit"
     66 #define NC_IEEE802	"ieee802"
     67 #define NC_OSI		"osi"
     68 #define NC_X25		"x25"
     69 #define NC_OSINET	"osinet"
     70 #define NC_GOSIP	"gosip"
     71 
     72 /*
     73  * nc_proto values
     74  */
     75 #define NC_NOPROTO	"-"
     76 #define NC_TCP		"tcp"
     77 #define NC_UDP		"udp"
     78 #define NC_ICMP		"icmp"
     79 
     80 __BEGIN_DECLS
     81 void *setnetconfig __P((void));
     82 struct netconfig *getnetconfig __P((void *));
     83 struct netconfig *getnetconfigent __P((char *));
     84 void freenetconfigent __P((struct netconfig *));
     85 int endnetconfig __P((void *));
     86 
     87 void *setnetpath __P((void));
     88 struct netconfig *getnetpath __P((void *));
     89 int endnetpath(void *);
     90 
     91 void nc_perror __P((const char *));
     92 char *nc_sperror __P((void));
     93 __END_DECLS
     94 
     95 #endif /* _NETCONFIG_H_ */
     96