1118824Sharti/*
2118824Sharti * Copyright (c) 2001-2003
3118824Sharti *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4118824Sharti * 	All rights reserved.
5118824Sharti *
6118824Sharti * Redistribution and use in source and binary forms, with or without
7118824Sharti * modification, are permitted provided that the following conditions
8118824Sharti * are met:
9118824Sharti * 1. Redistributions of source code must retain the above copyright
10118824Sharti *    notice, this list of conditions and the following disclaimer.
11118824Sharti * 2. Redistributions in binary form must reproduce the above copyright
12118824Sharti *    notice, this list of conditions and the following disclaimer in the
13118824Sharti *    documentation and/or other materials provided with the distribution.
14118824Sharti *
15118824Sharti * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16118824Sharti * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17118824Sharti * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18118824Sharti * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19118824Sharti * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20118824Sharti * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21118824Sharti * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22118824Sharti * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23118824Sharti * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24118824Sharti * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25118824Sharti * SUCH DAMAGE.
26118824Sharti *
27118824Sharti * Author: Hartmut Brandt <harti@freebsd.org>
28118824Sharti *
29118824Sharti * $FreeBSD$
30118824Sharti */
31118824Sharti#ifndef _ATMCONFIG_H
32118824Sharti#define	_ATMCONFIG_H
33118824Sharti
34118824Sharti#include <sys/types.h>
35118824Sharti#include <sys/socket.h>
36118824Sharti#include <sys/queue.h>
37118824Sharti#include <netgraph/ng_message.h>
38118824Sharti
39118824Sharti#define	DEFAULT_INTERFACE	"hatm0"
40118824Sharti
41118824Shartistruct cmdtab {
42118824Sharti	const char	*string;
43118824Sharti	const struct cmdtab *sub;
44118824Sharti	void		(*func)(int, char *[]);
45118824Sharti};
46118824Sharti
47118824Sharti/*
48118824Sharti * client configuration info
49118824Sharti */
50118824Shartistruct amodule {
51133565Sharti	const struct cmdtab	*cmd;
52118824Sharti};
53118824Sharti
54133565Sharti#define	DEF_MODULE(CMDTAB)				\
55133565Shartistruct amodule amodule_1 = { CMDTAB }
56118824Sharti
57133565Sharti/* for compiled-in modules */
58133565Shartivoid	register_module(const struct amodule *);
59133565Sharti
60118824Sharti/* print a message if we are verbose */
61118824Shartivoid	verb(const char *, ...) __printflike(1, 2);
62118824Sharti
63118824Sharti/* print heading */
64118824Shartivoid	heading(const char *, ...) __printflike(1, 2);
65118824Sharti
66118824Sharti/* before starting output */
67118824Shartivoid	heading_init(void);
68118824Sharti
69118824Sharti/* stringify an enumerated value */
70118824Shartistruct penum {
71118824Sharti	int32_t	value;
72118824Sharti	const char *str;
73118824Sharti};
74118824Sharticonst char *penum(int32_t value, const struct penum *strtab, char *buf);
75133565Shartiint pparse(int32_t *, const struct penum *, const char *);
76118824Sharti
77118824Shartienum {
78118824Sharti	OPT_NONE,
79118824Sharti	OPT_UINT,
80118824Sharti	OPT_INT,
81118824Sharti	OPT_UINT32,
82118824Sharti	OPT_INT32,
83118824Sharti	OPT_UINT64,
84118824Sharti	OPT_INT64,
85118824Sharti	OPT_FLAG,
86118824Sharti	OPT_VCI,
87118824Sharti	OPT_STRING,
88118824Sharti	OPT_SIMPLE,
89118824Sharti};
90118824Shartistruct option {
91118824Sharti	const char *optstr;
92118824Sharti	int	opttype;
93118824Sharti	void	*optarg;
94118824Sharti};
95118824Sharti
96118824Shartiint parse_options(int *_pargc, char ***_pargv,
97118824Sharti    const struct option *_opts);
98118824Sharti
99133565Sharti/* XXX while this is compiled in */
100133565Shartivoid device_register(void);
101133565Sharti
102118824Sharti#endif /* _ATMCONFIG_H */
103