// 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.30 2004-10-05 02:50:03 fred_nerk Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.31 2004-10-25 15:07:51 bodea Exp $";
#include <arpa/inet.h>
#include <assert.h>
}
// Init data structures
-void initdata(void)
+void initdata(int optdebug, char *optconfig)
{
int i;
char *p;
}
memset(config, 0, sizeof(struct configt));
time(&config->start_time);
- strncpy(config->config_file, CONFIGFILE, sizeof(config->config_file) - 1);
+ config->debug = optdebug;
+ strncpy(config->config_file, optconfig, strlen(optconfig));
if (!(tunnel = shared_malloc(sizeof(tunnelt) * MAXTUNNEL)))
{
log(0, 0, 0, 0, "Error doing malloc for tunnels: %s\n", strerror(errno));
{
int o;
int optdebug = 0;
+ char *optconfig = CONFIGFILE;
_program_name = strdup(argv[0]);
time(&basetime); // start clock
// scan args
- while ((o = getopt(argc, argv, "vc:h:a:")) >= 0)
+ while ((o = getopt(argc, argv, "dvc:h:")) >= 0)
{
switch (o)
{
case 'v':
optdebug++;
break;
+ case 'c':
+ optconfig = optarg;
+ break;
case 'h':
snprintf(hostname, sizeof(hostname), "%s", optarg);
break;
- case '?':
default:
printf("Args are:\n"
"\t-d\tDetach from terminal\n"
initiptables();
initplugins();
- initdata();
-
- config->debug = optdebug;
+ initdata(optdebug, optconfig);
init_tbf();
init_cli();
// L2TPNS Global Stuff
-// $Id: l2tpns.h,v 1.20 2004-10-04 23:34:54 fred_nerk Exp $
+// $Id: l2tpns.h,v 1.21 2004-10-25 15:07:52 bodea Exp $
#ifndef __L2TPNS_H__
#define __L2TPNS_H__
void routeset(sessionidt, ipt ip, ipt mask, ipt gw, u8 add);
void inittun(void);
void initudp(void);
-void initdata(void);
+void initdata(int optdebug, const char *optconfig);
void initippool();
sessionidt sessionbyip(ipt ip);
sessionidt sessionbyuser(char *username);