diff options
Diffstat (limited to 'lib/log.c')
| -rw-r--r-- | lib/log.c | 47 |
1 files changed, 24 insertions, 23 deletions
@@ -24,6 +24,7 @@ #include <zebra.h> +#include "zclient.h" #include "log.h" #include "memory.h" #include "command.h" @@ -118,7 +119,6 @@ quagga_timestamp(int timestamp_precision, char *buf, size_t buflen) } cache; struct timeval clock; - /* would it be sufficient to use global 'recent_time' here? I fear not... */ gettimeofday(&clock, NULL); /* first, we update the cache if the time has changed */ @@ -990,6 +990,7 @@ static const struct zebra_desc_table command_types[] = { DESC_ENTRY (ZEBRA_IPV4_NEXTHOP_DELETE), DESC_ENTRY (ZEBRA_IPV6_NEXTHOP_ADD), DESC_ENTRY (ZEBRA_IPV6_NEXTHOP_DELETE), + DESC_ENTRY (ZEBRA_IPMR_ROUTE_STATS), }; #undef DESC_ENTRY @@ -1062,49 +1063,49 @@ proto_redistnum(int afi, const char *s) if (afi == AFI_IP) { - if (strncmp (s, "k", 1) == 0) + if (strmatch (s, "kernel")) return ZEBRA_ROUTE_KERNEL; - else if (strncmp (s, "c", 1) == 0) + else if (strmatch (s, "connected")) return ZEBRA_ROUTE_CONNECT; - else if (strncmp (s, "s", 1) == 0) + else if (strmatch (s, "static")) return ZEBRA_ROUTE_STATIC; - else if (strncmp (s, "r", 1) == 0) + else if (strmatch (s, "rip")) return ZEBRA_ROUTE_RIP; - else if (strncmp (s, "o", 1) == 0) + else if (strmatch (s, "ospf")) return ZEBRA_ROUTE_OSPF; - else if (strncmp (s, "i", 1) == 0) + else if (strmatch (s, "isis")) return ZEBRA_ROUTE_ISIS; - else if (strncmp (s, "bg", 2) == 0) + else if (strmatch (s, "bgp")) return ZEBRA_ROUTE_BGP; - else if (strncmp (s, "ta", 2) == 0) + else if (strmatch (s, "table")) return ZEBRA_ROUTE_TABLE; - else if (strcmp (s, "vnc-direct") == 0) - return ZEBRA_ROUTE_VNC_DIRECT; - else if (strcmp (s, "vnc") == 0) + else if (strmatch (s, "vnc")) return ZEBRA_ROUTE_VNC; + else if (strmatch (s, "vnc-direct")) + return ZEBRA_ROUTE_VNC_DIRECT; } if (afi == AFI_IP6) { - if (strncmp (s, "k", 1) == 0) + if (strmatch (s, "kernel")) return ZEBRA_ROUTE_KERNEL; - else if (strncmp (s, "c", 1) == 0) + else if (strmatch (s, "connected")) return ZEBRA_ROUTE_CONNECT; - else if (strncmp (s, "s", 1) == 0) + else if (strmatch (s, "static")) return ZEBRA_ROUTE_STATIC; - else if (strncmp (s, "r", 1) == 0) + else if (strmatch (s, "ripng")) return ZEBRA_ROUTE_RIPNG; - else if (strncmp (s, "o", 1) == 0) + else if (strmatch (s, "ospf6")) return ZEBRA_ROUTE_OSPF6; - else if (strncmp (s, "i", 1) == 0) + else if (strmatch (s, "isis")) return ZEBRA_ROUTE_ISIS; - else if (strncmp (s, "bg", 2) == 0) + else if (strmatch (s, "bgp")) return ZEBRA_ROUTE_BGP; - else if (strncmp (s, "ta", 2) == 0) + else if (strmatch (s, "table")) return ZEBRA_ROUTE_TABLE; - else if (strcmp (s, "vnc-direct") == 0) - return ZEBRA_ROUTE_VNC_DIRECT; - else if (strcmp (s, "vnc") == 0) + else if (strmatch (s, "vnc")) return ZEBRA_ROUTE_VNC; + else if (strmatch (s, "vnc-direct")) + return ZEBRA_ROUTE_VNC_DIRECT; } return -1; } |
