3 # usage: generate-raddb radius-server/raddb/dictionary* >raddb.pm
4 # i.e.: generate-raddb ~/freeradius/freeradius-1.0.5/share/dictionary* ~/wirelessoceans/dictionary.ip3networks ~/wtxs/dictionary.mot.canopy >raddb.pm.new
14 next if /^\s*(#|\$INCLUDE\s+)/;
15 next if /^(VALUE|VENDOR|BEGIN\-(VENDOR|TLV)|END\-(VENDOR|TLV))\s+/;
16 /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-\/\.]+)\s+/ or die $_;
19 $dbname =~ s/[\-\/]/_/g;
20 $dbname = substr($dbname,0,24);
21 while ( exists $hash{$dbname} ) {
25 $w =~ tr/_a-z0-9/a-z0-9_/;
26 $dbname = "$dbname$w";
28 $hash{$dbname} = $attrib;
32 foreach ( sort keys %hash ) {
33 # print "$_\n" if length($_)>24;
34 # print substr($_,0,24),"\n" if length($_)>24;
35 # $max = length($_) if length($_)>$max;
36 # have to fudge things since everything >24 is *not* unique
38 #print " '". substr($_,0,24). "' => '$hash{$_}',\n";
39 print " '$_' ". ( " " x (24-length($_) ) ). "=> '$hash{$_}',\n";
45 #'authentication_type' => 'Authentication-Type',
48 'motorola_canopy_gateway' => 'Motorola-Canopy-Gateway',