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