1 /* pptp_gre.h -- encapsulate PPP in PPTP-GRE. 2 * Handle the IP Protocol 47 portion of PPTP. 3 * C. Scott Ananian <cananian@alumni.princeton.edu> 4 * 5 * $Id: pptp_gre.h,v 1.6 2008/02/19 05:05:03 quozl Exp $ 6 */ 7 8 #include "pptp_compat.h" 9 10 int pptp_gre_bind(struct in_addr inetaddr); 11 void pptp_gre_copy(u_int16_t call_id, u_int16_t peer_call_id, 12 int pty_fd, int gre_fd); 13 14 extern int syncppp; 15 extern int disable_buffer; 16 17 typedef struct pack_track { 18 uint32_t seq; // seq no of this tracked packet 19 uint64_t time; // time when this tracked packet was sent (in usecs) 20 } pack_track_t; 21 22 typedef struct gre_stats { 23 /* statistics for GRE receive */ 24 25 uint32_t rx_accepted; // data packet was passed to pppd 26 uint32_t rx_lost; // data packet did not arrive before timeout 27 uint32_t rx_underwin; // data packet was under window (arrived too late 28 // or duplicate packet) 29 uint32_t rx_overwin; // data packet was over window 30 // (too many packets lost?) 31 uint32_t rx_buffered; // data packet arrived earlier than expected, 32 // packet(s) before it were lost or reordered 33 uint32_t rx_errors; // OS error on receive 34 uint32_t rx_truncated; // truncated packet 35 uint32_t rx_invalid; // wrong protocol or invalid flags 36 uint32_t rx_acks; // acknowledgement only 37 38 /* statistics for GRE transmit */ 39 40 uint32_t tx_sent; // data packet write() to GRE socket succeeded 41 uint32_t tx_failed; // data packet write() to GRE socket returned error 42 uint32_t tx_short; // data packet write() to GRE socket underflowed 43 uint32_t tx_acks; // sent packet with just ACK 44 uint32_t tx_oversize; // data packet dropped because it was too large 45 46 /* statistics for packet tracking, for RTT calculation */ 47 48 pack_track_t pt; // last data packet seq/time 49 int rtt; // estimated round-trip time in us 50 51 } gre_stats_t; 52 53 extern gre_stats_t stats; 54