]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/log.c
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / log.c
index 156982635dbf810520f81b96f0a8d112c477c569..00b897dca1f241a8b0884cbea635273f742374bb 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Logging of zebra
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define FRR_DEFINE_DESC_TABLE
@@ -155,7 +140,7 @@ void zlog_signal(int signo, const char *action, void *siginfo_v,
 
        fb.pos = buf;
 
-       struct thread *tc;
+       struct event *tc;
        tc = pthread_getspecific(thread_current);
 
        if (!tc)
@@ -299,7 +284,7 @@ void zlog_backtrace(int priority)
 
 void zlog_thread_info(int log_level)
 {
-       struct thread *tc;
+       struct event *tc;
        tc = pthread_getspecific(thread_current);
 
        if (tc)
@@ -521,6 +506,26 @@ const char *zserv_command_string(unsigned int command)
        return command_types[command].string;
 }
 
+#define DESC_ENTRY(T) [(T)] = {(T), (#T), '\0'}
+static const struct zebra_desc_table gr_client_cap_types[] = {
+       DESC_ENTRY(ZEBRA_CLIENT_GR_CAPABILITIES),
+       DESC_ENTRY(ZEBRA_CLIENT_ROUTE_UPDATE_COMPLETE),
+       DESC_ENTRY(ZEBRA_CLIENT_ROUTE_UPDATE_PENDING),
+       DESC_ENTRY(ZEBRA_CLIENT_GR_DISABLE),
+       DESC_ENTRY(ZEBRA_CLIENT_RIB_STALE_TIME),
+};
+#undef DESC_ENTRY
+
+const char *zserv_gr_client_cap_string(uint32_t zcc)
+{
+       if (zcc >= array_size(gr_client_cap_types)) {
+               flog_err(EC_LIB_DEVELOPMENT, "unknown zserv command type: %u",
+                        zcc);
+               return unknown.string;
+       }
+       return gr_client_cap_types[zcc].string;
+}
+
 int proto_name2num(const char *s)
 {
        unsigned i;