xref: /freebsd-13-stable/sys/netgraph/atm/ng_sscop.h (revision f8167e0404dab9ffeaca95853dd237ab7c587f82)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2001-2003
5  *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
6  * 	All rights reserved.
7  *
8  * Author: Harti 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  * Netgraph module for Q.2110 SSCOP
32  */
33 #ifndef _NETGRAPH_ATM_NG_SSCOP_H_
34 #define _NETGRAPH_ATM_NG_SSCOP_H_
35 
36 #define NG_SSCOP_NODE_TYPE "sscop"
37 #define NGM_SSCOP_COOKIE	980175044
38 
39 /* Netgraph control messages */
40 enum {
41 	NGM_SSCOP_GETPARAM = 1,		/* get parameters */
42 	NGM_SSCOP_SETPARAM,		/* set parameters */
43 	NGM_SSCOP_ENABLE,		/* enable processing */
44 	NGM_SSCOP_DISABLE,		/* disable and reset */
45 	NGM_SSCOP_GETDEBUG,		/* get debugging flags */
46 	NGM_SSCOP_SETDEBUG,		/* set debugging flags */
47 	NGM_SSCOP_GETSTATE,		/* get current SSCOP state */
48 };
49 
50 /* This must be in-sync with the definition in sscopdef.h */
51 #define NG_SSCOP_PARAM_INFO 					\
52 	{							\
53 	  { "timer_cc",		&ng_parse_uint32_type },	\
54 	  { "timer_poll",	&ng_parse_uint32_type },	\
55 	  { "timer_keep_alive",	&ng_parse_uint32_type },	\
56 	  { "timer_no_response",&ng_parse_uint32_type },	\
57 	  { "timer_idle",	&ng_parse_uint32_type },	\
58 	  { "maxk",		&ng_parse_uint32_type },	\
59 	  { "maxj",		&ng_parse_uint32_type },	\
60 	  { "maxcc",		&ng_parse_uint32_type },	\
61 	  { "maxpd",		&ng_parse_uint32_type },	\
62 	  { "maxstat",		&ng_parse_uint32_type },	\
63 	  { "mr",		&ng_parse_uint32_type },	\
64 	  { "flags",		&ng_parse_uint32_type },	\
65 	  { NULL }						\
66 	}
67 
68 struct ng_sscop_setparam {
69 	uint32_t		mask;
70 	struct sscop_param	param;
71 };
72 #define NG_SSCOP_SETPARAM_INFO 					\
73 	{							\
74 	  { "mask",		&ng_parse_uint32_type },	\
75 	  { "param",		&ng_sscop_param_type },		\
76 	  { NULL }						\
77 	}
78 
79 struct ng_sscop_setparam_resp {
80 	uint32_t		mask;
81 	int32_t			error;
82 };
83 #define NG_SSCOP_SETPARAM_RESP_INFO 				\
84 	{							\
85 	  { "mask",		&ng_parse_uint32_type },	\
86 	  { "error",		&ng_parse_int32_type },		\
87 	  { NULL }						\
88 	}
89 
90 /*
91  * Upper interface
92  */
93 struct sscop_arg {
94 	uint32_t	sig;
95 	uint32_t	arg;	/* opt. sequence number or clear-buff */
96 	u_char		data[];
97 };
98 
99 struct sscop_marg {
100 	uint32_t	sig;
101 	u_char		data[];
102 };
103 struct sscop_merr {
104 	uint32_t	sig;
105 	uint32_t	err;	/* error code */
106 	uint32_t	cnt;	/* error count */
107 };
108 
109 #endif
110