1107120Sjulian/*
2107120Sjulian * ng_ubt.h
3139823Simp */
4139823Simp
5139823Simp/*-
6107120Sjulian * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7107120Sjulian * All rights reserved.
8107120Sjulian *
9107120Sjulian * Redistribution and use in source and binary forms, with or without
10107120Sjulian * modification, are permitted provided that the following conditions
11107120Sjulian * are met:
12107120Sjulian * 1. Redistributions of source code must retain the above copyright
13107120Sjulian *    notice, this list of conditions and the following disclaimer.
14107120Sjulian * 2. Redistributions in binary form must reproduce the above copyright
15107120Sjulian *    notice, this list of conditions and the following disclaimer in the
16107120Sjulian *    documentation and/or other materials provided with the distribution.
17107120Sjulian *
18107120Sjulian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19107120Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20107120Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21107120Sjulian * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22107120Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23107120Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24107120Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25107120Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26107120Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27107120Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28107120Sjulian * SUCH DAMAGE.
29107120Sjulian *
30114878Sjulian * $Id: ng_ubt.h,v 1.6 2003/04/13 21:34:42 max Exp $
31107120Sjulian * $FreeBSD$
32107120Sjulian */
33107120Sjulian
34107120Sjulian#ifndef _NG_UBT_H_
35107120Sjulian#define _NG_UBT_H_
36107120Sjulian
37107120Sjulian/**************************************************************************
38107120Sjulian **************************************************************************
39107120Sjulian **     Netgraph node hook name, type name and type cookie and commands
40107120Sjulian **************************************************************************
41107120Sjulian **************************************************************************/
42107120Sjulian
43107120Sjulian#define NG_UBT_NODE_TYPE	"ubt"
44107120Sjulian#define NG_UBT_HOOK		"hook"
45107120Sjulian
46107120Sjulian#define NGM_UBT_COOKIE		1021837971
47107120Sjulian
48107120Sjulian/* Debug levels */
49107120Sjulian#define NG_UBT_ALERT_LEVEL	1
50107120Sjulian#define NG_UBT_ERR_LEVEL	2
51107120Sjulian#define NG_UBT_WARN_LEVEL	3
52107120Sjulian#define NG_UBT_INFO_LEVEL	4
53107120Sjulian
54107120Sjulian/**************************************************************************
55107120Sjulian **************************************************************************
56107120Sjulian **                    UBT node command/event parameters
57107120Sjulian **************************************************************************
58107120Sjulian **************************************************************************/
59107120Sjulian
60107120Sjulian#define NGM_UBT_NODE_SET_DEBUG	1		/* set debug level */
61107120Sjulian#define NGM_UBT_NODE_GET_DEBUG	2		/* get debug level */
62107120Sjuliantypedef u_int16_t		ng_ubt_node_debug_ep;
63107120Sjulian
64107120Sjulian#define NGM_UBT_NODE_SET_QLEN	3		/* set queue length */
65107120Sjulian#define NGM_UBT_NODE_GET_QLEN	4		/* get queue length */
66107120Sjuliantypedef struct {
67107120Sjulian	int32_t		queue;			/* queue index */
68114878Sjulian#define	NGM_UBT_NODE_QUEUE_CMD	1		/* commands */
69114878Sjulian#define	NGM_UBT_NODE_QUEUE_ACL	2		/* ACL data */
70114878Sjulian#define	NGM_UBT_NODE_QUEUE_SCO	3		/* SCO data */
71107120Sjulian
72107120Sjulian	int32_t		qlen;			/* queue length */
73107120Sjulian} ng_ubt_node_qlen_ep;
74107120Sjulian
75107120Sjulian#define NGM_UBT_NODE_GET_STAT	5		/* get statistic */
76107120Sjuliantypedef struct {
77107120Sjulian	u_int32_t	pckts_recv;		/* # of packets received */
78107120Sjulian	u_int32_t	bytes_recv;		/* # of bytes received */
79107120Sjulian	u_int32_t	pckts_sent;		/* # of packets sent */
80107120Sjulian	u_int32_t	bytes_sent;		/* # of bytes sent */
81107120Sjulian	u_int32_t	oerrors;		/* # of output errors */
82107120Sjulian	u_int32_t	ierrors;		/* # of input errors */
83107120Sjulian} ng_ubt_node_stat_ep;
84107120Sjulian
85107120Sjulian#define NGM_UBT_NODE_RESET_STAT	6		/* reset statistic */
86107120Sjulian
87114878Sjulian#define NGM_UBT_NODE_DEV_NODES	7		/* on/off device interface */
88114878Sjuliantypedef u_int16_t	ng_ubt_node_dev_nodes_ep;
89114878Sjulian
90107120Sjulian#endif /* ndef _NG_UBT_H_ */
91107120Sjulian
92