1add85a1dSArchie Cobbs /* 2add85a1dSArchie Cobbs * ng_pptpgre.h 3c398230bSWarner Losh */ 4c398230bSWarner Losh 5c398230bSWarner Losh /*- 6add85a1dSArchie Cobbs * Copyright (c) 1999 Whistle Communications, Inc. 7add85a1dSArchie Cobbs * All rights reserved. 8add85a1dSArchie Cobbs * 9add85a1dSArchie Cobbs * Subject to the following obligations and disclaimer of warranty, use and 10add85a1dSArchie Cobbs * redistribution of this software, in source or object code forms, with or 11add85a1dSArchie Cobbs * without modifications are expressly permitted by Whistle Communications; 12add85a1dSArchie Cobbs * provided, however, that: 13add85a1dSArchie Cobbs * 1. Any and all reproductions of the source or object code must include the 14add85a1dSArchie Cobbs * copyright notice above and the following disclaimer of warranties; and 15add85a1dSArchie Cobbs * 2. No rights are granted, in any manner or form, to use Whistle 16add85a1dSArchie Cobbs * Communications, Inc. trademarks, including the mark "WHISTLE 17add85a1dSArchie Cobbs * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 18add85a1dSArchie Cobbs * such appears in the above copyright notice or in the software. 19add85a1dSArchie Cobbs * 20add85a1dSArchie Cobbs * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 21add85a1dSArchie Cobbs * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 22add85a1dSArchie Cobbs * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 23add85a1dSArchie Cobbs * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 24add85a1dSArchie Cobbs * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 25add85a1dSArchie Cobbs * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 26add85a1dSArchie Cobbs * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 27add85a1dSArchie Cobbs * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 28add85a1dSArchie Cobbs * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 29add85a1dSArchie Cobbs * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 30add85a1dSArchie Cobbs * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 31add85a1dSArchie Cobbs * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 32add85a1dSArchie Cobbs * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 33add85a1dSArchie Cobbs * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34add85a1dSArchie Cobbs * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35add85a1dSArchie Cobbs * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36add85a1dSArchie Cobbs * OF SUCH DAMAGE. 37add85a1dSArchie Cobbs * 38cc3bbd68SJulian Elischer * Author: Archie Cobbs <archie@freebsd.org> 39add85a1dSArchie Cobbs * $Whistle: ng_pptpgre.h,v 1.3 1999/12/08 00:11:36 archie Exp $ 40add85a1dSArchie Cobbs */ 41add85a1dSArchie Cobbs 42e20480bfSRuslan Ermilov #ifndef _NETGRAPH_NG_PPTPGRE_H_ 43e20480bfSRuslan Ermilov #define _NETGRAPH_NG_PPTPGRE_H_ 44add85a1dSArchie Cobbs 45add85a1dSArchie Cobbs /* Node type name and magic cookie */ 46add85a1dSArchie Cobbs #define NG_PPTPGRE_NODE_TYPE "pptpgre" 47922ee196SArchie Cobbs #define NGM_PPTPGRE_COOKIE 1082548365 48add85a1dSArchie Cobbs 49add85a1dSArchie Cobbs /* Hook names */ 50add85a1dSArchie Cobbs #define NG_PPTPGRE_HOOK_UPPER "upper" /* to upper layers */ 51add85a1dSArchie Cobbs #define NG_PPTPGRE_HOOK_LOWER "lower" /* to lower layers */ 52add85a1dSArchie Cobbs 53489290e9SAlexander Motin /* Session hooks: prefix plus hex session ID, e.g., "session_3e14" */ 54489290e9SAlexander Motin #define NG_PPTPGRE_HOOK_SESSION_P "session_" 55489290e9SAlexander Motin #define NG_PPTPGRE_HOOK_SESSION_F "session_%04x" 56489290e9SAlexander Motin 57add85a1dSArchie Cobbs /* Configuration for a session */ 58add85a1dSArchie Cobbs struct ng_pptpgre_conf { 59add85a1dSArchie Cobbs u_char enabled; /* enables traffic flow */ 60add85a1dSArchie Cobbs u_char enableDelayedAck;/* enables delayed acks */ 61678f9e33SArchie Cobbs u_char enableAlwaysAck;/* always include ack with data */ 62922ee196SArchie Cobbs u_char enableWindowing;/* enable windowing algorithm */ 63add85a1dSArchie Cobbs u_int16_t cid; /* my call id */ 64add85a1dSArchie Cobbs u_int16_t peerCid; /* peer call id */ 65add85a1dSArchie Cobbs u_int16_t recvWin; /* peer recv window size */ 66add85a1dSArchie Cobbs u_int16_t peerPpd; /* peer packet processing delay 67add85a1dSArchie Cobbs (in units of 1/10 of a second) */ 68add85a1dSArchie Cobbs }; 69add85a1dSArchie Cobbs 70add85a1dSArchie Cobbs /* Keep this in sync with the above structure definition */ 71add85a1dSArchie Cobbs #define NG_PPTPGRE_CONF_TYPE_INFO { \ 7257b57be3SArchie Cobbs { "enabled", &ng_parse_uint8_type }, \ 7357b57be3SArchie Cobbs { "enableDelayedAck", &ng_parse_uint8_type }, \ 7457b57be3SArchie Cobbs { "enableAlwaysAck", &ng_parse_uint8_type }, \ 75922ee196SArchie Cobbs { "enableWindowing", &ng_parse_uint8_type }, \ 7657b57be3SArchie Cobbs { "cid", &ng_parse_hint16_type }, \ 7757b57be3SArchie Cobbs { "peerCid", &ng_parse_hint16_type }, \ 7857b57be3SArchie Cobbs { "recvWin", &ng_parse_uint16_type }, \ 7957b57be3SArchie Cobbs { "peerPpd", &ng_parse_uint16_type }, \ 80f0184ff8SArchie Cobbs { NULL } \ 81add85a1dSArchie Cobbs } 82add85a1dSArchie Cobbs 839bee7adfSArchie Cobbs /* Statistics struct */ 849bee7adfSArchie Cobbs struct ng_pptpgre_stats { 859bee7adfSArchie Cobbs u_int32_t xmitPackets; /* number of GRE packets xmit */ 869bee7adfSArchie Cobbs u_int32_t xmitOctets; /* number of GRE octets xmit */ 879bee7adfSArchie Cobbs u_int32_t xmitLoneAcks; /* ack-only packets transmitted */ 889bee7adfSArchie Cobbs u_int32_t xmitDrops; /* xmits dropped due to full window */ 899bee7adfSArchie Cobbs u_int32_t xmitTooBig; /* xmits dropped because too big */ 909bee7adfSArchie Cobbs u_int32_t recvPackets; /* number of GRE packets rec'd */ 919bee7adfSArchie Cobbs u_int32_t recvOctets; /* number of GRE octets rec'd */ 929bee7adfSArchie Cobbs u_int32_t recvRunts; /* too short packets rec'd */ 939bee7adfSArchie Cobbs u_int32_t recvBadGRE; /* bogus packets rec'd (bad GRE hdr) */ 949bee7adfSArchie Cobbs u_int32_t recvBadAcks; /* bogus ack's rec'd in GRE header */ 959bee7adfSArchie Cobbs u_int32_t recvBadCID; /* pkts with unknown call ID rec'd */ 969bee7adfSArchie Cobbs u_int32_t recvOutOfOrder; /* packets rec'd out of order */ 979bee7adfSArchie Cobbs u_int32_t recvDuplicates; /* packets rec'd with duplicate seq # */ 989bee7adfSArchie Cobbs u_int32_t recvLoneAcks; /* ack-only packets rec'd */ 999bee7adfSArchie Cobbs u_int32_t recvAckTimeouts; /* times peer failed to ack in time */ 100678f9e33SArchie Cobbs u_int32_t memoryFailures; /* times we couldn't allocate memory */ 101*a594f945SEugene Grosbein u_int32_t recvReorderOverflow; /* times we dropped GRE packet 102*a594f945SEugene Grosbein due to overflow of reorder queue */ 103*a594f945SEugene Grosbein u_int32_t recvReorderTimeouts; /* times we flushed reorder queue 104*a594f945SEugene Grosbein due to timeout */ 1059bee7adfSArchie Cobbs }; 1069bee7adfSArchie Cobbs 1079bee7adfSArchie Cobbs /* Keep this in sync with the above structure definition */ 1089bee7adfSArchie Cobbs #define NG_PPTPGRE_STATS_TYPE_INFO { \ 10957b57be3SArchie Cobbs { "xmitPackets", &ng_parse_uint32_type }, \ 11057b57be3SArchie Cobbs { "xmitOctets", &ng_parse_uint32_type }, \ 11157b57be3SArchie Cobbs { "xmitLoneAcks", &ng_parse_uint32_type }, \ 11257b57be3SArchie Cobbs { "xmitDrops", &ng_parse_uint32_type }, \ 11357b57be3SArchie Cobbs { "xmitTooBig", &ng_parse_uint32_type }, \ 11457b57be3SArchie Cobbs { "recvPackets", &ng_parse_uint32_type }, \ 11557b57be3SArchie Cobbs { "recvOctets", &ng_parse_uint32_type }, \ 11657b57be3SArchie Cobbs { "recvRunts", &ng_parse_uint32_type }, \ 11757b57be3SArchie Cobbs { "recvBadGRE", &ng_parse_uint32_type }, \ 11857b57be3SArchie Cobbs { "recvBadAcks", &ng_parse_uint32_type }, \ 11957b57be3SArchie Cobbs { "recvBadCID", &ng_parse_uint32_type }, \ 12057b57be3SArchie Cobbs { "recvOutOfOrder", &ng_parse_uint32_type }, \ 12157b57be3SArchie Cobbs { "recvDuplicates", &ng_parse_uint32_type }, \ 12257b57be3SArchie Cobbs { "recvLoneAcks", &ng_parse_uint32_type }, \ 12357b57be3SArchie Cobbs { "recvAckTimeouts", &ng_parse_uint32_type }, \ 12457b57be3SArchie Cobbs { "memoryFailures", &ng_parse_uint32_type }, \ 125*a594f945SEugene Grosbein { "recvReorderOverflow", &ng_parse_uint32_type}, \ 126*a594f945SEugene Grosbein { "recvReorderTimeouts", &ng_parse_uint32_type}, \ 1279bee7adfSArchie Cobbs { NULL } \ 1289bee7adfSArchie Cobbs } 1299bee7adfSArchie Cobbs 130add85a1dSArchie Cobbs /* Netgraph commands */ 131add85a1dSArchie Cobbs enum { 132add85a1dSArchie Cobbs NGM_PPTPGRE_SET_CONFIG = 1, /* supply a struct ng_pptpgre_conf */ 133add85a1dSArchie Cobbs NGM_PPTPGRE_GET_CONFIG, /* returns a struct ng_pptpgre_conf */ 1349bee7adfSArchie Cobbs NGM_PPTPGRE_GET_STATS, /* returns struct ng_pptpgre_stats */ 1359bee7adfSArchie Cobbs NGM_PPTPGRE_CLR_STATS, /* clears stats */ 1369bee7adfSArchie Cobbs NGM_PPTPGRE_GETCLR_STATS, /* returns & clears stats */ 137add85a1dSArchie Cobbs }; 138add85a1dSArchie Cobbs 139e20480bfSRuslan Ermilov #endif /* _NETGRAPH_NG_PPTPGRE_H_ */ 140