14cf49a43SJulian Elischer /* 24cf49a43SJulian Elischer * ng_hole.h 3c398230bSWarner Losh */ 4c398230bSWarner Losh 5c398230bSWarner Losh /*- 64cf49a43SJulian Elischer * Copyright (c) 1996-1999 Whistle Communications, Inc. 74cf49a43SJulian Elischer * All rights reserved. 84cf49a43SJulian Elischer * 94cf49a43SJulian Elischer * Subject to the following obligations and disclaimer of warranty, use and 104cf49a43SJulian Elischer * redistribution of this software, in source or object code forms, with or 114cf49a43SJulian Elischer * without modifications are expressly permitted by Whistle Communications; 124cf49a43SJulian Elischer * provided, however, that: 134cf49a43SJulian Elischer * 1. Any and all reproductions of the source or object code must include the 144cf49a43SJulian Elischer * copyright notice above and the following disclaimer of warranties; and 154cf49a43SJulian Elischer * 2. No rights are granted, in any manner or form, to use Whistle 164cf49a43SJulian Elischer * Communications, Inc. trademarks, including the mark "WHISTLE 174cf49a43SJulian Elischer * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 184cf49a43SJulian Elischer * such appears in the above copyright notice or in the software. 194cf49a43SJulian Elischer * 204cf49a43SJulian Elischer * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 214cf49a43SJulian Elischer * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 224cf49a43SJulian Elischer * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 234cf49a43SJulian Elischer * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 244cf49a43SJulian Elischer * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 254cf49a43SJulian Elischer * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 264cf49a43SJulian Elischer * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 274cf49a43SJulian Elischer * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 284cf49a43SJulian Elischer * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 294cf49a43SJulian Elischer * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 304cf49a43SJulian Elischer * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 314cf49a43SJulian Elischer * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 324cf49a43SJulian Elischer * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 334cf49a43SJulian Elischer * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 344cf49a43SJulian Elischer * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 354cf49a43SJulian Elischer * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 364cf49a43SJulian Elischer * OF SUCH DAMAGE. 374cf49a43SJulian Elischer * 38cc3bbd68SJulian Elischer * Author: Archie Cobbs <archie@freebsd.org> 394cf49a43SJulian Elischer * $Whistle: ng_hole.h,v 1.3 1999/01/20 00:22:13 archie Exp $ 404cf49a43SJulian Elischer */ 414cf49a43SJulian Elischer 42e20480bfSRuslan Ermilov #ifndef _NETGRAPH_NG_HOLE_H_ 43e20480bfSRuslan Ermilov #define _NETGRAPH_NG_HOLE_H_ 444cf49a43SJulian Elischer 454cf49a43SJulian Elischer /* Node type name and magic cookie */ 464cf49a43SJulian Elischer #define NG_HOLE_NODE_TYPE "hole" 474cf49a43SJulian Elischer #define NGM_HOLE_COOKIE 915433206 48171e08dcSRuslan Ermilov 49171e08dcSRuslan Ermilov /* Statistics structure for one hook. */ 50171e08dcSRuslan Ermilov struct ng_hole_hookstat { 51171e08dcSRuslan Ermilov uint64_t frames; 52171e08dcSRuslan Ermilov uint64_t octets; 53171e08dcSRuslan Ermilov }; 54171e08dcSRuslan Ermilov 55171e08dcSRuslan Ermilov /* Keep this in sync with the above structure definition. */ 56171e08dcSRuslan Ermilov #define NG_HOLE_HOOKSTAT_TYPE_INFO { \ 57171e08dcSRuslan Ermilov { "frames", &ng_parse_uint64_type }, \ 58171e08dcSRuslan Ermilov { "octets", &ng_parse_uint64_type }, \ 59171e08dcSRuslan Ermilov { NULL } \ 60171e08dcSRuslan Ermilov } 61171e08dcSRuslan Ermilov 62171e08dcSRuslan Ermilov /* Netgraph commands. */ 63171e08dcSRuslan Ermilov enum { 64171e08dcSRuslan Ermilov NGM_HOLE_GET_STATS = 1, 65171e08dcSRuslan Ermilov NGM_HOLE_CLR_STATS, 66171e08dcSRuslan Ermilov NGM_HOLE_GETCLR_STATS, 67171e08dcSRuslan Ermilov }; 684cf49a43SJulian Elischer 69e20480bfSRuslan Ermilov #endif /* _NETGRAPH_NG_HOLE_H_ */ 70