ng_vjc.h revision 122481
152419Sjulian 252419Sjulian/* 352419Sjulian * ng_vjc.h 452419Sjulian * 552419Sjulian * Copyright (c) 1996-1999 Whistle Communications, Inc. 652419Sjulian * All rights reserved. 752419Sjulian * 852419Sjulian * Subject to the following obligations and disclaimer of warranty, use and 952419Sjulian * redistribution of this software, in source or object code forms, with or 1052419Sjulian * without modifications are expressly permitted by Whistle Communications; 1152419Sjulian * provided, however, that: 1252419Sjulian * 1. Any and all reproductions of the source or object code must include the 1352419Sjulian * copyright notice above and the following disclaimer of warranties; and 1452419Sjulian * 2. No rights are granted, in any manner or form, to use Whistle 1552419Sjulian * Communications, Inc. trademarks, including the mark "WHISTLE 1652419Sjulian * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 1752419Sjulian * such appears in the above copyright notice or in the software. 1852419Sjulian * 1952419Sjulian * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 2052419Sjulian * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 2152419Sjulian * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 2252419Sjulian * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 2352419Sjulian * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 2452419Sjulian * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 2552419Sjulian * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 2652419Sjulian * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 2752419Sjulian * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 2852419Sjulian * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 2952419Sjulian * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 3052419Sjulian * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 3152419Sjulian * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 3252419Sjulian * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3352419Sjulian * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3452419Sjulian * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 3552419Sjulian * OF SUCH DAMAGE. 3652419Sjulian * 3767506Sjulian * Author: Archie Cobbs <archie@freebsd.org> 3852419Sjulian * 3952419Sjulian * $FreeBSD: head/sys/netgraph/ng_vjc.h 122481 2003-11-11 12:30:37Z ru $ 4052419Sjulian * $Whistle: ng_vjc.h,v 1.6 1999/01/25 02:40:22 archie Exp $ 4152419Sjulian */ 4252419Sjulian 43122481Sru#ifndef _NETGRAPH_NG_VJC_H_ 44122481Sru#define _NETGRAPH_NG_VJC_H_ 4552419Sjulian 4652419Sjulian /* Node type name and magic cookie */ 4752419Sjulian#define NG_VJC_NODE_TYPE "vjc" 4864509Sarchie#define NGM_VJC_COOKIE 868219210 4952419Sjulian 5052419Sjulian /* Hook names */ 5152419Sjulian#define NG_VJC_HOOK_IP "ip" /* normal IP traffic */ 5252419Sjulian#define NG_VJC_HOOK_VJCOMP "vjcomp" /* compressed TCP */ 5352419Sjulian#define NG_VJC_HOOK_VJUNCOMP "vjuncomp" /* uncompressed TCP */ 5452419Sjulian#define NG_VJC_HOOK_VJIP "vjip" /* uncompressed IP */ 5552419Sjulian 5653190Sarchie /* Minimum and maximum number of compression channels */ 5752419Sjulian#define NG_VJC_MIN_CHANNELS 4 5852419Sjulian#define NG_VJC_MAX_CHANNELS 16 5952419Sjulian 6052419Sjulian /* Configure struct */ 6152419Sjulianstruct ngm_vjc_config { 6252539Sjulian u_char enableComp; /* Enable compression */ 6352539Sjulian u_char enableDecomp; /* Enable decompression */ 6453087Sarchie u_char maxChannel; /* Number of compression channels - 1 */ 6552419Sjulian u_char compressCID; /* OK to compress outgoing CID's */ 6652419Sjulian}; 6752419Sjulian 6864509Sarchie/* Keep this in sync with the above structure definition */ 6964509Sarchie#define NG_VJC_CONFIG_TYPE_INFO { \ 7064509Sarchie { "enableComp", &ng_parse_uint8_type }, \ 7164509Sarchie { "enableDecomp", &ng_parse_uint8_type }, \ 7264509Sarchie { "maxChannel", &ng_parse_uint8_type }, \ 7364509Sarchie { "compressCID", &ng_parse_uint8_type }, \ 7497685Sarchie { NULL } \ 7564509Sarchie} 7664509Sarchie 7752419Sjulian /* Netgraph commands */ 7852419Sjulianenum { 7952539Sjulian NGM_VJC_SET_CONFIG, /* Supply a struct ngm_vjc_config */ 8064509Sarchie NGM_VJC_GET_CONFIG, /* Returns a struct ngm_vjc_config */ 8152419Sjulian NGM_VJC_GET_STATE, /* Returns current struct slcompress */ 8252419Sjulian NGM_VJC_CLR_STATS, /* Clears statistics counters */ 8352419Sjulian NGM_VJC_RECV_ERROR, /* Indicate loss of incoming frame */ 8452419Sjulian}; 8552419Sjulian 86122481Sru#endif /* _NETGRAPH_NG_VJC_H_ */ 87