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(void); 82 struct netconfig *getnetconfig(void *); 83 struct netconfig *getnetconfigent(const char *); 84 void freenetconfigent(struct netconfig *); 85 int endnetconfig(void *); 86 87 #ifndef _KERNEL 88 void *setnetpath(void); 89 struct netconfig *getnetpath(void *); 90 int endnetpath(void *); 91 92 void nc_perror(const char *); 93 char *nc_sperror(void); 94 #endif 95 96 __END_DECLS 97 98 #endif /* _NETCONFIG_H_ */ 99