159109Sarchie/*
259109Sarchie * ng_mppc.h
3139823Simp */
4139823Simp
5139823Simp/*-
659109Sarchie * Copyright (c) 1996-2000 Whistle Communications, Inc.
759109Sarchie * All rights reserved.
859109Sarchie *
959109Sarchie * Subject to the following obligations and disclaimer of warranty, use and
1059109Sarchie * redistribution of this software, in source or object code forms, with or
1159109Sarchie * without modifications are expressly permitted by Whistle Communications;
1259109Sarchie * provided, however, that:
1359109Sarchie * 1. Any and all reproductions of the source or object code must include the
1459109Sarchie *    copyright notice above and the following disclaimer of warranties; and
1559109Sarchie * 2. No rights are granted, in any manner or form, to use Whistle
1659109Sarchie *    Communications, Inc. trademarks, including the mark "WHISTLE
1759109Sarchie *    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
1859109Sarchie *    such appears in the above copyright notice or in the software.
1959109Sarchie *
2059109Sarchie * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
2159109Sarchie * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
2259109Sarchie * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
2359109Sarchie * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
2459109Sarchie * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
2559109Sarchie * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
2659109Sarchie * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
2759109Sarchie * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
2859109Sarchie * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
2959109Sarchie * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
3059109Sarchie * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
3159109Sarchie * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
3259109Sarchie * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
3359109Sarchie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3459109Sarchie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3559109Sarchie * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
3659109Sarchie * OF SUCH DAMAGE.
3759109Sarchie *
3867506Sjulian * Author: Archie Cobbs <archie@freebsd.org>
3959109Sarchie *
4059109Sarchie * $Whistle: ng_mppc.h,v 1.3 2000/02/12 01:17:22 archie Exp $
4159109Sarchie * $FreeBSD$
4259109Sarchie */
4359109Sarchie
44122481Sru#ifndef _NETGRAPH_NG_MPPC_H_
45122481Sru#define _NETGRAPH_NG_MPPC_H_
4659109Sarchie
4759109Sarchie/* Node type name and magic cookie */
4859109Sarchie#define NG_MPPC_NODE_TYPE	"mppc"
4959109Sarchie#define NGM_MPPC_COOKIE		942886745
5059109Sarchie
5159109Sarchie/* Hook names */
5259109Sarchie#define NG_MPPC_HOOK_COMP	"comp"		/* compression hook */
5359109Sarchie#define NG_MPPC_HOOK_DECOMP	"decomp"	/* decompression hook */
5459109Sarchie
5559109Sarchie/* Length of MPPE key */
5659109Sarchie#define MPPE_KEY_LEN		16
5759109Sarchie
5859109Sarchie/* Max expansion due to MPPC header and compression algorithm */
5959109Sarchie#define MPPC_MAX_BLOWUP(n)	((n) * 9 / 8 + 26)
6059109Sarchie
6159109Sarchie/* MPPC/MPPE PPP negotiation bits */
6259109Sarchie#define MPPC_BIT		0x00000001	/* mppc compression bits */
6359109Sarchie#define MPPE_40			0x00000020	/* use 40 bit key */
6487971Sarchie#define MPPE_56			0x00000080	/* use 56 bit key */
6559109Sarchie#define MPPE_128		0x00000040	/* use 128 bit key */
6687971Sarchie#define MPPE_BITS		0x000000e0	/* mppe encryption bits */
6759109Sarchie#define MPPE_STATELESS		0x01000000	/* use stateless mode */
6887971Sarchie#define MPPC_VALID_BITS		0x010000e1	/* possibly valid bits */
6959109Sarchie
7059109Sarchie/* Config struct (per-direction) */
7159109Sarchiestruct ng_mppc_config {
7259109Sarchie	u_char		enable;			/* enable */
7359109Sarchie	u_int32_t	bits;			/* config bits */
7459109Sarchie	u_char		startkey[MPPE_KEY_LEN];	/* start key */
7559109Sarchie};
7659109Sarchie
7759109Sarchie/* Netgraph commands */
7859109Sarchieenum {
7959109Sarchie	NGM_MPPC_CONFIG_COMP = 1,
8059109Sarchie	NGM_MPPC_CONFIG_DECOMP,
8159109Sarchie	NGM_MPPC_RESETREQ,			/* sent either way! */
8259109Sarchie};
8359109Sarchie
84122481Sru#endif /* _NETGRAPH_NG_MPPC_H_ */
8559109Sarchie
86