udbp.h revision 184610
1184610Salfred/*- 2184610Salfred * Copyright (c) 1996-2000 Whistle Communications, Inc. 3184610Salfred * All rights reserved. 4184610Salfred * 5184610Salfred * Subject to the following obligations and disclaimer of warranty, use and 6184610Salfred * redistribution of this software, in source or object code forms, with or 7184610Salfred * without modifications are expressly permitted by Whistle Communications; 8184610Salfred * provided, however, that: 9184610Salfred * 1. Any and all reproductions of the source or object code must include the 10184610Salfred * copyright notice above and the following disclaimer of warranties; and 11184610Salfred * 2. No rights are granted, in any manner or form, to use Whistle 12184610Salfred * Communications, Inc. trademarks, including the mark "WHISTLE 13184610Salfred * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 14184610Salfred * such appears in the above copyright notice or in the software. 15184610Salfred * 16184610Salfred * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 17184610Salfred * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 18184610Salfred * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 19184610Salfred * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 20184610Salfred * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 21184610Salfred * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 22184610Salfred * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 23184610Salfred * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 24184610Salfred * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 25184610Salfred * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 26184610Salfred * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 27184610Salfred * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 28184610Salfred * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 29184610Salfred * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30184610Salfred * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31184610Salfred * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 32184610Salfred * OF SUCH DAMAGE. 33184610Salfred * 34184610Salfred * This file was derived from src/sys/netgraph/ng_sample.h, revision 1.1 35184610Salfred * written by Julian Elischer, Whistle Communications. 36184610Salfred * 37184610Salfred * $FreeBSD: head/sys/dev/usb2/misc/udbp2.h 184610 2008-11-04 02:31:03Z alfred $ 38184610Salfred */ 39184610Salfred 40184610Salfred#ifndef _NETGRAPH_UDBP_H_ 41184610Salfred#define _NETGRAPH_UDBP_H_ 42184610Salfred 43184610Salfred/* Node type name. This should be unique among all netgraph node types */ 44184610Salfred#define NG_UDBP_NODE_TYPE "udbp" 45184610Salfred 46184610Salfred/* Node type cookie. Should also be unique. This value MUST change whenever 47184610Salfred an incompatible change is made to this header file, to insure consistency. 48184610Salfred The de facto method for generating cookies is to take the output of the 49184610Salfred date command: date -u +'%s' */ 50184610Salfred#define NGM_UDBP_COOKIE 944609300 51184610Salfred 52184610Salfred 53184610Salfred#define NG_UDBP_HOOK_NAME "data" 54184610Salfred 55184610Salfred/* Netgraph commands understood by this node type */ 56184610Salfredenum { 57184610Salfred NGM_UDBP_SET_FLAG = 1, 58184610Salfred NGM_UDBP_GET_STATUS, 59184610Salfred}; 60184610Salfred 61184610Salfred/* This structure is returned by the NGM_UDBP_GET_STATUS command */ 62184610Salfredstruct ngudbpstat { 63184610Salfred uint32_t packets_in; /* packets in from downstream */ 64184610Salfred uint32_t packets_out; /* packets out towards downstream */ 65184610Salfred}; 66184610Salfred 67184610Salfred/* 68184610Salfred * This is used to define the 'parse type' for a struct ngudbpstat, which 69184610Salfred * is bascially a description of how to convert a binary struct ngudbpstat 70184610Salfred * to an ASCII string and back. See ng_parse.h for more info. 71184610Salfred * 72184610Salfred * This needs to be kept in sync with the above structure definition 73184610Salfred */ 74184610Salfred#define NG_UDBP_STATS_TYPE_INFO { \ 75184610Salfred { "packets_in", &ng_parse_int32_type }, \ 76184610Salfred { "packets_out", &ng_parse_int32_type }, \ 77184610Salfred { NULL }, \ 78184610Salfred} 79184610Salfred 80184610Salfred#endif /* _NETGRAPH_UDBP_H_ */ 81