New build path variable
[freeradius.git] / share / dct2fr
1 #!/usr/bin/perl
2
3 #
4 #       Horrible hack to convert Funk dictionaries to FreeRADIUS ones.
5 #
6 #       It won't convert everything, and the files still need to be
7 #       edited afterwards, but it's a start.
8 #
9 #       ./dct2fr foo.dct > dictionary.foo
10 #       vi dictionary.foo
11 #               replace 'foo' with the real vendor name
12 #       ./format.pl dictionary.foo
13 #
14
15 while (<>) {
16     if (/^MACRO\s+([^ \t\(]+)\(t,s\)\s+26\s+\[vid=(\d+)\s+type1=\%t\%\s+len1=\+2\s+data=\%s\%/) {
17         $name = $1;
18         $vendor = $2;
19
20         print "VENDOR foo $2\n";
21         print "BEGIN-VENDOR foo\n";
22     }
23
24 #    if (/^ATTRIBUTE\s+([^ \t]+)\s+$name\s*\((\d+),s+(\w+)\)/i) {
25
26     if (/^ATTRIBUTE\s+([^ \t]+)\s+$name\s*\((\d+)\s*,\s*(\w+)/i) {
27         print "ATTRIBUTE $1 $2 $3\n";
28     }
29 }
30
31 print "END-VENDOR foo\n";