1139823Simp/*-
2133578Sharti * Copyright (c) 2001-2002
3133578Sharti *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4133578Sharti *	All rights reserved.
5133578Sharti * Copyright (c) 2003-2004
6133578Sharti *	Hartmut Brandt
7133578Sharti *	All rights reserved.
8133578Sharti *
9133578Sharti * Author: Harti Brandt <harti@freebsd.org>
10133578Sharti *
11133578Sharti * Redistribution of this software and documentation and use in source and
12133578Sharti * binary forms, with or without modification, are permitted provided that
13133578Sharti * the following conditions are met:
14133578Sharti *
15133578Sharti * 1. Redistributions of source code or documentation must retain the above
16133578Sharti *    copyright notice, this list of conditions and the following disclaimer.
17133578Sharti * 2. Redistributions in binary form must reproduce the above copyright
18133578Sharti *    notice, this list of conditions and the following disclaimer in the
19133578Sharti *    documentation and/or other materials provided with the distribution.
20133578Sharti *
21133578Sharti * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22133578Sharti * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23133578Sharti * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24133578Sharti * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25133578Sharti * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26133578Sharti * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27133578Sharti * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28133578Sharti * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29133578Sharti * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30133578Sharti * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31133578Sharti * SUCH DAMAGE.
32133578Sharti *
33133578Sharti * $FreeBSD$
34139823Simp */
35139823Simp
36139823Simp/*
37133578Sharti * Interface to ng_ccatm
38133578Sharti */
39133578Sharti#ifndef _NETGRAPH_ATM_NG_CCATM_H_
40133578Sharti#define _NETGRAPH_ATM_NG_CCATM_H_
41133578Sharti
42133578Sharti#define NG_CCATM_NODE_TYPE	"ccatm"
43133578Sharti#define NGM_CCATM_COOKIE	984046139
44133578Sharti
45133578Shartienum {
46133578Sharti	NGM_CCATM_DUMP,			/* dump internal status */
47133578Sharti	NGM_CCATM_STOP,			/* stop all processing, close all */
48133578Sharti	NGM_CCATM_START,		/* start processing */
49133578Sharti	NGM_CCATM_CLEAR,		/* clear prefix/address table */
50133578Sharti	NGM_CCATM_GET_ADDRESSES,	/* get list of all addresses */
51133578Sharti	NGM_CCATM_ADDRESS_REGISTERED,	/* registration ok */
52133578Sharti	NGM_CCATM_ADDRESS_UNREGISTERED,	/* unregistration ok */
53133578Sharti	NGM_CCATM_SET_PORT_PARAM,	/* set port parameters */
54133578Sharti	NGM_CCATM_GET_PORT_PARAM,	/* get port parameters */
55133578Sharti	NGM_CCATM_GET_PORTLIST,		/* get list of port numbers */
56133578Sharti	NGM_CCATM_GETSTATE,		/* get port status */
57133578Sharti	NGM_CCATM_SETLOG,		/* set/get loglevel */
58133578Sharti	NGM_CCATM_RESET,		/* reset everything */
59133578Sharti	NGM_CCATM_GET_EXSTAT,		/* get extended status */
60133578Sharti};
61133578Sharti
62133578Sharti/*
63133578Sharti * This must be synchronized with unistruct.h::struct uni_addr
64133578Sharti */
65133578Sharti#define	NGM_CCATM_ADDR_ARRAY_INFO				\
66133578Sharti	{							\
67133578Sharti	  &ng_parse_hint8_type,					\
68133578Sharti	  UNI_ADDR_MAXLEN					\
69133578Sharti	}
70133578Sharti
71133578Sharti#define NGM_CCATM_UNI_ADDR_INFO 				\
72133578Sharti 	{							\
73133578Sharti	  { "type",	&ng_parse_uint32_type },		\
74133578Sharti	  { "plan",	&ng_parse_uint32_type },		\
75133578Sharti	  { "len",	&ng_parse_uint32_type },		\
76133578Sharti	  { "addr",	&ng_ccatm_addr_array_type },		\
77133578Sharti	  { NULL }						\
78133578Sharti	}
79133578Sharti
80133578Sharti/*
81133578Sharti * Address request
82133578Sharti */
83133578Shartistruct ngm_ccatm_addr_req {
84133578Sharti	uint32_t	port;
85133578Sharti	struct uni_addr	addr;
86133578Sharti};
87133578Sharti#define	NGM_CCATM_ADDR_REQ_INFO					\
88133578Sharti	{							\
89133578Sharti	  { "port",	&ng_parse_uint32_type },		\
90133578Sharti	  { "addr",	&ng_ccatm_uni_addr_type },		\
91133578Sharti	  { NULL },						\
92133578Sharti	}
93133578Sharti
94133578Sharti/*
95133578Sharti * Get current address list
96133578Sharti */
97133578Shartistruct ngm_ccatm_get_addresses {
98133578Sharti	uint32_t	count;
99133578Sharti	struct ngm_ccatm_addr_req addr[];
100133578Sharti};
101133578Sharti#define	NGM_CCATM_ADDR_REQ_ARRAY_INFO				\
102133578Sharti	{							\
103133578Sharti	  &ng_ccatm_addr_req_type,				\
104133578Sharti	  ng_ccatm_addr_req_array_getlen			\
105133578Sharti	}
106133578Sharti#define NGM_CCATM_GET_ADDRESSES_INFO 				\
107133578Sharti	{							\
108133578Sharti	  { "count",	&ng_parse_uint32_type },		\
109133578Sharti	  { "addr",	&ng_ccatm_addr_req_array_type },	\
110133578Sharti	  { NULL }						\
111133578Sharti	}
112133578Sharti
113133578Sharti/*
114133578Sharti * Port as parameter
115133578Sharti */
116133578Shartistruct ngm_ccatm_port {
117133578Sharti	uint32_t	port;
118133578Sharti};
119133578Sharti#define NGM_CCATM_PORT_INFO 					\
120133578Sharti	{							\
121133578Sharti	  { "port",	&ng_parse_uint32_type },		\
122133578Sharti	  { NULL }						\
123133578Sharti	}
124133578Sharti
125133578Sharti/*
126133578Sharti * Port parameters.
127133578Sharti * This must be synchronized with atmapi.h::struct atm_port_info.
128133578Sharti */
129133578Sharti#define	NGM_CCATM_ESI_INFO						\
130133578Sharti	{								\
131133578Sharti	  &ng_parse_hint8_type,						\
132133578Sharti	  6								\
133133578Sharti	}
134133578Sharti#define NGM_CCATM_ATM_PORT_INFO 					\
135133578Sharti	{								\
136133578Sharti	  { "port",		&ng_parse_uint32_type },		\
137133578Sharti	  { "pcr",		&ng_parse_uint32_type },		\
138133578Sharti	  { "max_vpi_bits",	&ng_parse_uint32_type },		\
139133578Sharti	  { "max_vci_bits",	&ng_parse_uint32_type },		\
140133578Sharti	  { "max_svpc_vpi",	&ng_parse_uint32_type },		\
141133578Sharti	  { "max_svcc_vpi",	&ng_parse_uint32_type },		\
142133578Sharti	  { "min_svcc_vci",	&ng_parse_uint32_type },		\
143133578Sharti	  { "esi",		&ng_ccatm_esi_type },			\
144133578Sharti	  { "num_addr",		&ng_parse_uint32_type },		\
145133578Sharti	  { NULL }							\
146133578Sharti	}
147133578Sharti
148133578Sharti/*
149133578Sharti * List of port numbers
150133578Sharti */
151133578Shartistruct ngm_ccatm_portlist {
152133578Sharti	uint32_t	nports;
153133578Sharti	uint32_t	ports[];
154133578Sharti};
155133578Sharti#define	NGM_CCATM_PORT_ARRAY_INFO					\
156133578Sharti	{								\
157133578Sharti	  &ng_parse_uint32_type,					\
158133578Sharti	  ng_ccatm_port_array_getlen					\
159133578Sharti	}
160133578Sharti#define NGM_CCATM_PORTLIST_INFO 					\
161133578Sharti	{								\
162133578Sharti	  { "nports",	&ng_parse_uint32_type },			\
163133578Sharti	  { "ports",	&ng_ccatm_port_array_type },			\
164133578Sharti	  { NULL }							\
165133578Sharti	}
166133578Sharti
167133578Shartistruct ccatm_op {
168133578Sharti	uint32_t	op;	/* request code */
169133578Sharti};
170133578Sharti
171133578Sharti#endif
172