]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
format the PROTOCOL line, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 10 May 2019 13:18:38 +0000 (09:18 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 10 May 2019 13:18:38 +0000 (09:18 -0400)
scripts/dict/format.pl

index a4f0f8e97957650ec213d42c91104ffd9977e8a2..9b3c083ed6e53723d011c3033c6e008d409788c2 100755 (executable)
@@ -101,6 +101,29 @@ while (@ARGV) {
            $previous = "";
        }
 
+       #
+       #  Remember the protocol
+       #
+       if (/^PROTOCOL\s+([-\w]+)\s+(\w+)\s+(.*)/) {
+           $name=$1;
+           $format = $3;
+           $len = length $name;
+           if ($len < 16) {
+               $lenx = 16 - $len;
+               $lenx += 7;             # round up
+               $lenx /= 8;
+               $lenx = int $lenx;
+               $tabs = "\t" x $lenx;
+           } else {
+               $tabs = " ";
+           }
+
+           $format = "\t$format" if ($format);
+
+           push @output, "PROTOCOL\t$name$tabs$2$format\n";
+           next;
+       }
+
        #
        #  Remember the vendor
        #