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