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