152419Sjulian/* 252419Sjulian * ng_sample.h 3139823Simp */ 4139823Simp 5139823Simp/*- 652419Sjulian * Copyright (c) 1996-1999 Whistle Communications, Inc. 752419Sjulian * All rights reserved. 852419Sjulian * 952419Sjulian * Subject to the following obligations and disclaimer of warranty, use and 1052419Sjulian * redistribution of this software, in source or object code forms, with or 1152419Sjulian * without modifications are expressly permitted by Whistle Communications; 1252419Sjulian * provided, however, that: 1352419Sjulian * 1. Any and all reproductions of the source or object code must include the 1452419Sjulian * copyright notice above and the following disclaimer of warranties; and 1552419Sjulian * 2. No rights are granted, in any manner or form, to use Whistle 1652419Sjulian * Communications, Inc. trademarks, including the mark "WHISTLE 1752419Sjulian * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 1852419Sjulian * such appears in the above copyright notice or in the software. 1952419Sjulian * 2052419Sjulian * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 2152419Sjulian * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 2252419Sjulian * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 2352419Sjulian * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 2452419Sjulian * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 2552419Sjulian * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 2652419Sjulian * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 2752419Sjulian * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 2852419Sjulian * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 2952419Sjulian * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 3052419Sjulian * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 3152419Sjulian * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 3252419Sjulian * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 3352419Sjulian * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3452419Sjulian * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3552419Sjulian * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 3652419Sjulian * OF SUCH DAMAGE. 3752419Sjulian * 3867506Sjulian * Author: Julian Elischer <julian@freebsd.org> 3952419Sjulian * 4052419Sjulian * $FreeBSD$ 4152419Sjulian * $Whistle: ng_sample.h,v 1.3 1999/01/20 00:22:14 archie Exp $ 4252419Sjulian */ 4352419Sjulian 44122481Sru#ifndef _NETGRAPH_NG_SAMPLE_H_ 45122481Sru#define _NETGRAPH_NG_SAMPLE_H_ 4652419Sjulian 4752419Sjulian/* Node type name. This should be unique among all netgraph node types */ 4852419Sjulian#define NG_XXX_NODE_TYPE "sample" 4952419Sjulian 5052419Sjulian/* Node type cookie. Should also be unique. This value MUST change whenever 5152419Sjulian an incompatible change is made to this header file, to insure consistency. 5252419Sjulian The de facto method for generating cookies is to take the output of the 5352419Sjulian date command: date -u +'%s' */ 5452419Sjulian#define NGM_XXX_COOKIE 915491374 5552419Sjulian 5652419Sjulian/* Number of active DLCI's we can handle */ 5752419Sjulian#define XXX_NUM_DLCIS 16 5852419Sjulian 5952419Sjulian/* Hook names */ 6052419Sjulian#define NG_XXX_HOOK_DLCI_LEADIN "dlci" 6152419Sjulian#define NG_XXX_HOOK_DOWNSTREAM "downstream" 6252419Sjulian#define NG_XXX_HOOK_DEBUG "debug" 6352419Sjulian 6452419Sjulian/* Netgraph commands understood by this node type */ 6552419Sjulianenum { 6652419Sjulian NGM_XXX_SET_FLAG = 1, 6752419Sjulian NGM_XXX_GET_STATUS, 6852419Sjulian}; 6952419Sjulian 7052419Sjulian/* This structure is returned by the NGM_XXX_GET_STATUS command */ 7152419Sjulianstruct ngxxxstat { 7264508Sarchie u_int32_t packets_in; /* packets in from downstream */ 7364508Sarchie u_int32_t packets_out; /* packets out towards downstream */ 7452419Sjulian}; 7552419Sjulian 7653997Sarchie/* 7753997Sarchie * This is used to define the 'parse type' for a struct ngxxxstat, which 7853997Sarchie * is bascially a description of how to convert a binary struct ngxxxstat 7953997Sarchie * to an ASCII string and back. See ng_parse.h for more info. 8053997Sarchie * 8153997Sarchie * This needs to be kept in sync with the above structure definition 8253997Sarchie */ 8353997Sarchie#define NG_XXX_STATS_TYPE_INFO { \ 8464508Sarchie { "packets_in", &ng_parse_uint32_type }, \ 8564508Sarchie { "packets_out", &ng_parse_uint32_type }, \ 8697685Sarchie { NULL } \ 8753997Sarchie} 8853997Sarchie 89122481Sru#endif /* _NETGRAPH_NG_SAMPLE_H_ */ 90