diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-19 20:42:55 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | 02705213b15f54b8601cd172e1b7123930575f86 (patch) | |
tree | 8ba4cb32a83e12ee1cfed65c914ffef1c6f2277f /bgpd/rfapi | |
parent | zebra, lib: error references for zebra (diff) | |
download | frr-02705213b15f54b8601cd172e1b7123930575f86.tar.xz frr-02705213b15f54b8601cd172e1b7123930575f86.zip |
bgpd: Convert to using LIB_ERR_XXX where possible
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/rfapi')
-rw-r--r-- | bgpd/rfapi/rfapi.c | 7 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_import.c | 8 | ||||
-rw-r--r-- | bgpd/rfapi/vnc_export_bgp.c | 32 | ||||
-rw-r--r-- | bgpd/rfapi/vnc_import_bgp.c | 13 | ||||
-rw-r--r-- | bgpd/rfapi/vnc_zebra.c | 12 |
5 files changed, 48 insertions, 24 deletions
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index a1f1169a7..ae04385a5 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -32,6 +32,7 @@ #include "lib/command.h" #include "lib/stream.h" #include "lib/ringbuf.h" +#include "lib/lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_ecommunity.h" @@ -3933,7 +3934,8 @@ void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val, size); break; default: - zlog_err("%s: Unknown group type=%d", __func__, type); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: Unknown group type=%d", + __func__, type); /* should never happen */ assert("Unknown type" == NULL); break; @@ -4047,7 +4049,8 @@ void *rfapi_rfp_get_group_config_ptr_name( criteria, search_cb); break; default: - zlog_err("%s: Unknown group type=%d", __func__, type); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: Unknown group type=%d", + __func__, type); /* should never happen */ assert("Unknown type" == NULL); break; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index c1af269d3..7bf7ff85a 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -34,6 +34,7 @@ #include "lib/skiplist.h" #include "lib/thread.h" #include "lib/stream.h" +#include "lib/lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_ecommunity.h" @@ -3028,7 +3029,7 @@ static void rfapiBgpInfoFilteredImportEncap( break; default: - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi); return; } @@ -3485,7 +3486,7 @@ void rfapiBgpInfoFilteredImportVPN( break; default: - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi); return; } @@ -3890,7 +3891,8 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi) default: /* not expected */ - zlog_err("%s: bad safi %d", __func__, safi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad safi %d", __func__, + safi); return rfapiBgpInfoFilteredImportBadSafi; } } diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index d4dd34d1d..be2ef3471 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -33,6 +33,7 @@ #include "lib/linklist.h" #include "lib/plist.h" #include "lib/routemap.h" +#include "lib/lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_ecommunity.h" @@ -187,7 +188,8 @@ void vnc_direct_bgp_add_route_ce(struct bgp *bgp, struct route_node *rn, if (!afi) { - zlog_err("%s: can't get afi of route node", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: can't get afi of route node", __func__); return; } @@ -333,7 +335,7 @@ void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct route_node *rn, struct prefix ce_nexthop; if (!afi) { - zlog_err("%s: bad afi", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi", __func__); return; } @@ -698,7 +700,8 @@ void vnc_direct_bgp_add_prefix(struct bgp *bgp, afi_t afi = family2afi(rn->p.family); if (!afi) { - zlog_err("%s: can't get afi of route node", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: can't get afi of route node", __func__); return; } @@ -807,7 +810,8 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp, afi_t afi = family2afi(rn->p.family); if (!afi) { - zlog_err("%s: can't get afi route node", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi route node", + __func__); return; } @@ -922,7 +926,8 @@ void vnc_direct_bgp_add_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) afi_t afi = family2afi(rfd->vn_addr.addr_family); if (!afi) { - zlog_err("%s: can't get afi of nve vn addr", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: can't get afi of nve vn addr", __func__); return; } @@ -974,7 +979,8 @@ void vnc_direct_bgp_add_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) if (afi == AFI_IP || afi == AFI_IP6) { rt = import_table->imported_vpn[afi]; } else { - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", + __func__, afi); return; } @@ -1066,7 +1072,8 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) afi_t afi = family2afi(rfd->vn_addr.addr_family); if (!afi) { - zlog_err("%s: can't get afi of nve vn addr", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: can't get afi of nve vn addr", __func__); return; } @@ -1113,7 +1120,8 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) if (afi == AFI_IP || afi == AFI_IP6) { rt = import_table->imported_vpn[afi]; } else { - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", + __func__, afi); return; } @@ -1288,7 +1296,7 @@ static void vnc_direct_bgp_add_group_afi(struct bgp *bgp, if (afi == AFI_IP || afi == AFI_IP6) { rt = import_table->imported_vpn[afi]; } else { - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi); return; } @@ -1632,7 +1640,8 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi, struct attr *iattr; if (!afi) { - zlog_err("%s: can't get afi of route node", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: can't get afi of route node", __func__); return; } @@ -1751,7 +1760,8 @@ void vnc_direct_bgp_rh_del_route(struct bgp *bgp, afi_t afi, struct vnc_export_info *eti; if (!afi) { - zlog_err("%s: can't get afi route node", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi route node", + __func__); return; } diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 156572b57..92749a3e6 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -32,6 +32,7 @@ #include "lib/linklist.h" #include "lib/plist.h" #include "lib/routemap.h" +#include "lib/lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_ecommunity.h" @@ -602,7 +603,8 @@ static void vnc_import_bgp_add_route_mode_resolve_nve( */ if (!afi) { - zlog_err("%s: can't get afi of prefix", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix", + __func__); return; } @@ -718,7 +720,8 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp, } if (!afi) { - zlog_err("%s: can't get afi of prefix", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix", + __func__); return; } @@ -905,7 +908,8 @@ vnc_import_bgp_add_route_mode_nvegroup(struct bgp *bgp, struct prefix *prefix, assert(rfg); if (!afi) { - zlog_err("%s: can't get afi of prefix", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix", + __func__); return; } @@ -2628,7 +2632,8 @@ void vnc_import_bgp_add_route(struct bgp *bgp, struct prefix *prefix, VNC_RHNCK(enter); if (!afi) { - zlog_err("%s: can't get afi of prefix", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix", + __func__); return; } diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 7d564ef11..caecf2e2c 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -32,6 +32,7 @@ #include "lib/stream.h" #include "lib/ringbuf.h" #include "lib/memory.h" +#include "lib/lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_ecommunity.h" @@ -570,7 +571,8 @@ static void vnc_zebra_add_del_prefix(struct bgp *bgp, return; if (rn->p.family != AF_INET && rn->p.family != AF_INET6) { - zlog_err("%s: invalid route node addr family", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "%s: invalid route node addr family", __func__); return; } @@ -642,7 +644,8 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd, return; if (afi != AFI_IP && afi != AFI_IP6) { - zlog_err("%s: invalid vn addr family", __func__); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: invalid vn addr family", + __func__); return; } @@ -739,12 +742,13 @@ static void vnc_zebra_add_del_group_afi(struct bgp *bgp, if (afi == AFI_IP || afi == AFI_IP6) { rt = import_table->imported_vpn[afi]; } else { - zlog_err("%s: bad afi %d", __func__, afi); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi); return; } if (!family) { - zlog_err("%s: computed bad family: %d", __func__, family); + zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: computed bad family: %d", + __func__, family); return; } |