1.\" Copyright (c) 1996-1999 Whistle Communications, Inc. 2.\" All rights reserved. 3.\" 4.\" Subject to the following obligations and disclaimer of warranty, use and 5.\" redistribution of this software, in source or object code forms, with or 6.\" without modifications are expressly permitted by Whistle Communications; 7.\" provided, however, that: 8.\" 1. Any and all reproductions of the source or object code must include the 9.\" copyright notice above and the following disclaimer of warranties; and 10.\" 2. No rights are granted, in any manner or form, to use Whistle 11.\" Communications, Inc. trademarks, including the mark "WHISTLE 12.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as 13.\" such appears in the above copyright notice or in the software. 14.\" 15.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 16.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 17.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 18.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 20.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 21.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 22.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 23.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 24.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 25.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 26.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 27.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 31.\" OF SUCH DAMAGE. 32.\" 33.\" Author: Archie Cobbs <archie@FreeBSD.org> 34.\" $Whistle: ng_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $ 35.\" 36.Dd November 4, 2018 37.Dt NG_PPTPGRE 4 38.Os 39.Sh NAME 40.Nm ng_pptpgre 41.Nd PPTP GRE protocol netgraph node type 42.Sh SYNOPSIS 43.In sys/types.h 44.In netgraph/ng_pptpgre.h 45.Sh DESCRIPTION 46The 47.Nm pptpgre 48node type performs Generic Routing Encapsulation (GRE) over IP 49for the PPTP protocol as specified by RFC 2637. 50This involves packet 51encapsulation, sequencing, acknowledgement, and an adaptive timeout 52sliding window mechanism. 53This node type does not handle any of 54the TCP control protocol or call negotiation defined by PPTP. 55.Pp 56This node type expects to receive complete IP packets, 57including the IP header, on the 58.Dq Li lower 59hook, but it transmits outgoing frames without any IP header. 60The typical use for this node type would be to connect the 61.Dq Li upper 62hook to one of the link hooks of a 63.Xr ng_ppp 4 64node, and the 65.Dq Li lower 66hook to the 67.Dq Li "inet/raw/gre" 68hook of a 69.Xr ng_ksocket 4 70node. 71.Sh HOOKS 72This node type supports the following hooks: 73.Bl -tag -width ".Va session_hhhh" 74.It Va session_hhhh 75Session 0xhhhh data packets to the upper protocol layers 76.It Va upper 77Same as session_hhhh, but for single session with configurable cid (legacy) 78.It Va lower 79Connection to the lower protocol layers 80.El 81.Sh CONTROL MESSAGES 82This node type supports the generic control messages, plus the following: 83.Bl -tag -width foo 84.It Dv NGM_PPTPGRE_SET_CONFIG Pq Ic setconfig 85This command resets and configures hook for a session. 86If corresponding 87session_hhhh hook is not connected, upper hook will be configured. 88This command takes a 89.Vt "struct ng_pptpgre_conf" 90as an argument: 91.Bd -literal 92/* Configuration for a session */ 93struct ng_pptpgre_conf { 94 u_char enabled; /* enables traffic flow */ 95 u_char enableDelayedAck; /* enables delayed acks */ 96 u_char enableAlwaysAck; /* always include ack with data */ 97 u_char enableWindowing; /* enable windowing algorithm */ 98 uint16_t cid; /* my call id */ 99 uint16_t peerCid; /* peer call id */ 100 uint16_t recvWin; /* peer recv window size */ 101 uint16_t peerPpd; /* peer packet processing delay 102 (in 1/10 of a second) */ 103}; 104.Ed 105.Pp 106The 107.Va enabled 108field enables traffic flow through the node. 109The 110.Va enableDelayedAck 111field enables delayed acknowledgement (maximum 250 milliseconds), which 112is a useful optimization and should generally be turned on. 113.Va enableAlwaysAck 114field enables sending acknowledgements with every data packet, which 115is probably helpful as well. 116.Pp 117.Va enableWindowing 118enables the PPTP packet windowing mechanism specified by the protocol. 119Disabling this will cause the node to violate the protocol, possibly 120confusing other PPTP peers, but often results in better performance. 121The windowing mechanism is a design error in the PPTP protocol; 122L2TP, the successor to PPTP, removes it. 123.Pp 124The remaining fields are as supplied by the PPTP virtual call setup process. 125.It Dv NGM_PPTPGRE_GET_CONFIG Pq Ic getconfig 126Takes two byte argument as cid and returns the current configuration as a 127.Vt "struct ng_pptpgre_conf" . 128.It Dv NGM_PPTPGRE_GET_STATS Pq Ic getstats 129This command returns a 130.Vt "struct ng_pptpgre_stats" 131containing various node statistics. 132.It Dv NGM_PPTPGRE_CLR_STATS Pq Ic clrstats 133This command resets the node statistics. 134.It Dv NGM_PPTPGRE_GETCLR_STATS Pq Ic getclrstats 135This command atomically gets and resets the node statistics, returning a 136.Vt "struct ng_pptpgre_stats" . 137.El 138.Sh SHUTDOWN 139This node shuts down upon receipt of a 140.Dv NGM_SHUTDOWN 141control message, or when both hooks have been disconnected. 142.Sh SYSCTL VARIABLES 143A set of 144.Xr sysctl 8 145variables controls ability of this node to deal with some 146amount of packet reorder that sometimes happens in transit. 147Packet reorder results in packet drops (unless the order is restored) 148as PPP protocol can not deliver reordered data. 149These variables are shown below together 150with their default value and meaning: 151.Bl -tag -width indent 152.It Va net.graph.pptpgre.reorder_max: 1 153Defines maximum length of node's private reorder queue 154used to keep data waiting for late packets. 155Zero value disables reordering. 156Default value allows the node to restore the order for two packets swapped 157in transit. 158Greater values allow the node to deliver packets being late after more 159packets in sequence at cost of increased kernel memory usage. 160.It Va net.graph.pptpgre.reorder_timeout: 1 161Defines time value in milliseconds used to wait for late packets. 162.El 163.Sh SEE ALSO 164.Xr netgraph 4 , 165.Xr ng_ksocket 4 , 166.Xr ng_ppp 4 , 167.Xr ngctl 8 , 168.Xr sysctl 8 169.Rs 170.%A K. Hamzeh 171.%A G. Pall 172.%A W. Verthein 173.%A J. Taarud 174.%A W. Little 175.%A G. Zorn 176.%T "Point-to-Point Tunneling Protocol (PPTP)" 177.%O RFC 2637 178.Re 179.Rs 180.%A S. Hanks 181.%A T. \&Li 182.%A D. Farinacci 183.%A P. Traina 184.%T "Generic Routing Encapsulation over IPv4 networks" 185.%O RFC 1702 186.Re 187.Sh HISTORY 188The 189.Nm 190node type was implemented in 191.Fx 4.0 . 192.Sh AUTHORS 193.An Archie Cobbs Aq Mt archie@FreeBSD.org 194.Sh BUGS 195The node should not expect incoming GRE packets to have an IP header. 196This behavior is inherited from the (converse) behavior of raw IP sockets. 197An intermediate node that strips IP headers in one direction 198should be used instead. 199