diff options
author | ivan <ivan> | 2001-09-07 20:17:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-09-07 20:17:50 +0000 |
commit | 3beb58199322355f8caa166000bb94e9419b4232 (patch) | |
tree | fd2ab49c213276b181e2d4bf49df4961b48f3e23 /bin/generate-raddb | |
parent | 34e22e18b050b9a507433d24eb7a896ce2182afd (diff) |
fix RADIUS attribute capitalization
Diffstat (limited to 'bin/generate-raddb')
-rwxr-xr-x | bin/generate-raddb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/generate-raddb b/bin/generate-raddb new file mode 100755 index 000000000..e9580d645 --- /dev/null +++ b/bin/generate-raddb @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +# usage: generate-raddb radius-server/raddb/dictionary* >raddb.pm +# i.e.: generate-raddb ~/src/freeradius-0.2/raddb/dictionary* >FS/raddb.pm + +print <<END; +package FS::raddb; +use vars qw(%attrib); + +%attrib = ( +END + +while (<>) { + next if /^(#|\s*$|\$INCLUDE\s+)/; + next if /^(VALUE|VENDOR|BEGIN\-VENDOR|END\-VENDOR)\s+/; + /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-]+)\s+/ or die $_; + $attrib = $2; + $dbname = lc($2); + $dbname =~ s/\-/_/g; + $hash{$dbname} = $attrib; + #print "$2\n"; +} + +foreach ( keys %hash ) { +# print "$_\n" if length($_)>24; +# print substr($_,0,24),"\n" if length($_)>24; +# $max = length($_) if length($_)>$max; +#everything >24 is still unique, at least with freeradius comprehensive dataset + print " '". substr($_,0,24). "' => '$hash{$_}'\n"; +} + +print <<END; +1; +END + |