diff options
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |