]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/log.c
zebra: add 3 fields to ipset_entry : src,dst port, and proto
[mirror_frr.git] / lib / log.c
index a8e7462baac123992a49a50dfaa3ee621ce62096..dbfc95da86251fd6cbf2925637d2cae4f9b93a5a 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -296,7 +296,7 @@ static char *str_append(char *dst, int len, const char *src)
        return dst;
 }
 
-static char *num_append(char *s, int len, u_long x)
+static char *num_append(char *s, int len, unsigned long x)
 {
        char buf[30];
        char *t;
@@ -312,7 +312,7 @@ static char *num_append(char *s, int len, u_long x)
 }
 
 #if defined(SA_SIGINFO) || defined(HAVE_STACK_TRACE)
-static char *hex_append(char *s, int len, u_long x)
+static char *hex_append(char *s, int len, unsigned long x)
 {
        char buf[30];
        char *t;
@@ -321,7 +321,7 @@ static char *hex_append(char *s, int len, u_long x)
                return str_append(s, len, "0");
        *(t = &buf[sizeof(buf) - 1]) = '\0';
        while (x && (t > buf)) {
-               u_int cc = (x % 16);
+               unsigned int cc = (x % 16);
                *--t = ((cc < 10) ? ('0' + cc) : ('a' + cc - 10));
                x /= 16;
        }
@@ -446,10 +446,10 @@ void zlog_signal(int signo, const char *action
        s = num_append(LOC, now);
 #ifdef SA_SIGINFO
        s = str_append(LOC, " (si_addr 0x");
-       s = hex_append(LOC, (u_long)(siginfo->si_addr));
+       s = hex_append(LOC, (unsigned long)(siginfo->si_addr));
        if (program_counter) {
                s = str_append(LOC, ", PC 0x");
-               s = hex_append(LOC, (u_long)program_counter);
+               s = hex_append(LOC, (unsigned long)program_counter);
        }
        s = str_append(LOC, "); ");
 #else  /* SA_SIGINFO */
@@ -596,7 +596,8 @@ void zlog_backtrace_sigsafe(int priority, void *program_counter)
                                        s = str_append(LOC, "[bt ");
                                        s = num_append(LOC, i);
                                        s = str_append(LOC, "] 0x");
-                                       s = hex_append(LOC, (u_long)(array[i]));
+                                       s = hex_append(
+                                               LOC, (unsigned long)(array[i]));
                                }
                                *s = '\0';
                                if (priority
@@ -720,11 +721,11 @@ void memory_oom(size_t size, const char *name)
 }
 
 /* Open log stream */
-void openzlog(const char *progname, const char *protoname, u_short instance,
-             int syslog_flags, int syslog_facility)
+void openzlog(const char *progname, const char *protoname,
+             unsigned short instance, int syslog_flags, int syslog_facility)
 {
        struct zlog *zl;
-       u_int i;
+       unsigned int i;
 
        zl = XCALLOC(MTYPE_ZLOG, sizeof(struct zlog));
 
@@ -964,14 +965,21 @@ static const struct zebra_desc_table command_types[] = {
        DESC_ENTRY(ZEBRA_RULE_ADD),
        DESC_ENTRY(ZEBRA_RULE_DELETE),
        DESC_ENTRY(ZEBRA_RULE_NOTIFY_OWNER),
+       DESC_ENTRY(ZEBRA_TABLE_MANAGER_CONNECT),
+       DESC_ENTRY(ZEBRA_GET_TABLE_CHUNK),
+       DESC_ENTRY(ZEBRA_RELEASE_TABLE_CHUNK),
+       DESC_ENTRY(ZEBRA_IPSET_CREATE),
+       DESC_ENTRY(ZEBRA_IPSET_DESTROY),
+       DESC_ENTRY(ZEBRA_IPSET_ENTRY_ADD),
+       DESC_ENTRY(ZEBRA_IPSET_ENTRY_DELETE),
 };
 #undef DESC_ENTRY
 
 static const struct zebra_desc_table unknown = {0, "unknown", '?'};
 
-static const struct zebra_desc_table *zroute_lookup(u_int zroute)
+static const struct zebra_desc_table *zroute_lookup(unsigned int zroute)
 {
-       u_int i;
+       unsigned int i;
 
        if (zroute >= array_size(route_types)) {
                zlog_err("unknown zebra route type: %u", zroute);
@@ -992,12 +1000,12 @@ static const struct zebra_desc_table *zroute_lookup(u_int zroute)
        return &unknown;
 }
 
-const char *zebra_route_string(u_int zroute)
+const char *zebra_route_string(unsigned int zroute)
 {
        return zroute_lookup(zroute)->string;
 }
 
-char zebra_route_char(u_int zroute)
+char zebra_route_char(unsigned int zroute)
 {
        return zroute_lookup(zroute)->chr;
 }
@@ -1055,8 +1063,6 @@ int proto_redistnum(int afi, const char *s)
                        return ZEBRA_ROUTE_BABEL;
                else if (strmatch(s, "sharp"))
                        return ZEBRA_ROUTE_SHARP;
-               else if (strmatch(s, "vpn"))
-                       return ZEBRA_ROUTE_BGP_VPN;
        }
        if (afi == AFI_IP6) {
                if (strmatch(s, "kernel"))
@@ -1085,8 +1091,6 @@ int proto_redistnum(int afi, const char *s)
                        return ZEBRA_ROUTE_BABEL;
                else if (strmatch(s, "sharp"))
                        return ZEBRA_ROUTE_SHARP;
-               else if (strmatch(s, "vpn"))
-                       return ZEBRA_ROUTE_BGP_VPN;
        }
        return -1;
 }