From aa0f5b38aec14428b4b80e06f90ff781f8bca5f1 Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Mon, 22 May 2006 05:12:18 +0000 Subject: Import initial strongswan 2.7.0 version into SVN. --- programs/klipsdebug/klipsdebug.c | 436 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 436 insertions(+) create mode 100644 programs/klipsdebug/klipsdebug.c (limited to 'programs/klipsdebug/klipsdebug.c') diff --git a/programs/klipsdebug/klipsdebug.c b/programs/klipsdebug/klipsdebug.c new file mode 100644 index 000000000..c205038a1 --- /dev/null +++ b/programs/klipsdebug/klipsdebug.c @@ -0,0 +1,436 @@ +/* + * control KLIPS debugging options + * Copyright (C) 1996 John Ioannidis. + * Copyright (C) 1998, 1999, 2000, 2001 Richard Guy Briggs + * 2001 Michael Richardson + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +char klipsdebug_c_version[] = "RCSID $Id: klipsdebug.c,v 1.2 2004/06/07 15:16:34 as Exp $"; + + +#include +#include /* new */ +#include +#include +#include /* system(), strtoul() */ +#include /* open() */ +#include /* open() */ + +#include + +#include +#include + + + +#include +#include +#if 0 +#include /* CONFIG_IPSEC_PFKEYv2 */ +#endif + +/* permanently turn it on since netlink support has been disabled */ +#include +#include +#include + +#include "freeswan/radij.h" +#include "freeswan/ipsec_encap.h" +#ifndef CONFIG_IPSEC_DEBUG +#define CONFIG_IPSEC_DEBUG +#endif /* CONFIG_IPSEC_DEBUG */ +#include "freeswan/ipsec_tunnel.h" + +#include +#include + +__u32 bigbuf[1024]; +char *program_name; + +int pfkey_sock; +fd_set pfkey_socks; +uint32_t pfkey_seq = 0; + +char copyright[] = +"Copyright (C) 1999 Henry Spencer, Richard Guy Briggs, D. Hugh Redelmeier,\n\ + Sandy Harris, Angelos D. Keromytis, John Ioannidis.\n\ +\n\ + This program is free software; you can redistribute it and/or modify it\n\ + under the terms of the GNU General Public License as published by the\n\ + Free Software Foundation; either version 2 of the License, or (at your\n\ + option) any later version. See .\n\ +\n\ + This program is distributed in the hope that it will be useful, but\n\ + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n\ + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n\ + (file COPYING in the distribution) for more details.\n"; + +static void +usage(char * arg) +{ + fprintf(stdout, "usage: %s {--set|--clear} {tunnel|tunnel-xmit|netlink|xform|eroute|spi|radij|esp|ah|rcv|pfkey|ipcomp|verbose}\n", arg); + fprintf(stdout, " %s {--all|--none}\n", arg); + fprintf(stdout, " %s --help\n", arg); + fprintf(stdout, " %s --version\n", arg); + fprintf(stdout, " %s\n", arg); + fprintf(stdout, " [ --debug ] is optional to any %s command\n", arg); + fprintf(stdout, " [ --label