summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/log.c b/lib/log.c
index 21bf3f2f..cbf76af9 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -886,3 +886,17 @@ zserv_command_string (unsigned int command)
}
return command_types[command].string;
}
+
+#define RTSIZE (sizeof(route_types)/sizeof(route_types[0]))
+
+int
+proto_name2num(const char *s)
+{
+ unsigned i;
+
+ for (i=0; i<RTSIZE; ++i)
+ if (strcasecmp(s, route_types[i].string) == 0)
+ return route_types[i].type;
+ return -1;
+}
+#undef RTSIZE