summaryrefslogtreecommitdiff
path: root/programs/calcgoo
diff options
context:
space:
mode:
Diffstat (limited to 'programs/calcgoo')
-rw-r--r--programs/calcgoo/.cvsignore1
-rw-r--r--programs/calcgoo/Makefile41
-rw-r--r--programs/calcgoo/calcgoo.831
-rw-r--r--programs/calcgoo/calcgoo.in43
4 files changed, 116 insertions, 0 deletions
diff --git a/programs/calcgoo/.cvsignore b/programs/calcgoo/.cvsignore
new file mode 100644
index 000000000..b4aa748b7
--- /dev/null
+++ b/programs/calcgoo/.cvsignore
@@ -0,0 +1 @@
+calcgoo
diff --git a/programs/calcgoo/Makefile b/programs/calcgoo/Makefile
new file mode 100644
index 000000000..8e3cae9ea
--- /dev/null
+++ b/programs/calcgoo/Makefile
@@ -0,0 +1,41 @@
+# Makefile for miscelaneous programs
+# Copyright (C) 2002 Michael Richardson <mcr@freeswan.org>
+#
+# 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 <http://www.fsf.org/copyleft/gpl.txt>.
+#
+# 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.
+#
+# RCSID $Id: Makefile,v 1.1 2004/03/15 20:35:27 as Exp $
+
+FREESWANSRCDIR=../..
+include ${FREESWANSRCDIR}/Makefile.inc
+
+PROGRAM=calcgoo
+
+include ../Makefile.program
+
+#
+# $Log: Makefile,v $
+# Revision 1.1 2004/03/15 20:35:27 as
+# added files from freeswan-2.04-x509-1.5.3
+#
+# Revision 1.1 2002/06/10 04:27:25 mcr
+# calcgoo program processes kernel symbol list and generates a
+# composite value by xor'ing the programmed symbol.
+#
+# Revision 1.1 2002/06/10 00:19:44 mcr
+# rename "ipsec check" to "ipsec verify"
+#
+# Revision 1.1 2002/06/08 17:01:25 mcr
+# added new program "ipsec check" to do rudamentary testing
+# on a newly installed system to see if it is OE ready.
+#
+#
+#
+
diff --git a/programs/calcgoo/calcgoo.8 b/programs/calcgoo/calcgoo.8
new file mode 100644
index 000000000..ceb576e41
--- /dev/null
+++ b/programs/calcgoo/calcgoo.8
@@ -0,0 +1,31 @@
+.TH IPSEC_CALCGOO 8 "8 June 2002"
+.\" RCSID $Id: calcgoo.8,v 1.1 2004/03/15 20:35:27 as Exp $
+.SH NAME
+ipsec calcgoo \- calculate hex value for matching modules and kernels
+.SH SYNOPSIS
+.B ipsec
+.B calcgoo
+.SH DESCRIPTION
+.I calcgoo
+accepts the output of
+.B nm -ao
+or
+.B /proc/ksyms
+and extracts a release dependant list of symbols from it. The symbols
+are processed to extract the values assigned during the MODVERSIONS
+process. This process makes sure that Linux modules are only loaded
+on matching kernels.
+.P
+This routine is used to find an appropriate module to match the currently
+running kernel by _startklips.
+.SH FILES
+.nf
+/proc/ksyms
+.fi
+.SH "SEE ALSO"
+ipsec__startklips(8), genksyms(8)
+.SH HISTORY
+Written for the Linux FreeS/WAN project
+<http://www.freeswan.org>
+by Michael Richardson.
+.SH BUGS
diff --git a/programs/calcgoo/calcgoo.in b/programs/calcgoo/calcgoo.in
new file mode 100644
index 000000000..0d383d173
--- /dev/null
+++ b/programs/calcgoo/calcgoo.in
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+$MODULE_GOO_LIST="@MODULE_GOO_LIST@";
+
+@goo = split(/\s+/,$MODULE_GOO_LIST);
+
+$sep="(";
+$goore=" ";
+
+#print "GOO: ",join('|',@goo),"\n";
+
+foreach $sym (@goo) {
+ $goore=${goore}.${sep}.${sym};
+ $sep="|";
+}
+$goore=${goore}.")_R(smp_){0,1}([0-9A-F]{8})";
+
+#print "GOORE: $goore\n";
+
+while(<>) {
+ chomp;
+ if(/$goore/io) {
+ $sym=$1;
+ $goosym=$3;
+ $bingoo=hex($goosym);
+ if($2 eq "smp_") {
+ $bingoo++;
+ }
+ #print STDERR "Processing $goosym (from $_)\n";
+ $bingoo{$sym}=$bingoo;
+ }
+}
+$wholegoo=0;
+foreach $sym (keys %bingoo) {
+ $wholegoo=$wholegoo ^ $bingoo{$sym};
+}
+print sprintf("%08x", $wholegoo)."\n";
+
+# Local variables::
+# mode: perl
+# End variables::
+
+