/*1* ng_async.h2*/34/*-5* Copyright (c) 1996-1999 Whistle Communications, Inc.6* All rights reserved.7*8* Subject to the following obligations and disclaimer of warranty, use and9* redistribution of this software, in source or object code forms, with or10* without modifications are expressly permitted by Whistle Communications;11* provided, however, that:12* 1. Any and all reproductions of the source or object code must include the13* copyright notice above and the following disclaimer of warranties; and14* 2. No rights are granted, in any manner or form, to use Whistle15* Communications, Inc. trademarks, including the mark "WHISTLE16* COMMUNICATIONS" on advertising, endorsements, or otherwise except as17* such appears in the above copyright notice or in the software.18*19* THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND20* TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO21* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,22* INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF23* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.24* WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY25* REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS26* SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.27* IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES28* RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING29* WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,30* PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR31* SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY32* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT33* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF34* THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY35* OF SUCH DAMAGE.36*37* Author: Archie Cobbs <[email protected]>38* $Whistle: ng_async.h,v 1.5 1999/01/25 01:17:14 archie Exp $39*/4041#ifndef _NETGRAPH_NG_ASYNC_H_42#define _NETGRAPH_NG_ASYNC_H_4344/* Type name and cookie */45#define NG_ASYNC_NODE_TYPE "async"46#define NGM_ASYNC_COOKIE 8864737174748/* Hook names */49#define NG_ASYNC_HOOK_SYNC "sync" /* Sync frames */50#define NG_ASYNC_HOOK_ASYNC "async" /* Async-encoded frames */5152/* Maximum receive size bounds (for both sync and async sides) */53#define NG_ASYNC_MIN_MRU 154#define NG_ASYNC_MAX_MRU 819255#define NG_ASYNC_DEFAULT_MRU 16005657/* Frame statistics */58struct ng_async_stat {59u_int32_t syncOctets;60u_int32_t syncFrames;61u_int32_t syncOverflows;62u_int32_t asyncOctets;63u_int32_t asyncFrames;64u_int32_t asyncRunts;65u_int32_t asyncOverflows;66u_int32_t asyncBadCheckSums;67};6869/* Keep this in sync with the above structure definition */70#define NG_ASYNC_STATS_TYPE_INFO { \71{ "syncOctets", &ng_parse_uint32_type }, \72{ "syncFrames", &ng_parse_uint32_type }, \73{ "syncOverflows", &ng_parse_uint32_type }, \74{ "asyncOctets", &ng_parse_uint32_type }, \75{ "asyncFrames", &ng_parse_uint32_type }, \76{ "asyncRunts", &ng_parse_uint32_type }, \77{ "asyncOverflows", &ng_parse_uint32_type }, \78{ "asyncBadCheckSums",&ng_parse_uint32_type }, \79{ NULL } \80}8182/* Configuration for this node */83struct ng_async_cfg {84u_char enabled; /* Turn encoding on/off */85u_int16_t amru; /* Max receive async frame length */86u_int16_t smru; /* Max receive sync frame length */87u_int32_t accm; /* ACCM encoding */88};8990/* Keep this in sync with the above structure definition */91#define NG_ASYNC_CONFIG_TYPE_INFO { \92{ "enabled", &ng_parse_int8_type }, \93{ "amru", &ng_parse_uint16_type }, \94{ "smru", &ng_parse_uint16_type }, \95{ "accm", &ng_parse_hint32_type }, \96{ NULL } \97}9899/* Commands */100enum {101NGM_ASYNC_CMD_GET_STATS = 1, /* returns struct ng_async_stat */102NGM_ASYNC_CMD_CLR_STATS,103NGM_ASYNC_CMD_SET_CONFIG, /* takes struct ng_async_cfg */104NGM_ASYNC_CMD_GET_CONFIG, /* returns struct ng_async_cfg */105};106107#endif /* _NETGRAPH_NG_ASYNC_H_ */108109110