1165619Sglebius/*-
2165619Sglebius * Copyright (c) 2006 Alexander Motin <mav@alkar.net>
3165619Sglebius * All rights reserved.
4165619Sglebius *
5165619Sglebius * Redistribution and use in source and binary forms, with or without
6165619Sglebius * modification, are permitted provided that the following conditions
7165619Sglebius * are met:
8165619Sglebius * 1. Redistributions of source code must retain the above copyright
9165619Sglebius *    notice unmodified, this list of conditions, and the following
10165619Sglebius *    disclaimer.
11165619Sglebius * 2. Redistributions in binary form must reproduce the above copyright
12165619Sglebius *    notice, this list of conditions and the following disclaimer in the
13165619Sglebius *    documentation and/or other materials provided with the distribution.
14165619Sglebius *
15165619Sglebius * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16165619Sglebius * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17165619Sglebius * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18165619Sglebius * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19165619Sglebius * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20165619Sglebius * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21165619Sglebius * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22165619Sglebius * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23165619Sglebius * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24165619Sglebius * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25165619Sglebius * SUCH DAMAGE.
26165619Sglebius *
27165619Sglebius * $FreeBSD$
28165619Sglebius */
29165619Sglebius
30165619Sglebius#ifndef _NETGRAPH_NG_PRED1_H_
31165619Sglebius#define _NETGRAPH_NG_PRED1_H_
32165619Sglebius
33165619Sglebius/* Node type name and magic cookie */
34165619Sglebius#define NG_PRED1_NODE_TYPE	"pred1"
35165619Sglebius#define NGM_PRED1_COOKIE	1166902612
36165619Sglebius
37165619Sglebius/* Hook names */
38165619Sglebius#define NG_PRED1_HOOK_COMP	"comp"		/* compression hook */
39165619Sglebius#define NG_PRED1_HOOK_DECOMP	"decomp"	/* decompression hook */
40165619Sglebius
41165619Sglebius/* Config struct */
42165619Sglebiusstruct ng_pred1_config {
43165619Sglebius	u_char		enable;			/* node enabled */
44165619Sglebius};
45165619Sglebius
46165619Sglebius/* Keep this in sync with the above structure definition. */
47165619Sglebius#define NG_PRED1_CONFIG_INFO	{			\
48165619Sglebius	{ "enable",	&ng_parse_uint8_type	},	\
49165619Sglebius	{ NULL }					\
50165619Sglebius}
51165619Sglebius
52165619Sglebius/* Statistics structure for one direction. */
53165619Sglebiusstruct ng_pred1_stats {
54165619Sglebius	uint64_t	FramesPlain;
55165619Sglebius	uint64_t	FramesComp;
56165619Sglebius	uint64_t	FramesUncomp;
57165619Sglebius	uint64_t	InOctets;
58165619Sglebius	uint64_t	OutOctets;
59165619Sglebius	uint64_t	Errors;
60165619Sglebius};
61165619Sglebius
62165619Sglebius/* Keep this in sync with the above structure definition. */
63165619Sglebius#define NG_PRED1_STATS_INFO	{				\
64165619Sglebius	{ "FramesPlain",&ng_parse_uint64_type	},	\
65165619Sglebius	{ "FramesComp",	&ng_parse_uint64_type	},	\
66165619Sglebius	{ "FramesUncomp", &ng_parse_uint64_type	},	\
67165619Sglebius	{ "InOctets",	&ng_parse_uint64_type	},	\
68165619Sglebius	{ "OutOctets",	&ng_parse_uint64_type	},	\
69165619Sglebius	{ "Errors",	&ng_parse_uint64_type	},	\
70165619Sglebius	{ NULL }					\
71165619Sglebius}
72165619Sglebius
73165619Sglebius/* Netgraph commands */
74165619Sglebiusenum {
75165619Sglebius	NGM_PRED1_CONFIG = 1,
76165619Sglebius	NGM_PRED1_RESETREQ,			/* sent either way! */
77165619Sglebius	NGM_PRED1_GET_STATS,
78165619Sglebius	NGM_PRED1_CLR_STATS,
79165619Sglebius	NGM_PRED1_GETCLR_STATS,
80165619Sglebius};
81165619Sglebius
82165619Sglebius#endif /* _NETGRAPH_NG_PRED1_H_ */
83165619Sglebius
84