X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/a478f1c2a22514a4de4521ffe3ed93d3c2c427b8..ea2c9385938dc5ee481c9e7e677c03dc869b88cf:/l2tpns.h diff --git a/l2tpns.h b/l2tpns.h index 4fe9a5c..5dd854f 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -25,7 +25,6 @@ #define MAXSESSION 60000 // could be up to 65535 #define MAXTBFS 6000 // Maximum token bucket filters. Might need up to 2 * session. #define MAXSESSINGRP 12 // Maximum number of member links in grouped session -#define MAXGRPINSESS 12 // Maximum number of member links in session group #define MAXGROUPE 300 // could be up to 65535, Maximum number of grouped session #define MAXROUTEINGRP 15 // max static routes per group @@ -73,6 +72,8 @@ // Multi bind address constants #define MAX_UDPFD 4 #define MAX_BINDADDR MAX_UDPFD +// + 1 for the LAC Hostname +#define MAX_NBHOSTNAME (MAX_UDPFD + 1) // 4 + 1 for the udplac #define INIT_TABUDPFD {-1, -1, -1, -1, -1} #define INIT_TABUDPVAR {0, 0, 0, 0, 0} @@ -336,25 +337,27 @@ typedef struct struct in6_addr ipv6route; // Static IPv6 route sessionidt forwardtosession; // LNS id_session to forward uint8_t src_hwaddr[ETH_ALEN]; // MAC addr source (for pppoe sessions 6 bytes) - uint32_t coutgrp_delta; + char reserved[4]; // Space to expand structure without changing HB_VERSION } sessiont; typedef struct { uint32_t tx_rate; + uint32_t prev_coutgrp; sessionidt sid; uint8_t weight; } -groupsessionidt; +groupsesslistt; typedef struct { + int state; // current state (groupestate enum) uint32_t time_changed; groupidt prev; sessionidt smax; sessionidt smin; - groupsessionidt sesslist[MAXSESSINGRP]; + groupsesslistt sesslist[MAXSESSINGRP]; routet route[MAXROUTEINGRP]; // static routes uint8_t nbroutesgrp; uint8_t nbsession; @@ -549,6 +552,13 @@ enum BUNDLEUNDEF, // Undefined }; +enum +{ + GROUPEFREE, // Not in use + GROUPEOPEN, // Active bundle + GROUPEUNDEF // Undefined +}; + enum { NULLCLASS = 0, //End Point Discriminator classes @@ -728,6 +738,7 @@ typedef struct int num_tbfs; // number of throttle buckets char accounting_dir[128]; + int account_all_origin; // Accouting all origin (LAC data + Remote LNS Data + PPPOE data) in_addr_t bind_address; in_addr_t peer_address; int send_garp; // Set to true to garp for vip address on startup @@ -756,8 +767,10 @@ typedef struct int cluster_undefined_sessions; // How many sessions we're yet to receive from the master. int cluster_undefined_bundles; // How many bundles we're yet to receive from the master. int cluster_undefined_tunnels; // How many tunnels we're yet to receive from the master. + int cluster_undefined_groupes; // How many groupes we're yet to receive from the master. int cluster_highest_sessionid; int cluster_highest_bundleid; + int cluster_highest_groupeid; int cluster_highest_tunnelid; clockt cluster_last_hb; // Last time we saw a heartbeat from the master. int cluster_last_hb_ver; // Heartbeat version last seen from master @@ -805,15 +818,19 @@ typedef struct char pppoe_service_name[64]; // pppoe service name char pppoe_ac_name[64]; uint8_t pppoe_hwaddr[ETH_ALEN]; // MAC addr of interface pppoe to bind + int pppoe_only_equal_svc_name; // Accept only PADI with service-name equal to server int disable_sending_hello; // Disable l2tp sending HELLO message for Apple compatibility. int disable_no_spoof; // Disable no spoof (permit load balancing client --> internet) int nbudpfd; // number UDP file handle int nbmultiaddress; // number multi address to bind int indexlacudpfd; // Index UDP LAC file handle (in udpfd[]) + int nbmultihostname; // number hostname, normally the same number as the nbudpfd + int grp_txrate_average_time; // caculation txrate average time (default 10s) in_addr_t bind_n_address[MAX_BINDADDR]; in_addr_t iftun_n_address[MAX_BINDADDR]; char bind_multi_address[256]; - int grp_txrate_average_time; // caculation txrate average time (default 10s) + char multi_hostname[512]; + char multi_n_hostname[MAX_NBHOSTNAME][MAXHOSTNAME]; // list hostname } configt; enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 }; @@ -988,7 +1005,7 @@ void lac_send_ICRQ(tunnelidt t, sessionidt s); void lac_tunnelshutdown(tunnelidt t, char *reason, int result, int error, char *msg); // grpsess.c -sessionidt grp_getnextsession(groupidt g, in_addr_t ip); +sessionidt grp_getnextsession(groupidt g, in_addr_t ip, in_addr_t ip_src); void grp_initdata(void); void grp_processvendorspecific(sessionidt s, uint8_t *pvs); groupidt grp_groupbysession(sessionidt s); @@ -996,6 +1013,7 @@ groupidt grp_groupbyip(in_addr_t ip); void grp_setgrouproute(groupidt g, int add); void grp_time_changed(void); void grp_removesession(groupidt g, sessionidt s); +int grp_cluster_load_groupe(groupidt g, groupsesst *new); #undef LOG #undef LOG_HEX @@ -1032,7 +1050,7 @@ extern sessiont *session; extern sessionlocalt *sess_local; extern ippoolt *ip_address_pool; extern groupsesst *grpsession; -groupidt gnextgrpid; +extern groupidt gnextgrpid; #define sessionfree (session[0].next)