From: bodea Date: Mon, 18 Apr 2005 05:07:20 +0000 (+0000) Subject: remove dead session fields X-Git-Tag: release_2_1_0~59 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/5f9801f30e6ee4192a8a60e9919eb2de544e6060 remove dead session fields --- diff --git a/cli.c b/cli.c index 62e6d05..7046719 100644 --- a/cli.c +++ b/cli.c @@ -2,7 +2,7 @@ // vim: sw=8 ts=8 char const *cvs_name = "$Name: $"; -char const *cvs_id_cli = "$Id: cli.c,v 1.53 2005/02/08 01:20:38 bodea Exp $"; +char const *cvs_id_cli = "$Id: cli.c,v 1.54 2005/04/18 05:07:20 bodea Exp $"; #include #include @@ -406,7 +406,7 @@ static int cmd_show_session(struct cli_def *cli, char *command, char **argv, int cli_print(cli, "\tCalled Num:\t%s", session[s].called); cli_print(cli, "\tTunnel ID:\t%d", session[s].tunnel); cli_print(cli, "\tIP address:\t%s", fmtaddr(htonl(session[s].ip), 0)); - cli_print(cli, "\tUnique SID:\t%lu", session[s].unique_id); + cli_print(cli, "\tUnique SID:\t%u", session[s].unique_id); cli_print(cli, "\tIdle time:\t%u seconds", abs(time_now - session[s].last_packet)); cli_print(cli, "\tNext Recv:\t%u", session[s].nr); cli_print(cli, "\tNext Send:\t%u", session[s].ns); diff --git a/l2tpns.c b/l2tpns.c index 10ab3a5..1f47934 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -4,7 +4,7 @@ // Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced // vim: sw=8 ts=8 -char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.89 2005/04/01 06:39:00 bodea Exp $"; +char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.90 2005/04/18 05:07:20 bodea Exp $"; #include #include @@ -68,11 +68,10 @@ static int rand_fd = -1; // Random data source time_t basetime = 0; // base clock char hostname[1000] = ""; // us. static int tunidx; // ifr_ifindex of tun device -static uint32_t sessionid = 0; // session id for radius accounting static int syslog_log = 0; // are we logging to syslog static FILE *log_stream = NULL; // file handle for direct logging (i.e. direct into file, not via syslog). extern int cluster_sockfd; // Intra-cluster communications socket. -uint32_t last_id = 0; // Last used PPP SID. Can I kill this?? -- mo +uint32_t last_id = 0; // Unique ID for radius accounting struct cli_session_actions *cli_session_actions = NULL; // Pending session changes requested by CLI struct cli_tunnel_actions *cli_tunnel_actions = NULL; // Pending tunnel changes required by CLI @@ -2319,7 +2318,6 @@ void processudp(uint8_t * buf, int len, struct sockaddr_in *addr) } c = controlnew(11); // sending ICRP - session[s].id = sessionid++; session[s].opened = time_now; session[s].tunnel = t; session[s].far = asession; diff --git a/l2tpns.h b/l2tpns.h index 20ec1fe..396d4f6 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -1,5 +1,5 @@ // L2TPNS Global Stuff -// $Id: l2tpns.h,v 1.62 2005/04/18 04:18:15 bodea Exp $ +// $Id: l2tpns.h,v 1.63 2005/04/18 05:07:20 bodea Exp $ #ifndef __L2TPNS_H__ #define __L2TPNS_H__ @@ -166,7 +166,7 @@ typedef struct tunnelidt tunnel; // near end tunnel ID in_addr_t ip; // IP of session set by RADIUS response (host byte order). int ip_pool_index; // index to IP pool - unsigned long unique_id; // unique session id + uint32_t unique_id; // unique session id uint16_t nr; // next receive uint16_t ns; // next send uint32_t magic; // ppp magic number @@ -174,7 +174,6 @@ typedef struct uint32_t pin, pout; // packet counts uint32_t total_cin; // This counter is never reset while a session is open uint32_t total_cout; // This counter is never reset while a session is open - uint32_t id; // session id uint16_t throttle_in; // upstream throttle rate (kbps) uint16_t throttle_out; // downstream throttle rate clockt opened; // when started @@ -187,9 +186,7 @@ typedef struct uint16_t tbf_in; // filter bucket for throttling in from the user. uint16_t tbf_out; // filter bucket for throttling out to the user. uint8_t l2tp_flags; // various bit flags from the ICCN on the l2tp tunnel. - uint8_t reserved_old_snoop; // No longer used - remove at some time uint8_t walled_garden; // is this session gardened? - uint8_t flags1; // additional flags (currently unused); char random_vector[MAXTEL]; int random_vector_length; char user[MAXUSER]; // user (needed in seesion for radius stop messages) diff --git a/radius.c b/radius.c index e8016f7..528aee8 100644 --- a/radius.c +++ b/radius.c @@ -1,6 +1,6 @@ // L2TPNS Radius Stuff -char const *cvs_id_radius = "$Id: radius.c,v 1.25 2005/03/10 06:16:05 bodea Exp $"; +char const *cvs_id_radius = "$Id: radius.c,v 1.26 2005/04/18 05:07:20 bodea Exp $"; #include #include @@ -239,7 +239,7 @@ void radiussend(uint16_t r, uint8_t state) { *p = 44; // session ID p[1] = 18; - sprintf(p + 2, "%08X%08X", session[s].id, session[s].opened); + sprintf(p + 2, "%08X%08X", session[s].unique_id, session[s].opened); p += p[1]; if (state == RADIUSSTOP) { // stop @@ -581,7 +581,7 @@ void processrad(uint8_t *buf, int len, char socket_index) // Vendor-Specific Attribute int vendor = ntohl(*(int *)(p + 2)); char attrib = *(p + 6); - char attrib_length = *(p + 7) - 2; + int attrib_length = *(p + 7) - 2; char *avpair, *value, *key, *newp; LOG(3, s, session[s].tunnel, " Radius reply contains Vendor-Specific. Vendor=%d Attrib=%d Length=%d\n", vendor, attrib, attrib_length);