1add85a1dSArchie Cobbs 2add85a1dSArchie Cobbs /* 3add85a1dSArchie Cobbs * ng_pptpgre.h 4add85a1dSArchie Cobbs * 5add85a1dSArchie Cobbs * Copyright (c) 1999 Whistle Communications, Inc. 6add85a1dSArchie Cobbs * All rights reserved. 7add85a1dSArchie Cobbs * 8add85a1dSArchie Cobbs * Subject to the following obligations and disclaimer of warranty, use and 9add85a1dSArchie Cobbs * redistribution of this software, in source or object code forms, with or 10add85a1dSArchie Cobbs * without modifications are expressly permitted by Whistle Communications; 11add85a1dSArchie Cobbs * provided, however, that: 12add85a1dSArchie Cobbs * 1. Any and all reproductions of the source or object code must include the 13add85a1dSArchie Cobbs * copyright notice above and the following disclaimer of warranties; and 14add85a1dSArchie Cobbs * 2. No rights are granted, in any manner or form, to use Whistle 15add85a1dSArchie Cobbs * Communications, Inc. trademarks, including the mark "WHISTLE 16add85a1dSArchie Cobbs * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 17add85a1dSArchie Cobbs * such appears in the above copyright notice or in the software. 18add85a1dSArchie Cobbs * 19add85a1dSArchie Cobbs * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 20add85a1dSArchie Cobbs * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 21add85a1dSArchie Cobbs * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 22add85a1dSArchie Cobbs * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 23add85a1dSArchie Cobbs * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 24add85a1dSArchie Cobbs * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 25add85a1dSArchie Cobbs * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 26add85a1dSArchie Cobbs * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 27add85a1dSArchie Cobbs * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 28add85a1dSArchie Cobbs * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 29add85a1dSArchie Cobbs * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 30add85a1dSArchie Cobbs * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 31add85a1dSArchie Cobbs * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32add85a1dSArchie Cobbs * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33add85a1dSArchie Cobbs * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34add85a1dSArchie Cobbs * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35add85a1dSArchie Cobbs * OF SUCH DAMAGE. 36add85a1dSArchie Cobbs * 37cc3bbd68SJulian Elischer * Author: Archie Cobbs <archie@freebsd.org> 38add85a1dSArchie Cobbs * 39add85a1dSArchie Cobbs * $FreeBSD$ 40add85a1dSArchie Cobbs * $Whistle: ng_pptpgre.h,v 1.3 1999/12/08 00:11:36 archie Exp $ 41add85a1dSArchie Cobbs */ 42add85a1dSArchie Cobbs 43e20480bfSRuslan Ermilov #ifndef _NETGRAPH_NG_PPTPGRE_H_ 44e20480bfSRuslan Ermilov #define _NETGRAPH_NG_PPTPGRE_H_ 45add85a1dSArchie Cobbs 46add85a1dSArchie Cobbs /* Node type name and magic cookie */ 47add85a1dSArchie Cobbs #define NG_PPTPGRE_NODE_TYPE "pptpgre" 48678f9e33SArchie Cobbs #define NGM_PPTPGRE_COOKIE 942783547 49add85a1dSArchie Cobbs 50add85a1dSArchie Cobbs /* Hook names */ 51add85a1dSArchie Cobbs #define NG_PPTPGRE_HOOK_UPPER "upper" /* to upper layers */ 52add85a1dSArchie Cobbs #define NG_PPTPGRE_HOOK_LOWER "lower" /* to lower layers */ 53add85a1dSArchie Cobbs 54add85a1dSArchie Cobbs /* Configuration for a session */ 55add85a1dSArchie Cobbs struct ng_pptpgre_conf { 56add85a1dSArchie Cobbs u_char enabled; /* enables traffic flow */ 57add85a1dSArchie Cobbs u_char enableDelayedAck;/* enables delayed acks */ 58678f9e33SArchie Cobbs u_char enableAlwaysAck;/* always include ack with data */ 59add85a1dSArchie Cobbs u_int16_t cid; /* my call id */ 60add85a1dSArchie Cobbs u_int16_t peerCid; /* peer call id */ 61add85a1dSArchie Cobbs u_int16_t recvWin; /* peer recv window size */ 62add85a1dSArchie Cobbs u_int16_t peerPpd; /* peer packet processing delay 63add85a1dSArchie Cobbs (in units of 1/10 of a second) */ 64add85a1dSArchie Cobbs }; 65add85a1dSArchie Cobbs 66add85a1dSArchie Cobbs /* Keep this in sync with the above structure definition */ 67add85a1dSArchie Cobbs #define NG_PPTPGRE_CONF_TYPE_INFO { \ 6857b57be3SArchie Cobbs { "enabled", &ng_parse_uint8_type }, \ 6957b57be3SArchie Cobbs { "enableDelayedAck", &ng_parse_uint8_type }, \ 7057b57be3SArchie Cobbs { "enableAlwaysAck", &ng_parse_uint8_type }, \ 7157b57be3SArchie Cobbs { "cid", &ng_parse_hint16_type }, \ 7257b57be3SArchie Cobbs { "peerCid", &ng_parse_hint16_type }, \ 7357b57be3SArchie Cobbs { "recvWin", &ng_parse_uint16_type }, \ 7457b57be3SArchie Cobbs { "peerPpd", &ng_parse_uint16_type }, \ 75f0184ff8SArchie Cobbs { NULL } \ 76add85a1dSArchie Cobbs } 77add85a1dSArchie Cobbs 789bee7adfSArchie Cobbs /* Statistics struct */ 799bee7adfSArchie Cobbs struct ng_pptpgre_stats { 809bee7adfSArchie Cobbs u_int32_t xmitPackets; /* number of GRE packets xmit */ 819bee7adfSArchie Cobbs u_int32_t xmitOctets; /* number of GRE octets xmit */ 829bee7adfSArchie Cobbs u_int32_t xmitLoneAcks; /* ack-only packets transmitted */ 839bee7adfSArchie Cobbs u_int32_t xmitDrops; /* xmits dropped due to full window */ 849bee7adfSArchie Cobbs u_int32_t xmitTooBig; /* xmits dropped because too big */ 859bee7adfSArchie Cobbs u_int32_t recvPackets; /* number of GRE packets rec'd */ 869bee7adfSArchie Cobbs u_int32_t recvOctets; /* number of GRE octets rec'd */ 879bee7adfSArchie Cobbs u_int32_t recvRunts; /* too short packets rec'd */ 889bee7adfSArchie Cobbs u_int32_t recvBadGRE; /* bogus packets rec'd (bad GRE hdr) */ 899bee7adfSArchie Cobbs u_int32_t recvBadAcks; /* bogus ack's rec'd in GRE header */ 909bee7adfSArchie Cobbs u_int32_t recvBadCID; /* pkts with unknown call ID rec'd */ 919bee7adfSArchie Cobbs u_int32_t recvOutOfOrder; /* packets rec'd out of order */ 929bee7adfSArchie Cobbs u_int32_t recvDuplicates; /* packets rec'd with duplicate seq # */ 939bee7adfSArchie Cobbs u_int32_t recvLoneAcks; /* ack-only packets rec'd */ 949bee7adfSArchie Cobbs u_int32_t recvAckTimeouts; /* times peer failed to ack in time */ 95678f9e33SArchie Cobbs u_int32_t memoryFailures; /* times we couldn't allocate memory */ 969bee7adfSArchie Cobbs }; 979bee7adfSArchie Cobbs 989bee7adfSArchie Cobbs /* Keep this in sync with the above structure definition */ 999bee7adfSArchie Cobbs #define NG_PPTPGRE_STATS_TYPE_INFO { \ 10057b57be3SArchie Cobbs { "xmitPackets", &ng_parse_uint32_type }, \ 10157b57be3SArchie Cobbs { "xmitOctets", &ng_parse_uint32_type }, \ 10257b57be3SArchie Cobbs { "xmitLoneAcks", &ng_parse_uint32_type }, \ 10357b57be3SArchie Cobbs { "xmitDrops", &ng_parse_uint32_type }, \ 10457b57be3SArchie Cobbs { "xmitTooBig", &ng_parse_uint32_type }, \ 10557b57be3SArchie Cobbs { "recvPackets", &ng_parse_uint32_type }, \ 10657b57be3SArchie Cobbs { "recvOctets", &ng_parse_uint32_type }, \ 10757b57be3SArchie Cobbs { "recvRunts", &ng_parse_uint32_type }, \ 10857b57be3SArchie Cobbs { "recvBadGRE", &ng_parse_uint32_type }, \ 10957b57be3SArchie Cobbs { "recvBadAcks", &ng_parse_uint32_type }, \ 11057b57be3SArchie Cobbs { "recvBadCID", &ng_parse_uint32_type }, \ 11157b57be3SArchie Cobbs { "recvOutOfOrder", &ng_parse_uint32_type }, \ 11257b57be3SArchie Cobbs { "recvDuplicates", &ng_parse_uint32_type }, \ 11357b57be3SArchie Cobbs { "recvLoneAcks", &ng_parse_uint32_type }, \ 11457b57be3SArchie Cobbs { "recvAckTimeouts", &ng_parse_uint32_type }, \ 11557b57be3SArchie Cobbs { "memoryFailures", &ng_parse_uint32_type }, \ 1169bee7adfSArchie Cobbs { NULL } \ 1179bee7adfSArchie Cobbs } 1189bee7adfSArchie Cobbs 119add85a1dSArchie Cobbs /* Netgraph commands */ 120add85a1dSArchie Cobbs enum { 121add85a1dSArchie Cobbs NGM_PPTPGRE_SET_CONFIG = 1, /* supply a struct ng_pptpgre_conf */ 122add85a1dSArchie Cobbs NGM_PPTPGRE_GET_CONFIG, /* returns a struct ng_pptpgre_conf */ 1239bee7adfSArchie Cobbs NGM_PPTPGRE_GET_STATS, /* returns struct ng_pptpgre_stats */ 1249bee7adfSArchie Cobbs NGM_PPTPGRE_CLR_STATS, /* clears stats */ 1259bee7adfSArchie Cobbs NGM_PPTPGRE_GETCLR_STATS, /* returns & clears stats */ 126add85a1dSArchie Cobbs }; 127add85a1dSArchie Cobbs 128e20480bfSRuslan Ermilov #endif /* _NETGRAPH_NG_PPTPGRE_H_ */ 129