174462Salfred/*	$NetBSD: netconfig.h,v 1.1 2000/06/02 22:57:54 fvdl Exp $	*/
274462Salfred/*	$FreeBSD$ */
374462Salfred
474462Salfred
574462Salfred#ifndef _NETCONFIG_H_
674462Salfred#define _NETCONFIG_H_
774462Salfred
874462Salfred#include <sys/cdefs.h>
974462Salfred
1074462Salfred#define NETCONFIG	"/etc/netconfig"
1174462Salfred#define NETPATH		"NETPATH"
1274462Salfred
1374462Salfredstruct netconfig {
1474462Salfred	char *nc_netid;			/* Network ID */
1574462Salfred	unsigned long nc_semantics;	/* Semantics (see below) */
1674462Salfred	unsigned long nc_flag;		/* Flags (see below) */
1774462Salfred	char *nc_protofmly;		/* Protocol family */
1874462Salfred	char *nc_proto;			/* Protocol name */
1974462Salfred	char *nc_device;		/* Network device pathname */
2074462Salfred	unsigned long nc_nlookups;	/* Number of directory lookup libs */
2174462Salfred	char **nc_lookups;		/* Names of the libraries */
2274462Salfred	unsigned long nc_unused[9];	/* reserved */
2374462Salfred};
2474462Salfred
2574462Salfredtypedef struct {
2674462Salfred	struct netconfig **nc_head;
2774462Salfred	struct netconfig **nc_curr;
2874462Salfred} NCONF_HANDLE;
2974462Salfred
3074462Salfred/*
3174462Salfred * nc_semantics values
3274462Salfred */
3374462Salfred#define NC_TPI_CLTS	1
3474462Salfred#define NC_TPI_COTS	2
3574462Salfred#define NC_TPI_COTS_ORD	3
3674462Salfred#define NC_TPI_RAW	4
3774462Salfred
3874462Salfred/*
3974462Salfred * nc_flag values
4074462Salfred */
4174462Salfred#define NC_NOFLAG	0x00
4274462Salfred#define NC_VISIBLE	0x01
4374462Salfred#define NC_BROADCAST	0x02
4474462Salfred
4574462Salfred/*
4674462Salfred * nc_protofmly values
4774462Salfred */
4874462Salfred#define NC_NOPROTOFMLY	"-"
4974462Salfred#define NC_LOOPBACK	"loopback"
5074462Salfred#define NC_INET		"inet"
5174462Salfred#define NC_INET6	"inet6"
5274462Salfred#define NC_IMPLINK	"implink"
5374462Salfred#define NC_PUP		"pup"
5474462Salfred#define NC_CHAOS	"chaos"
5574462Salfred#define NC_NS		"ns"
5674462Salfred#define NC_NBS		"nbs"
5774462Salfred#define NC_ECMA		"ecma"
5874462Salfred#define NC_DATAKIT	"datakit"
5974462Salfred#define NC_CCITT	"ccitt"
6074462Salfred#define NC_SNA		"sna"
6174462Salfred#define NC_DECNET	"decnet"
6274462Salfred#define NC_DLI		"dli"
6374462Salfred#define NC_LAT		"lat"
6474462Salfred#define NC_HYLINK	"hylink"
6574462Salfred#define NC_APPLETALK	"appletalk"
6674462Salfred#define NC_NIT		"nit"
6774462Salfred#define NC_IEEE802	"ieee802"
6874462Salfred#define NC_OSI		"osi"
6974462Salfred#define NC_X25		"x25"
7074462Salfred#define NC_OSINET	"osinet"
7174462Salfred#define NC_GOSIP	"gosip"
7274462Salfred
7374462Salfred/*
7474462Salfred * nc_proto values
7574462Salfred */
7674462Salfred#define NC_NOPROTO	"-"
7774462Salfred#define NC_TCP		"tcp"
7874462Salfred#define NC_UDP		"udp"
7974462Salfred#define NC_ICMP		"icmp"
8074462Salfred
8174462Salfred__BEGIN_DECLS
8293032Simpvoid *setnetconfig(void);
8393032Simpstruct netconfig *getnetconfig(void *);
8493032Simpstruct netconfig *getnetconfigent(const char *);
8593032Simpvoid freenetconfigent(struct netconfig *);
8693032Simpint endnetconfig(void *);
8774462Salfred
8893032Simpvoid *setnetpath(void);
8993032Simpstruct netconfig *getnetpath(void *);
9074462Salfredint endnetpath(void *);
9174462Salfred
9293032Simpvoid nc_perror(const char *);
9393032Simpchar *nc_sperror(void);
9474462Salfred__END_DECLS
9574462Salfred
9674462Salfred#endif /* _NETCONFIG_H_ */
97