diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-03 20:07:23 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | 85cd2f9f9a43d0c536f445cc65b94a8d90bb4c97 (patch) | |
tree | 8ae31ca6e770aeeb3ad5bc2475af0f320d922b2c /lib | |
parent | *: rename zlog_fer -> flog_err (diff) | |
download | frr-85cd2f9f9a43d0c536f445cc65b94a8d90bb4c97.tar.xz frr-85cd2f9f9a43d0c536f445cc65b94a8d90bb4c97.zip |
*: rename ferr_ref -> log_ref
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ferr.c | 26 | ||||
-rw-r--r-- | lib/ferr.h | 12 | ||||
-rw-r--r-- | lib/lib_errors.c | 4 | ||||
-rw-r--r-- | lib/lib_errors.h | 2 | ||||
-rw-r--r-- | lib/libfrr.c | 4 |
5 files changed, 24 insertions, 24 deletions
diff --git a/lib/ferr.c b/lib/ferr.c index b0a22d822..2fa5db6f3 100644 --- a/lib/ferr.c +++ b/lib/ferr.c @@ -62,20 +62,20 @@ struct hash *refs; static int ferr_hash_cmp(const void *a, const void *b) { - const struct ferr_ref *f_a = a; - const struct ferr_ref *f_b = b; + const struct log_ref *f_a = a; + const struct log_ref *f_b = b; return f_a->code == f_b->code; } static inline unsigned int ferr_hash_key(void *a) { - struct ferr_ref *f = a; + struct log_ref *f = a; return f->code; } -void ferr_ref_add(struct ferr_ref *ref) +void log_ref_add(struct log_ref *ref) { uint32_t i = 0; @@ -89,10 +89,10 @@ void ferr_ref_add(struct ferr_ref *ref) pthread_mutex_unlock(&refs_mtx); } -struct ferr_ref *ferr_ref_get(uint32_t code) +struct log_ref *log_ref_get(uint32_t code) { - struct ferr_ref holder; - struct ferr_ref *ref; + struct log_ref holder; + struct log_ref *ref; holder.code = code; pthread_mutex_lock(&refs_mtx); @@ -104,9 +104,9 @@ struct ferr_ref *ferr_ref_get(uint32_t code) return ref; } -void ferr_ref_display(struct vty *vty, uint32_t code, bool json) +void log_ref_display(struct vty *vty, uint32_t code, bool json) { - struct ferr_ref *ref; + struct log_ref *ref; struct json_object *top, *obj; struct list *errlist; struct listnode *ln; @@ -121,7 +121,7 @@ void ferr_ref_display(struct vty *vty, uint32_t code, bool json) pthread_mutex_unlock(&refs_mtx); if (code) { - ref = ferr_ref_get(code); + ref = log_ref_get(code); if (!ref) { vty_out(vty, "Code %"PRIu32" - Unknown\n", code); return; @@ -181,11 +181,11 @@ DEFUN_NOSH(show_error_code, if (!strmatch(argv[2]->text, "all")) arg = strtoul(argv[2]->arg, NULL, 10); - ferr_ref_display(vty, arg, json); + log_ref_display(vty, arg, json); return CMD_SUCCESS; } -void ferr_ref_init(void) +void log_ref_init(void) { pthread_mutex_lock(&refs_mtx); { @@ -197,7 +197,7 @@ void ferr_ref_init(void) install_element(VIEW_NODE, &show_error_code_cmd); } -void ferr_ref_fini(void) +void log_ref_fini(void) { pthread_mutex_lock(&refs_mtx); { diff --git a/lib/ferr.h b/lib/ferr.h index 9e31c9a0a..335875c16 100644 --- a/lib/ferr.h +++ b/lib/ferr.h @@ -132,7 +132,7 @@ struct ferr { #define ZEBRA_FERR_END 0xF1FFFFFF #define END_FERR 0xFFFFFFFF -struct ferr_ref { +struct log_ref { /* Unique error code displayed to end user as a reference. -1 means * this is an uncoded error that does not have reference material. */ uint32_t code; @@ -144,16 +144,16 @@ struct ferr_ref { const char *suggestion; }; -void ferr_ref_add(struct ferr_ref *ref); -struct ferr_ref *ferr_ref_get(uint32_t code); -void ferr_ref_display(struct vty *vty, uint32_t code, bool json); +void log_ref_add(struct log_ref *ref); +struct log_ref *log_ref_get(uint32_t code); +void log_ref_display(struct vty *vty, uint32_t code, bool json); /* * This function should be called by the * code in libfrr.c */ -void ferr_ref_init(void); -void ferr_ref_fini(void); +void log_ref_init(void); +void log_ref_fini(void); /* get error details. * diff --git a/lib/lib_errors.c b/lib/lib_errors.c index dcda9955d..332a5b1d4 100644 --- a/lib/lib_errors.c +++ b/lib/lib_errors.c @@ -21,7 +21,7 @@ #include "lib_errors.h" /* clang-format off */ -static struct ferr_ref ferr_lib_err[] = { +static struct log_ref ferr_lib_err[] = { { .code = LIB_ERR_PRIVILEGES, .title = "Failure to raise or lower privileges", @@ -114,5 +114,5 @@ static struct ferr_ref ferr_lib_err[] = { void lib_error_init(void) { - ferr_ref_add(ferr_lib_err); + log_ref_add(ferr_lib_err); } diff --git a/lib/lib_errors.h b/lib/lib_errors.h index 8be33ae25..84f5b8dc1 100644 --- a/lib/lib_errors.h +++ b/lib/lib_errors.h @@ -23,7 +23,7 @@ #include "lib/ferr.h" -enum lib_ferr_refs { +enum lib_log_refs { LIB_ERR_PRIVILEGES = LIB_FERR_START, LIB_ERR_VRF_START, LIB_ERR_SOCKET, diff --git a/lib/libfrr.c b/lib/libfrr.c index a49372675..b7d4b192d 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -599,7 +599,7 @@ struct thread_master *frr_init(void) vty_init(master); memory_init(); - ferr_ref_init(); + log_ref_init(); lib_error_init(); return master; @@ -941,7 +941,7 @@ void frr_fini(void) /* memory_init -> nothing needed */ vty_terminate(); cmd_terminate(); - ferr_ref_fini(); + log_ref_fini(); zprivs_terminate(di->privs); /* signal_init -> nothing needed */ thread_master_free(master); |