ng_ubt.h revision 139823
1193326Sed/*
2193326Sed * ng_ubt.h
3193326Sed */
4193326Sed
5193326Sed/*-
6193326Sed * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7193326Sed * All rights reserved.
8193326Sed *
9193326Sed * Redistribution and use in source and binary forms, with or without
10193326Sed * modification, are permitted provided that the following conditions
11193326Sed * are met:
12193326Sed * 1. Redistributions of source code must retain the above copyright
13193326Sed *    notice, this list of conditions and the following disclaimer.
14193326Sed * 2. Redistributions in binary form must reproduce the above copyright
15193326Sed *    notice, this list of conditions and the following disclaimer in the
16193326Sed *    documentation and/or other materials provided with the distribution.
17193326Sed *
18193326Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19193326Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20193326Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21193326Sed * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22193326Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23193326Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24198092Srdivacky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25243830Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26193326Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27193326Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28193326Sed * SUCH DAMAGE.
29193326Sed *
30193326Sed * $Id: ng_ubt.h,v 1.6 2003/04/13 21:34:42 max Exp $
31193326Sed * $FreeBSD: head/sys/netgraph/bluetooth/include/ng_ubt.h 139823 2005-01-07 01:45:51Z imp $
32193326Sed */
33193326Sed
34193326Sed#ifndef _NG_UBT_H_
35193326Sed#define _NG_UBT_H_
36193326Sed
37193326Sed/**************************************************************************
38193326Sed **************************************************************************
39193326Sed **     Netgraph node hook name, type name and type cookie and commands
40193326Sed **************************************************************************
41193326Sed **************************************************************************/
42193326Sed
43193326Sed#define NG_UBT_NODE_TYPE	"ubt"
44193326Sed#define NG_UBT_HOOK		"hook"
45193326Sed
46224145Sdim#define NGM_UBT_COOKIE		1021837971
47224145Sdim
48224145Sdim/* Debug levels */
49224145Sdim#define NG_UBT_ALERT_LEVEL	1
50224145Sdim#define NG_UBT_ERR_LEVEL	2
51193326Sed#define NG_UBT_WARN_LEVEL	3
52224145Sdim#define NG_UBT_INFO_LEVEL	4
53198092Srdivacky
54193326Sed/**************************************************************************
55193326Sed **************************************************************************
56193326Sed **                    UBT node command/event parameters
57198092Srdivacky **************************************************************************
58193326Sed **************************************************************************/
59193326Sed
60193326Sed#define NGM_UBT_NODE_SET_DEBUG	1		/* set debug level */
61198092Srdivacky#define NGM_UBT_NODE_GET_DEBUG	2		/* get debug level */
62224145Sdimtypedef u_int16_t		ng_ubt_node_debug_ep;
63224145Sdim
64224145Sdim#define NGM_UBT_NODE_SET_QLEN	3		/* set queue length */
65198092Srdivacky#define NGM_UBT_NODE_GET_QLEN	4		/* get queue length */
66224145Sdimtypedef struct {
67224145Sdim	int32_t		queue;			/* queue index */
68224145Sdim#define	NGM_UBT_NODE_QUEUE_CMD	1		/* commands */
69224145Sdim#define	NGM_UBT_NODE_QUEUE_ACL	2		/* ACL data */
70224145Sdim#define	NGM_UBT_NODE_QUEUE_SCO	3		/* SCO data */
71224145Sdim
72224145Sdim	int32_t		qlen;			/* queue length */
73224145Sdim} ng_ubt_node_qlen_ep;
74226633Sdim
75226633Sdim#define NGM_UBT_NODE_GET_STAT	5		/* get statistic */
76226633Sdimtypedef struct {
77226633Sdim	u_int32_t	pckts_recv;		/* # of packets received */
78224145Sdim	u_int32_t	bytes_recv;		/* # of bytes received */
79193326Sed	u_int32_t	pckts_sent;		/* # of packets sent */
80193326Sed	u_int32_t	bytes_sent;		/* # of bytes sent */
81193326Sed	u_int32_t	oerrors;		/* # of output errors */
82193326Sed	u_int32_t	ierrors;		/* # of input errors */
83198092Srdivacky} ng_ubt_node_stat_ep;
84193326Sed
85193326Sed#define NGM_UBT_NODE_RESET_STAT	6		/* reset statistic */
86193326Sed
87193326Sed#define NGM_UBT_NODE_DEV_NODES	7		/* on/off device interface */
88193326Sedtypedef u_int16_t	ng_ubt_node_dev_nodes_ep;
89198092Srdivacky
90193326Sed#endif /* ndef _NG_UBT_H_ */
91193326Sed
92193326Sed