ng_ppp.h revision 52639
152419Sjulian
252419Sjulian/*
352419Sjulian * ng_ppp.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 *
3752419Sjulian * Author: Archie Cobbs <archie@whistle.com>
3852419Sjulian *
3952419Sjulian * $FreeBSD: head/sys/netgraph/ng_ppp.h 52639 1999-10-29 22:30:03Z archie $
4052419Sjulian * $Whistle: ng_ppp.h,v 1.8 1999/01/25 02:40:02 archie Exp $
4152419Sjulian */
4252419Sjulian
4352419Sjulian#ifndef _NETGRAPH_PPP_H_
4452419Sjulian#define _NETGRAPH_PPP_H_
4552419Sjulian
4652419Sjulian/* Node type name and magic cookie */
4752419Sjulian#define NG_PPP_NODE_TYPE	"ppp"
4852639Sarchie#define NGM_PPP_COOKIE		940897792
4952419Sjulian
5052639Sarchie/* Maximum number of supported links */
5152639Sarchie#define NG_PPP_MAX_LINKS	16
5252639Sarchie
5352639Sarchie/* Pseudo-link number representing the multi-link bundle */
5452639Sarchie#define NG_PPP_BUNDLE_LINKNUM	0xffff
5552639Sarchie
5652639Sarchie/* Max allowable link latency (miliseconds) and bandwidth (bytes/second/10) */
5752639Sarchie#define NG_PPP_MAX_LATENCY	1000		/* 1 second */
5852639Sarchie#define NG_PPP_MAX_BANDWIDTH	125000		/* 10 Mbits / second */
5952639Sarchie
6052419Sjulian/* Hook names */
6152639Sarchie#define NG_PPP_HOOK_BYPASS	"bypass"	/* unknown protocols */
6252639Sarchie#define NG_PPP_HOOK_COMPRESS	"compress"	/* outgoing compression */
6352639Sarchie#define NG_PPP_HOOK_DECOMPRESS	"decompress"	/* incoming decompression */
6452639Sarchie#define NG_PPP_HOOK_ENCRYPT	"encrypt"	/* outgoing encryption */
6552639Sarchie#define NG_PPP_HOOK_DECRYPT	"decrypt"	/* incoming decryption */
6652639Sarchie#define NG_PPP_HOOK_VJC_IP	"vjc_ip"	/* VJC raw IP */
6752639Sarchie#define NG_PPP_HOOK_VJC_COMP	"vjc_vjcomp"	/* VJC compressed TCP */
6852639Sarchie#define NG_PPP_HOOK_VJC_UNCOMP	"vjc_vjuncomp"	/* VJC uncompressed TCP */
6952639Sarchie#define NG_PPP_HOOK_VJC_VJIP	"vjc_vjip"	/* VJC uncompressed IP */
7052639Sarchie#define NG_PPP_HOOK_INET	"inet"		/* IP packet data */
7152639Sarchie#define NG_PPP_HOOK_ATALK	"atalk"		/* AppleTalk packet data */
7252639Sarchie#define NG_PPP_HOOK_IPX		"ipx"		/* IPX packet data */
7352419Sjulian
7452639Sarchie#define NG_PPP_HOOK_LINK_PREFIX	"link"		/* append decimal link number */
7552639Sarchie
7652419Sjulian/* Netgraph commands */
7752419Sjulianenum {
7852639Sarchie	NGM_PPP_SET_CONFIG = 1,		/* takes struct ng_ppp_bundle_config */
7952639Sarchie	NGM_PPP_GET_CONFIG,		/* returns ng_ppp_bundle_config */
8052639Sarchie	NGM_PPP_GET_LINK_STATS,		/* takes link #, returns stats struct */
8152639Sarchie	NGM_PPP_CLR_LINK_STATS,		/* takes link #, clears link stats */
8252419Sjulian};
8352419Sjulian
8452639Sarchie/* Per-link config structure */
8552639Sarchiestruct ng_ppp_link_config {
8652639Sarchie	u_char		enableLink;	/* enable this link */
8752639Sarchie	u_char		enableProtoComp;/* enable protocol field compression */
8852639Sarchie	u_int16_t	mru;		/* peer MRU */
8952639Sarchie	u_int32_t	latency;	/* link latency (in milliseconds) */
9052639Sarchie	u_int32_t	bandwidth;	/* link bandwidth (in bytes/second) */
9152419Sjulian};
9252419Sjulian
9352639Sarchie/* Node config structure */
9452639Sarchiestruct ng_ppp_node_config {
9552639Sarchie	u_int16_t	mrru;			/* multilink peer MRRU */
9652639Sarchie	u_char		enableMultilink;	/* enable multilink */
9752639Sarchie	u_char		recvShortSeq;		/* recv multilink short seq # */
9852639Sarchie	u_char		xmitShortSeq;		/* xmit multilink short seq # */
9952639Sarchie	u_char		enableRoundRobin;	/* xmit whole packets */
10052639Sarchie	u_char		enableIP;		/* enable IP data flow */
10152639Sarchie	u_char		enableAtalk;		/* enable AppleTalk data flow */
10252639Sarchie	u_char		enableIPX;		/* enable IPX data flow */
10352639Sarchie	u_char		enableCompression;	/* enable PPP compression */
10452639Sarchie	u_char		enableDecompression;	/* enable PPP decompression */
10552639Sarchie	u_char		enableEncryption;	/* enable PPP encryption */
10652639Sarchie	u_char		enableDecryption;	/* enable PPP decryption */
10752639Sarchie	u_char		enableVJCompression;	/* enable VJ compression */
10852639Sarchie	u_char		enableVJDecompression;	/* enable VJ decompression */
10952639Sarchie	struct ng_ppp_link_config		/* per link config params */
11052639Sarchie			links[NG_PPP_MAX_LINKS];
11152639Sarchie};
11252419Sjulian
11352639Sarchie/* Statistics struct for a link (or the bundle if NG_PPP_BUNDLE_LINKNUM) */
11452639Sarchiestruct ng_ppp_link_stat {
11552639Sarchie	u_int32_t xmitFrames;		/* xmit frames on link */
11652639Sarchie	u_int32_t xmitOctets;		/* xmit octets on link */
11752639Sarchie	u_int32_t recvFrames;		/* recv frames on link */
11852639Sarchie	u_int32_t recvOctets;		/* recv octets on link */
11952639Sarchie	u_int32_t badProtos;		/* frames rec'd with bogus protocol */
12052639Sarchie	u_int32_t dupFragments;		/* MP frames with duplicate seq # */
12152639Sarchie};
12252639Sarchie
12352419Sjulian#endif /* _NETGRAPH_PPP_H_ */
124