MFC r1.27:
[dragonfly.git] / sys / netgraph7 / atm / ng_ccatm.h
blobecaecf5e1545b126c8f58c8671c298475828b94a
1 /*-
2 * Copyright (c) 2001-2002
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 * Copyright (c) 2003-2004
6 * Hartmut Brandt
7 * All rights reserved.
9 * Author: Harti Brandt <harti@freebsd.org>
11 * Redistribution of this software and documentation and use in source and
12 * binary forms, with or without modification, are permitted provided that
13 * the following conditions are met:
15 * 1. Redistributions of source code or documentation must retain the above
16 * copyright notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
33 * $FreeBSD: src/sys/netgraph/atm/ng_ccatm.h,v 1.2 2005/01/07 01:45:40 imp Exp $
34 * $DragonFly: src/sys/netgraph7/atm/ng_ccatm.h,v 1.2 2008/06/26 23:05:37 dillon Exp $
38 * Interface to ng_ccatm
40 #ifndef _NETGRAPH_ATM_NG_CCATM_H_
41 #define _NETGRAPH_ATM_NG_CCATM_H_
43 #define NG_CCATM_NODE_TYPE "ccatm"
44 #define NGM_CCATM_COOKIE 984046139
46 enum {
47 NGM_CCATM_DUMP, /* dump internal status */
48 NGM_CCATM_STOP, /* stop all processing, close all */
49 NGM_CCATM_START, /* start processing */
50 NGM_CCATM_CLEAR, /* clear prefix/address table */
51 NGM_CCATM_GET_ADDRESSES, /* get list of all addresses */
52 NGM_CCATM_ADDRESS_REGISTERED, /* registration ok */
53 NGM_CCATM_ADDRESS_UNREGISTERED, /* unregistration ok */
54 NGM_CCATM_SET_PORT_PARAM, /* set port parameters */
55 NGM_CCATM_GET_PORT_PARAM, /* get port parameters */
56 NGM_CCATM_GET_PORTLIST, /* get list of port numbers */
57 NGM_CCATM_GETSTATE, /* get port status */
58 NGM_CCATM_SETLOG, /* set/get loglevel */
59 NGM_CCATM_RESET, /* reset everything */
60 NGM_CCATM_GET_EXSTAT, /* get extended status */
64 * This must be synchronized with unistruct.h::struct uni_addr
66 #define NGM_CCATM_ADDR_ARRAY_INFO \
67 { \
68 &ng_parse_hint8_type, \
69 UNI_ADDR_MAXLEN \
72 #define NGM_CCATM_UNI_ADDR_INFO \
73 { \
74 { "type", &ng_parse_uint32_type }, \
75 { "plan", &ng_parse_uint32_type }, \
76 { "len", &ng_parse_uint32_type }, \
77 { "addr", &ng_ccatm_addr_array_type }, \
78 { NULL } \
82 * Address request
84 struct ngm_ccatm_addr_req {
85 uint32_t port;
86 struct uni_addr addr;
88 #define NGM_CCATM_ADDR_REQ_INFO \
89 { \
90 { "port", &ng_parse_uint32_type }, \
91 { "addr", &ng_ccatm_uni_addr_type }, \
92 { NULL }, \
96 * Get current address list
98 struct ngm_ccatm_get_addresses {
99 uint32_t count;
100 struct ngm_ccatm_addr_req addr[];
102 #define NGM_CCATM_ADDR_REQ_ARRAY_INFO \
104 &ng_ccatm_addr_req_type, \
105 ng_ccatm_addr_req_array_getlen \
107 #define NGM_CCATM_GET_ADDRESSES_INFO \
109 { "count", &ng_parse_uint32_type }, \
110 { "addr", &ng_ccatm_addr_req_array_type }, \
111 { NULL } \
115 * Port as parameter
117 struct ngm_ccatm_port {
118 uint32_t port;
120 #define NGM_CCATM_PORT_INFO \
122 { "port", &ng_parse_uint32_type }, \
123 { NULL } \
127 * Port parameters.
128 * This must be synchronized with atmapi.h::struct atm_port_info.
130 #define NGM_CCATM_ESI_INFO \
132 &ng_parse_hint8_type, \
135 #define NGM_CCATM_ATM_PORT_INFO \
137 { "port", &ng_parse_uint32_type }, \
138 { "pcr", &ng_parse_uint32_type }, \
139 { "max_vpi_bits", &ng_parse_uint32_type }, \
140 { "max_vci_bits", &ng_parse_uint32_type }, \
141 { "max_svpc_vpi", &ng_parse_uint32_type }, \
142 { "max_svcc_vpi", &ng_parse_uint32_type }, \
143 { "min_svcc_vci", &ng_parse_uint32_type }, \
144 { "esi", &ng_ccatm_esi_type }, \
145 { "num_addr", &ng_parse_uint32_type }, \
146 { NULL } \
150 * List of port numbers
152 struct ngm_ccatm_portlist {
153 uint32_t nports;
154 uint32_t ports[];
156 #define NGM_CCATM_PORT_ARRAY_INFO \
158 &ng_parse_uint32_type, \
159 ng_ccatm_port_array_getlen \
161 #define NGM_CCATM_PORTLIST_INFO \
163 { "nports", &ng_parse_uint32_type }, \
164 { "ports", &ng_ccatm_port_array_type }, \
165 { NULL } \
168 struct ccatm_op {
169 uint32_t op; /* request code */
170 u_char data[];
173 #endif