// 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 <stdio.h>
#include <stdarg.h>
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);
// 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 <arpa/inet.h>
#include <assert.h>
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
}
c = controlnew(11); // sending ICRP
- session[s].id = sessionid++;
session[s].opened = time_now;
session[s].tunnel = t;
session[s].far = asession;
// 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__
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
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
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)
// 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 <stdio.h>
{
*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
// 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);