+typedef struct {
+ int level;
+ const char *string;
+} DebugLevel;
+
+static DebugLevel debug_levels[] = {
+ /* Basic stuff from silcd/ */
+ { 5, "silc_server_*" },
+
+ /* All from silcd/ */
+ { 10, "*silcd*,*serverid*,silc_server_*,*idlist*" },
+
+ /* All from silcd/ and basic stuff from libs */
+ { 15, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,*silcske*" },
+
+ /* All from silcd/ and more stuff from libs */
+ { 20, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*" },
+
+ /* All from silcd/ and even more stuff from libs */
+ { 25, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*" },
+
+ /* All from silcd/ and even more stuff from libs + all from silccore */
+ { 30, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*"
+ "*silcid*,*argument*" },
+
+ /* All from silcd/, all from silccore, silccrypt and silcmath */
+ { 35, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*"
+ "*silcid*,*argument*,*pkcs*,*hmac*,*hash*,*cipher*,silc_math*" },
+
+ /* All from silcd/, all from silccore, silccrypt and silcmath + stuff
+ from silcutil */
+ { 40, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*"
+ "*silcid*,*argument*,*pkcs*,*hmac*,*hash*,*cipher*,silc_math*,*sim*"
+ "*sockconn*" },
+
+ /* All from silcd/, all from silccore, silccrypt and silcmath + more stuff
+ from silcutil */
+ { 45, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*"
+ "*silcid*,*argument*,*pkcs*,*hmac*,*hash*,*cipher*,silc_math*,*sim*"
+ "*sockconn*,*net*" },
+
+ /* All from silcd/, all from silccore, silccrypt and silcmath + more stuff
+ from silcutil */
+ { 50, "*silcd*,*serverid*,silc_server_*,*idlist*,*silcauth*,"
+ "*silcpacket*,*ske*,*silcrng*,*command*,*channel*,*private*,*notify*"
+ "*silcid*,*argument*,*pkcs*,*hmac*,*hash*,*cipher*,silc_math*,*sim*"
+ "*sockconn*,*net*,*log*,*config*" },
+
+ /* All */
+ { 90, "*" },
+
+ { -1, NULL },
+};
+
+static void silc_get_debug_level(int level)
+{
+ int i;
+
+ if (level < 0)
+ return;
+
+ for (i = 0; debug_levels[i].string; i++)
+ if (level <= debug_levels[i].level) {
+ silc_log_set_debug_string(debug_levels[i].string);
+ break;
+ }
+}
+