summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/atm/ng_ccatm.h
blob: f85c1286b73dad2360990b3aab34672d8ce80d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*-
 * Copyright (c) 2001-2002
 *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
 *	All rights reserved.
 * Copyright (c) 2003-2004
 *	Hartmut Brandt
 *	All rights reserved.
 *
 * Author: Harti Brandt <harti@freebsd.org>
 *
 * Redistribution of this software and documentation and use in source and
 * binary forms, with or without modification, are permitted provided that
 * the following conditions are met:
 *
 * 1. Redistributions of source code or documentation must retain the above
 *    copyright notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD$
 */

/*
 * Interface to ng_ccatm
 */
#ifndef _NETGRAPH_ATM_NG_CCATM_H_
#define _NETGRAPH_ATM_NG_CCATM_H_

#define NG_CCATM_NODE_TYPE	"ccatm"
#define NGM_CCATM_COOKIE	984046139

enum {
	NGM_CCATM_DUMP,			/* dump internal status */
	NGM_CCATM_STOP,			/* stop all processing, close all */
	NGM_CCATM_START,		/* start processing */
	NGM_CCATM_CLEAR,		/* clear prefix/address table */
	NGM_CCATM_GET_ADDRESSES,	/* get list of all addresses */
	NGM_CCATM_ADDRESS_REGISTERED,	/* registration ok */
	NGM_CCATM_ADDRESS_UNREGISTERED,	/* unregistration ok */
	NGM_CCATM_SET_PORT_PARAM,	/* set port parameters */
	NGM_CCATM_GET_PORT_PARAM,	/* get port parameters */
	NGM_CCATM_GET_PORTLIST,		/* get list of port numbers */
	NGM_CCATM_GETSTATE,		/* get port status */
	NGM_CCATM_SETLOG,		/* set/get loglevel */
	NGM_CCATM_RESET,		/* reset everything */
	NGM_CCATM_GET_EXSTAT,		/* get extended status */
};

/*
 * This must be synchronized with unistruct.h::struct uni_addr
 */
#define	NGM_CCATM_ADDR_ARRAY_INFO				\
	{							\
	  &ng_parse_hint8_type,					\
	  UNI_ADDR_MAXLEN					\
	}

#define NGM_CCATM_UNI_ADDR_INFO 				\
 	{							\
	  { "type",	&ng_parse_uint32_type },		\
	  { "plan",	&ng_parse_uint32_type },		\
	  { "len",	&ng_parse_uint32_type },		\
	  { "addr",	&ng_ccatm_addr_array_type },		\
	  { NULL }						\
	}

/*
 * Address request
 */
struct ngm_ccatm_addr_req {
	uint32_t	port;
	struct uni_addr	addr;
};
#define	NGM_CCATM_ADDR_REQ_INFO					\
	{							\
	  { "port",	&ng_parse_uint32_type },		\
	  { "addr",	&ng_ccatm_uni_addr_type },		\
	  { NULL },						\
	}

/*
 * Get current address list
 */
struct ngm_ccatm_get_addresses {
	uint32_t	count;
	struct ngm_ccatm_addr_req addr[];
};
#define	NGM_CCATM_ADDR_REQ_ARRAY_INFO				\
	{							\
	  &ng_ccatm_addr_req_type,				\
	  ng_ccatm_addr_req_array_getlen			\
	}
#define NGM_CCATM_GET_ADDRESSES_INFO 				\
	{							\
	  { "count",	&ng_parse_uint32_type },		\
	  { "addr",	&ng_ccatm_addr_req_array_type },	\
	  { NULL }						\
	}

/*
 * Port as parameter
 */
struct ngm_ccatm_port {
	uint32_t	port;
};
#define NGM_CCATM_PORT_INFO 					\
	{							\
	  { "port",	&ng_parse_uint32_type },		\
	  { NULL }						\
	}

/*
 * Port parameters.
 * This must be synchronized with atmapi.h::struct atm_port_info.
 */
#define	NGM_CCATM_ESI_INFO						\
	{								\
	  &ng_parse_hint8_type,						\
	  6								\
	}
#define NGM_CCATM_ATM_PORT_INFO 					\
	{								\
	  { "port",		&ng_parse_uint32_type },		\
	  { "pcr",		&ng_parse_uint32_type },		\
	  { "max_vpi_bits",	&ng_parse_uint32_type },		\
	  { "max_vci_bits",	&ng_parse_uint32_type },		\
	  { "max_svpc_vpi",	&ng_parse_uint32_type },		\
	  { "max_svcc_vpi",	&ng_parse_uint32_type },		\
	  { "min_svcc_vci",	&ng_parse_uint32_type },		\
	  { "esi",		&ng_ccatm_esi_type },			\
	  { "num_addr",		&ng_parse_uint32_type },		\
	  { NULL }							\
	}

/*
 * List of port numbers
 */
struct ngm_ccatm_portlist {
	uint32_t	nports;
	uint32_t	ports[];
};
#define	NGM_CCATM_PORT_ARRAY_INFO					\
	{								\
	  &ng_parse_uint32_type,					\
	  ng_ccatm_port_array_getlen					\
	}
#define NGM_CCATM_PORTLIST_INFO 					\
	{								\
	  { "nports",	&ng_parse_uint32_type },			\
	  { "ports",	&ng_ccatm_port_array_type },			\
	  { NULL }							\
	}

struct ccatm_op {
	uint32_t	op;	/* request code */
};

#endif
OpenPOWER on IntegriCloud