X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/fcad08f6137fb6c53c429a8f55531a94d37908fa..acbfc6a40aacdecc80d5946165b8ceb359691441:/l2tpns.h diff --git a/l2tpns.h b/l2tpns.h index 8886076..a50dc55 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -1,5 +1,5 @@ // L2TPNS Global Stuff -// $Id: l2tpns.h,v 1.96 2005/10/18 07:19:29 bodea Exp $ +// $Id: l2tpns.h,v 1.103 2005/12/06 00:00:32 bodea Exp $ #ifndef __L2TPNS_H__ #define __L2TPNS_H__ @@ -15,7 +15,7 @@ #include #include -#define VERSION "2.1.10" +#define VERSION "2.1.13" // Limits #define MAXTUNNEL 500 // could be up to 65535 @@ -148,7 +148,14 @@ enum { // reset state machine counters #define initialise_restart_count(_s, _fsm) \ - sess_local[_s]._fsm.conf_sent = sess_local[_s]._fsm.nak_sent + sess_local[_s]._fsm.conf_sent = sess_local[_s]._fsm.nak_sent = 0 + +// increment ConfReq counter and reset timer +#define restart_timer(_s, _fsm) ({ \ + sess_local[_s]._fsm.conf_sent++; \ + sess_local[_s]._fsm.restart = \ + time_now + config->ppp_restart_time; \ +}) // stop timer on change to state where timer does not run #define change_state(_s, _fsm, _new) ({ \ @@ -221,20 +228,19 @@ typedef struct sessionidt next; // next session in linked list sessionidt far; // far end session ID tunnelidt tunnel; // near end tunnel ID - uint8_t l2tp_flags; // various bit flags from the ICCN on the l2tp tunnel. + uint8_t flags; // session flags: see SESSION_* struct { uint8_t phase; // PPP phase uint8_t lcp:4; // LCP state uint8_t ipcp:4; // IPCP state uint8_t ipv6cp:4; // IPV6CP state uint8_t ccp:4; // CCP state - uint8_t pad; // unused } ppp; + char reserved_1[2]; // unused: padding in_addr_t ip; // IP of session set by RADIUS response (host byte order). int ip_pool_index; // index to IP pool uint32_t unique_id; // unique session id - uint16_t nr; // next receive - uint16_t ns; // next send + char reserved_2[4]; // unused: was ns/nr uint32_t magic; // ppp magic number uint32_t pin, pout; // packet counts uint32_t cin, cout; // byte counts @@ -264,7 +270,7 @@ typedef struct uint8_t walled_garden; // is this session gardened? uint8_t ipv6prefixlen; // IPv6 route prefix length struct in6_addr ipv6route; // Static IPv6 route - char reserved[11]; // Space to expand structure without changing HB_VERSION + char reserved_3[11]; // Space to expand structure without changing HB_VERSION } sessiont; @@ -312,8 +318,10 @@ typedef struct time_t last_echo; } sessionlocalt; -#define SESSIONPFC 1 // PFC negotiated flags -#define SESSIONACFC 2 // ACFC negotiated flags +// session flags +#define SESSION_PFC (1 << 0) // use Protocol-Field-Compression +#define SESSION_ACFC (1 << 1) // use Address-and-Control-Field-Compression +#define SESSION_STARTED (1 << 2) // RADIUS Start record sent // 168 bytes per tunnel typedef struct @@ -606,7 +614,7 @@ typedef struct #endif } configt; -enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6, MAC }; +enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 }; typedef struct { char *key;