]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/netgraph/atm/ng_uni.h
MFV r339640,339641,339644:
[FreeBSD/FreeBSD.git] / sys / netgraph / atm / ng_uni.h
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2001-2003
5  *      Fraunhofer Institute for Open Communication Systems (FhG Fokus).
6  *      All rights reserved.
7  *
8  * Author: Hartmut Brandt <harti@freebsd.org>
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  * $FreeBSD$
32  *
33  * Netgraph module for UNI 4.0
34  */
35 #ifndef _NETGRAPH_ATM_NG_UNI_H_
36 #define _NETGRAPH_ATM_NG_UNI_H_
37
38 #define NG_UNI_NODE_TYPE "uni"
39 #define NGM_UNI_COOKIE  981112392
40
41 enum {
42         NGM_UNI_GETDEBUG,       /* get debug flags */
43         NGM_UNI_SETDEBUG,       /* set debug flags */
44         NGM_UNI_GET_CONFIG,     /* get configuration */
45         NGM_UNI_SET_CONFIG,     /* set configuration */
46         NGM_UNI_ENABLE,         /* enable processing */
47         NGM_UNI_DISABLE,        /* free resources and disable */
48         NGM_UNI_GETSTATE,       /* retrieve coord state */
49 };
50
51 struct ngm_uni_debug {
52         uint32_t        level[UNI_MAXFACILITY];
53 };
54 #define NGM_UNI_DEBUGLEVEL_INFO {                               \
55         &ng_parse_uint32_type,                                  \
56         UNI_MAXFACILITY                                         \
57 }
58 #define NGM_UNI_DEBUG_INFO                                      \
59         {                                                       \
60           { "level",    &ng_uni_debuglevel_type },              \
61           { NULL }                                              \
62         }
63
64 #define NGM_UNI_CONFIG_INFO                                     \
65         {                                                       \
66           { "proto",    &ng_parse_uint32_type },                \
67           { "popt",     &ng_parse_uint32_type },                \
68           { "option",   &ng_parse_uint32_type },                \
69           { "timer301", &ng_parse_uint32_type },                \
70           { "timer303", &ng_parse_uint32_type },                \
71           { "init303",  &ng_parse_uint32_type },                \
72           { "timer308", &ng_parse_uint32_type },                \
73           { "init308",  &ng_parse_uint32_type },                \
74           { "timer309", &ng_parse_uint32_type },                \
75           { "timer310", &ng_parse_uint32_type },                \
76           { "timer313", &ng_parse_uint32_type },                \
77           { "timer316", &ng_parse_uint32_type },                \
78           { "init316",  &ng_parse_uint32_type },                \
79           { "timer317", &ng_parse_uint32_type },                \
80           { "timer322", &ng_parse_uint32_type },                \
81           { "init322",  &ng_parse_uint32_type },                \
82           { "timer397", &ng_parse_uint32_type },                \
83           { "timer398", &ng_parse_uint32_type },                \
84           { "timer399", &ng_parse_uint32_type },                \
85           { NULL }                                              \
86         }
87
88 struct ngm_uni_config_mask {
89         uint32_t                mask;
90         uint32_t                popt_mask;
91         uint32_t                option_mask;
92 };
93 #define NGM_UNI_CONFIG_MASK_INFO                                \
94         {                                                       \
95           { "mask",             &ng_parse_hint32_type },        \
96           { "popt_mask",        &ng_parse_hint32_type },        \
97           { "option_mask",      &ng_parse_hint32_type },        \
98           { NULL }                                              \
99         }
100
101 struct ngm_uni_set_config {
102         struct uni_config               config;
103         struct ngm_uni_config_mask      mask;
104 };
105 #define NGM_UNI_SET_CONFIG_INFO                                 \
106         {                                                       \
107           { "config",           &ng_uni_config_type },          \
108           { "mask",             &ng_uni_config_mask_type },     \
109           { NULL }                                              \
110         }
111
112 /*
113  * API message
114  */
115 struct uni_arg {
116         uint32_t        sig;
117         uint32_t        cookie;
118         u_char          data[];
119 };
120
121 #endif