netconfig.h revision 74462
1258546Sganbold/* $NetBSD: netconfig.h,v 1.1 2000/06/02 22:57:54 fvdl Exp $ */ 2266337Sian/* $FreeBSD: head/include/netconfig.h 74462 2001-03-19 12:50:13Z alfred $ */ 3258546Sganbold 4258546Sganbold 5258546Sganbold#ifndef _NETCONFIG_H_ 6258546Sganbold#define _NETCONFIG_H_ 7258546Sganbold 8258546Sganbold#include <sys/cdefs.h> 9258546Sganbold 10258546Sganbold#define NETCONFIG "/etc/netconfig" 11258546Sganbold#define NETPATH "NETPATH" 12258546Sganbold 13258546Sganboldstruct netconfig { 14258546Sganbold char *nc_netid; /* Network ID */ 15258546Sganbold unsigned long nc_semantics; /* Semantics (see below) */ 16258546Sganbold unsigned long nc_flag; /* Flags (see below) */ 17258546Sganbold char *nc_protofmly; /* Protocol family */ 18258546Sganbold char *nc_proto; /* Protocol name */ 19258546Sganbold char *nc_device; /* Network device pathname */ 20258546Sganbold unsigned long nc_nlookups; /* Number of directory lookup libs */ 21258546Sganbold char **nc_lookups; /* Names of the libraries */ 22258546Sganbold unsigned long nc_unused[9]; /* reserved */ 23258546Sganbold}; 24258546Sganbold 25258546Sganboldtypedef struct { 26258546Sganbold struct netconfig **nc_head; 27258546Sganbold struct netconfig **nc_curr; 28258546Sganbold} NCONF_HANDLE; 29258546Sganbold 30258546Sganbold/* 31258546Sganbold * nc_semantics values 32258546Sganbold */ 33258546Sganbold#define NC_TPI_CLTS 1 34258546Sganbold#define NC_TPI_COTS 2 35258546Sganbold#define NC_TPI_COTS_ORD 3 36258546Sganbold#define NC_TPI_RAW 4 37258546Sganbold 38258546Sganbold/* 39258546Sganbold * nc_flag values 40258546Sganbold */ 41258546Sganbold#define NC_NOFLAG 0x00 42258546Sganbold#define NC_VISIBLE 0x01 43258546Sganbold#define NC_BROADCAST 0x02 44258546Sganbold 45258546Sganbold/* 46258546Sganbold * nc_protofmly values 47258546Sganbold */ 48258546Sganbold#define NC_NOPROTOFMLY "-" 49258546Sganbold#define NC_LOOPBACK "loopback" 50258546Sganbold#define NC_INET "inet" 51258546Sganbold#define NC_INET6 "inet6" 52258546Sganbold#define NC_IMPLINK "implink" 53258546Sganbold#define NC_PUP "pup" 54258546Sganbold#define NC_CHAOS "chaos" 55258546Sganbold#define NC_NS "ns" 56258546Sganbold#define NC_NBS "nbs" 57258546Sganbold#define NC_ECMA "ecma" 58258546Sganbold#define NC_DATAKIT "datakit" 59258546Sganbold#define NC_CCITT "ccitt" 60258546Sganbold#define NC_SNA "sna" 61258546Sganbold#define NC_DECNET "decnet" 62258546Sganbold#define NC_DLI "dli" 63258546Sganbold#define NC_LAT "lat" 64258546Sganbold#define NC_HYLINK "hylink" 65258546Sganbold#define NC_APPLETALK "appletalk" 66258546Sganbold#define NC_NIT "nit" 67258546Sganbold#define NC_IEEE802 "ieee802" 68258546Sganbold#define NC_OSI "osi" 69258546Sganbold#define NC_X25 "x25" 70258546Sganbold#define NC_OSINET "osinet" 71258546Sganbold#define NC_GOSIP "gosip" 72258546Sganbold 73258546Sganbold/* 74258546Sganbold * nc_proto values 75258546Sganbold */ 76258546Sganbold#define NC_NOPROTO "-" 77258546Sganbold#define NC_TCP "tcp" 78258546Sganbold#define NC_UDP "udp" 79258546Sganbold#define NC_ICMP "icmp" 80258546Sganbold 81258546Sganbold__BEGIN_DECLS 82258546Sganboldvoid *setnetconfig __P((void)); 83258546Sganboldstruct netconfig *getnetconfig __P((void *)); 84258546Sganboldstruct netconfig *getnetconfigent __P((char *)); 85258546Sganboldvoid freenetconfigent __P((struct netconfig *)); 86258546Sganboldint endnetconfig __P((void *)); 87266152Sian 88266152Sianvoid *setnetpath __P((void)); 89266152Sianstruct netconfig *getnetpath __P((void *)); 90258546Sganboldint endnetpath(void *); 91258546Sganbold 92258546Sganboldvoid nc_perror __P((const char *)); 93258546Sganboldchar *nc_sperror __P((void)); 94258546Sganbold__END_DECLS 95258546Sganbold 96258546Sganbold#endif /* _NETCONFIG_H_ */ 97258546Sganbold