Hack to let developers catch bad dictionaries
authorAlan T. DeKok <aland@freeradius.org>
Sat, 5 Mar 2011 07:07:14 +0000 (08:07 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 5 Mar 2011 07:07:14 +0000 (08:07 +0100)
uses fprintf to print warning messages when the attributes are
illegally defined in the IANA standard space

src/lib/dict.c

index c675ed6..f613664 100644 (file)
@@ -995,6 +995,18 @@ static int process_attribute(const char* fn, const int line,
                flags.is_tlv = 1;
        }
 
+#ifdef WITH_DICTIONARY_WARNINGS
+       /*
+        *      Hack to help us discover which vendors have illegal
+        *      attributes.
+        */
+       if (!vendor && (value < 256) &&
+           !strstr(fn, "rfc") && !strstr(fn, "illegal")) {
+               fprintf(stderr, "WARNING: Illegal Attribute %s in %s\n",
+                       argv[0], fn);
+       }
+#endif
+
        /*
         *      Add it in.
         */