remove dead session fields

This commit is contained in:
Brendan O'Dea 2005-04-18 05:07:20 +00:00
parent f9603d4832
commit 621983b8d0
4 changed files with 9 additions and 14 deletions

4
cli.c
View file

@ -2,7 +2,7 @@
// vim: sw=8 ts=8 // vim: sw=8 ts=8
char const *cvs_name = "$Name: $"; 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 <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@ -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, "\tCalled Num:\t%s", session[s].called);
cli_print(cli, "\tTunnel ID:\t%d", session[s].tunnel); 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, "\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, "\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 Recv:\t%u", session[s].nr);
cli_print(cli, "\tNext Send:\t%u", session[s].ns); cli_print(cli, "\tNext Send:\t%u", session[s].ns);

View file

@ -4,7 +4,7 @@
// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced // Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
// vim: sw=8 ts=8 // 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 <arpa/inet.h> #include <arpa/inet.h>
#include <assert.h> #include <assert.h>
@ -68,11 +68,10 @@ static int rand_fd = -1; // Random data source
time_t basetime = 0; // base clock time_t basetime = 0; // base clock
char hostname[1000] = ""; // us. char hostname[1000] = ""; // us.
static int tunidx; // ifr_ifindex of tun device 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 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). 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. 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_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 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 c = controlnew(11); // sending ICRP
session[s].id = sessionid++;
session[s].opened = time_now; session[s].opened = time_now;
session[s].tunnel = t; session[s].tunnel = t;
session[s].far = asession; session[s].far = asession;

View file

@ -1,5 +1,5 @@
// L2TPNS Global Stuff // 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__ #ifndef __L2TPNS_H__
#define __L2TPNS_H__ #define __L2TPNS_H__
@ -166,7 +166,7 @@ typedef struct
tunnelidt tunnel; // near end tunnel ID tunnelidt tunnel; // near end tunnel ID
in_addr_t ip; // IP of session set by RADIUS response (host byte order). in_addr_t ip; // IP of session set by RADIUS response (host byte order).
int ip_pool_index; // index to IP pool 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 nr; // next receive
uint16_t ns; // next send uint16_t ns; // next send
uint32_t magic; // ppp magic number uint32_t magic; // ppp magic number
@ -174,7 +174,6 @@ typedef struct
uint32_t pin, pout; // packet counts uint32_t pin, pout; // packet counts
uint32_t total_cin; // This counter is never reset while a session is open 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 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_in; // upstream throttle rate (kbps)
uint16_t throttle_out; // downstream throttle rate uint16_t throttle_out; // downstream throttle rate
clockt opened; // when started 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_in; // filter bucket for throttling in from the user.
uint16_t tbf_out; // filter bucket for throttling out to 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 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 walled_garden; // is this session gardened?
uint8_t flags1; // additional flags (currently unused);
char random_vector[MAXTEL]; char random_vector[MAXTEL];
int random_vector_length; int random_vector_length;
char user[MAXUSER]; // user (needed in seesion for radius stop messages) char user[MAXUSER]; // user (needed in seesion for radius stop messages)

View file

@ -1,6 +1,6 @@
// L2TPNS Radius Stuff // 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 <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
@ -239,7 +239,7 @@ void radiussend(uint16_t r, uint8_t state)
{ {
*p = 44; // session ID *p = 44; // session ID
p[1] = 18; 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]; p += p[1];
if (state == RADIUSSTOP) if (state == RADIUSSTOP)
{ // stop { // stop
@ -581,7 +581,7 @@ void processrad(uint8_t *buf, int len, char socket_index)
// Vendor-Specific Attribute // Vendor-Specific Attribute
int vendor = ntohl(*(int *)(p + 2)); int vendor = ntohl(*(int *)(p + 2));
char attrib = *(p + 6); char attrib = *(p + 6);
char attrib_length = *(p + 7) - 2; int attrib_length = *(p + 7) - 2;
char *avpair, *value, *key, *newp; 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); LOG(3, s, session[s].tunnel, " Radius reply contains Vendor-Specific. Vendor=%d Attrib=%d Length=%d\n", vendor, attrib, attrib_length);