ng_h4_prse.h revision 107120
1/*
2 * ng_h4_prse.h
3 *
4 * Copyright (c) 2001 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: ng_h4_prse.h,v 1.6 2002/09/04 21:35:01 max Exp $
29 * $FreeBSD: head/sys/netgraph/bluetooth/drivers/h4/ng_h4_prse.h 107120 2002-11-20 23:01:59Z julian $
30 */
31
32/***************************************************************************
33 ***************************************************************************
34 **                  ng_parse definitions for the H4 node
35 ***************************************************************************
36 ***************************************************************************/
37
38#ifndef _NETGRAPH_H4_PRSE_H_
39#define _NETGRAPH_H4_PRSE_H_ 1
40
41/*
42 * H4 node command list
43 */
44
45/* Stat info */
46static const struct ng_parse_struct_field	ng_h4_stat_type_fields[] =
47{
48	{ "pckts_recv",	&ng_parse_uint32_type, },
49	{ "bytes_recv",	&ng_parse_uint32_type, },
50	{ "pckts_sent",	&ng_parse_uint32_type, },
51	{ "bytes_sent",	&ng_parse_uint32_type, },
52	{ "oerrors",	&ng_parse_uint32_type, },
53	{ "ierrors",	&ng_parse_uint32_type, },
54	{ NULL, }
55};
56static const struct ng_parse_type		ng_h4_stat_type = {
57	&ng_parse_struct_type,
58	&ng_h4_stat_type_fields
59};
60
61static const struct ng_cmdlist	ng_h4_cmdlist[] = {
62	{
63		NGM_H4_COOKIE,
64		NGM_H4_NODE_RESET,
65		"reset",
66		NULL,
67		NULL
68	},
69	{
70		NGM_H4_COOKIE,
71		NGM_H4_NODE_GET_STATE,
72		"get_state",
73		NULL,
74		&ng_parse_uint16_type
75	},
76	{
77		NGM_H4_COOKIE,
78		NGM_H4_NODE_GET_DEBUG,
79		"get_debug",
80		NULL,
81		&ng_parse_uint16_type
82	},
83	{
84		NGM_H4_COOKIE,
85		NGM_H4_NODE_SET_DEBUG,
86		"set_debug",
87		&ng_parse_uint16_type,
88		NULL
89	},
90	{
91		NGM_H4_COOKIE,
92		NGM_H4_NODE_GET_QLEN,
93		"get_qlen",
94		NULL,
95		&ng_parse_int32_type
96	},
97	{
98		NGM_H4_COOKIE,
99		NGM_H4_NODE_SET_QLEN,
100		"set_qlen",
101		&ng_parse_int32_type,
102		NULL
103	},
104	{
105		NGM_H4_COOKIE,
106		NGM_H4_NODE_GET_STAT,
107		"get_stat",
108		NULL,
109		&ng_h4_stat_type
110	},
111	{
112		NGM_H4_COOKIE,
113		NGM_H4_NODE_RESET_STAT,
114		"reset_stat",
115		NULL,
116		NULL
117	},
118	{ 0, }
119};
120
121#endif /* ndef _NETGRAPH_H4_PRSE_H_ */
122
123