X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/4d7d7850b5d242bf9b77ac07e7c06ef523c627e6..675715764fcf31c1e5f1d0e851e5b30498724022:/l2tpns.h diff --git a/l2tpns.h b/l2tpns.h index 1229096..084fa4e 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -1,5 +1,5 @@ // L2TPNS Global Stuff -// $Id: l2tpns.h,v 1.48 2004/12/16 23:40:31 bodea Exp $ +// $Id: l2tpns.h,v 1.49.2.3 2005/01/13 07:58:54 bodea Exp $ #ifndef __L2TPNS_H__ #define __L2TPNS_H__ @@ -15,7 +15,7 @@ #include #include -#define VERSION "2.0.13" +#define VERSION "2.0.15" // Limits #define MAXTUNNEL 500 // could be up to 65535 @@ -211,9 +211,15 @@ sessiont; typedef struct { + // byte counters uint32_t cin; uint32_t cout; -} sessioncountt; + + // DoS prevention + clockt last_packet_out; + uint32_t packets_out; + uint32_t packets_dropped; +} sessionlocalt; #define SESSIONPFC 1 // PFC negotiated flags #define SESSIONACFC 2 // ACFC negotiated flags @@ -316,6 +322,7 @@ struct Tstats uint32_t tun_tx_bytes; uint32_t tun_rx_errors; uint32_t tun_tx_errors; + uint32_t tun_rx_dropped; uint32_t tunnel_rx_packets; uint32_t tunnel_tx_packets; @@ -346,9 +353,9 @@ struct Tstats uint32_t c_forwarded; uint32_t recv_forward; - uint32_t select_called; // number of times select called - uint32_t select_ready; // number of fds returned by select - uint32_t select_processed; // number of read/writes handled per select + uint32_t select_called; + uint32_t multi_read_used; + uint32_t multi_read_exceeded; #ifdef STATISTICS uint32_t call_processtun; @@ -446,7 +453,8 @@ typedef struct int next_tbf; // Next HTB id available to use int scheduler_fifo; // If the system has multiple CPUs, use FIFO scheduling policy for this process. int lock_pages; // Lock pages into memory. - int icmp_rate; // Max number of ICMP unreachable per second to send> + int icmp_rate; // Max number of ICMP unreachable per second to send + int max_packets; // DoS prevention: per session limit of packets/0.1s in_addr_t cluster_address; // Multicast address of cluster. // Send to this address to have everyone hear. @@ -611,7 +619,7 @@ void host_unreachable(in_addr_t destination, uint16_t id, in_addr_t source, char extern tunnelt *tunnel; extern sessiont *session; -extern sessioncountt *sess_count; +extern sessionlocalt *sess_local; extern ippoolt *ip_address_pool; #define sessionfree (session[0].next)