]> git.ipfire.org Git - thirdparty/strongswan.git/blob - programs/calcgoo/calcgoo.in
- import of strongswan-2.7.0
[thirdparty/strongswan.git] / programs / calcgoo / calcgoo.in
1 #!/usr/bin/perl
2
3 $MODULE_GOO_LIST="@MODULE_GOO_LIST@";
4
5 @goo = split(/\s+/,$MODULE_GOO_LIST);
6
7 $sep="(";
8 $goore=" ";
9
10 #print "GOO: ",join('|',@goo),"\n";
11
12 foreach $sym (@goo) {
13 $goore=${goore}.${sep}.${sym};
14 $sep="|";
15 }
16 $goore=${goore}.")_R(smp_){0,1}([0-9A-F]{8})";
17
18 #print "GOORE: $goore\n";
19
20 while(<>) {
21 chomp;
22 if(/$goore/io) {
23 $sym=$1;
24 $goosym=$3;
25 $bingoo=hex($goosym);
26 if($2 eq "smp_") {
27 $bingoo++;
28 }
29 #print STDERR "Processing $goosym (from $_)\n";
30 $bingoo{$sym}=$bingoo;
31 }
32 }
33 $wholegoo=0;
34 foreach $sym (keys %bingoo) {
35 $wholegoo=$wholegoo ^ $bingoo{$sym};
36 }
37 print sprintf("%08x", $wholegoo)."\n";
38
39 # Local variables::
40 # mode: perl
41 # End variables::
42
43