diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bfd.c | 6 | ||||
| -rw-r--r-- | lib/ptm_lib.c | 21 | ||||
| -rw-r--r-- | lib/routemap.c | 3 | ||||
| -rw-r--r-- | lib/vrf.c | 6 | ||||
| -rw-r--r-- | lib/wheel.c | 8 | ||||
| -rw-r--r-- | lib/zclient.c | 42 |
6 files changed, 39 insertions, 47 deletions
@@ -136,7 +136,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info, if (bfd_debug) zlog_debug( "%s: Suppressing BFD peer reg/dereg messages", - __FUNCTION__); + __func__); return; } @@ -146,7 +146,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info, zlog_debug( "%s: Can't send BFD peer register, Zebra client not " "established", - __FUNCTION__); + __func__); return; } @@ -454,7 +454,7 @@ void bfd_client_sendmsg(struct zclient *zclient, int command, zlog_debug( "%s: Can't send BFD client register, Zebra client not " "established", - __FUNCTION__); + __func__); return; } diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c index 54f027deeb..b66ae221cf 100644 --- a/lib/ptm_lib.c +++ b/lib/ptm_lib.c @@ -143,7 +143,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key, csv_record_t *mh_rec, *rec; if (!p_ctxt) { - ERRLOG("%s: no context \n", __FUNCTION__); + ERRLOG("%s: no context \n", __func__); return -1; } @@ -154,7 +154,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key, /* append to the hdr record */ rec = csv_append_record(csv, rec, 1, key); if (!rec) { - ERRLOG("%s: Could not append key \n", __FUNCTION__); + ERRLOG("%s: Could not append key \n", __func__); return -1; } @@ -162,7 +162,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key, /* append to the data record */ rec = csv_append_record(csv, rec, 1, val); if (!rec) { - ERRLOG("%s: Could not append val \n", __FUNCTION__); + ERRLOG("%s: Could not append val \n", __func__); return -1; } @@ -186,7 +186,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt, csv = csv_init(NULL, NULL, PTMLIB_MSG_SZ); if (!csv) { - ERRLOG("%s: Could not allocate csv \n", __FUNCTION__); + ERRLOG("%s: Could not allocate csv \n", __func__); return -1; } @@ -194,7 +194,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt, cmd_id, hdl->client_name); if (!rec) { - ERRLOG("%s: Could not allocate record \n", __FUNCTION__); + ERRLOG("%s: Could not allocate record \n", __func__); csv_clean(csv); csv_free(csv); return -1; @@ -202,7 +202,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt, p_ctxt = calloc(1, sizeof(*p_ctxt)); if (!p_ctxt) { - ERRLOG("%s: Could not allocate context \n", __FUNCTION__); + ERRLOG("%s: Could not allocate context \n", __func__); csv_clean(csv); csv_free(csv); return -1; @@ -234,7 +234,7 @@ int ptm_lib_cleanup_msg(ptm_lib_handle_t *hdl, void *ctxt) csv_t *csv; if (!p_ctxt) { - ERRLOG("%s: no context \n", __FUNCTION__); + ERRLOG("%s: no context \n", __func__); return -1; } @@ -254,7 +254,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len) csv_record_t *rec; if (!p_ctxt) { - ERRLOG("%s: no context \n", __FUNCTION__); + ERRLOG("%s: no context \n", __func__); return -1; } @@ -268,7 +268,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len) /* parse csv contents into string */ if (buf && len) { if (csv_serialize(csv, buf, *len)) { - ERRLOG("%s: cannot serialize\n", __FUNCTION__); + ERRLOG("%s: cannot serialize\n", __func__); return -1; } *len = csvlen(csv); @@ -425,8 +425,7 @@ int ptm_lib_process_msg(ptm_lib_handle_t *hdl, int fd, char *inbuf, int inlen, csv_decode(csv, inbuf); p_ctxt = calloc(1, sizeof(*p_ctxt)); if (!p_ctxt) { - ERRLOG("%s: Could not allocate context \n", - __FUNCTION__); + ERRLOG("%s: Could not allocate context \n", __func__); csv_clean(csv); csv_free(csv); return -1; diff --git a/lib/routemap.c b/lib/routemap.c index f3860924dd..e2baa36f24 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2684,8 +2684,7 @@ static void route_map_print_dependency(struct hash_bucket *bucket, void *data) char *rmap_name = dep_data->rname; char *dep_name = data; - zlog_debug("%s: Dependency for %s: %s", __FUNCTION__, dep_name, - rmap_name); + zlog_debug("%s: Dependency for %s: %s", __func__, dep_name, rmap_name); } static int route_map_dep_update(struct hash *dephash, const char *dep_name, @@ -493,8 +493,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *), /* initialise NS, in case VRF backend if NETNS */ ns_init(); if (debug_vrf) - zlog_debug("%s: Initializing VRF subsystem", - __PRETTY_FUNCTION__); + zlog_debug("%s: Initializing VRF subsystem", __func__); vrf_master.vrf_new_hook = create; vrf_master.vrf_enable_hook = enable; @@ -535,8 +534,7 @@ void vrf_terminate(void) struct vrf *vrf; if (debug_vrf) - zlog_debug("%s: Shutting down vrf subsystem", - __PRETTY_FUNCTION__); + zlog_debug("%s: Shutting down vrf subsystem", __func__); while (!RB_EMPTY(vrf_id_head, &vrfs_by_id)) { vrf = RB_ROOT(vrf_id_head, &vrfs_by_id); diff --git a/lib/wheel.c b/lib/wheel.c index 8e479c931b..214e5e8167 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -146,8 +146,8 @@ int wheel_add_item(struct timer_wheel *wheel, void *item) slot = (*wheel->slot_key)(item); if (debug_timer_wheel) - zlog_debug("%s: Inserting %p: %lld %lld", __PRETTY_FUNCTION__, - item, slot, slot % wheel->slots); + zlog_debug("%s: Inserting %p: %lld %lld", __func__, item, slot, + slot % wheel->slots); listnode_add(wheel->wheel_slot_lists[slot % wheel->slots], item); return 0; @@ -160,8 +160,8 @@ int wheel_remove_item(struct timer_wheel *wheel, void *item) slot = (*wheel->slot_key)(item); if (debug_timer_wheel) - zlog_debug("%s: Removing %p: %lld %lld", __PRETTY_FUNCTION__, - item, slot, slot % wheel->slots); + zlog_debug("%s: Removing %p: %lld %lld", __func__, item, slot, + slot % wheel->slots); listnode_delete(wheel->wheel_slot_lists[slot % wheel->slots], item); return 0; diff --git a/lib/zclient.c b/lib/zclient.c index b0d2ea43a2..ec193035f5 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -236,9 +236,8 @@ int zclient_socket_connect(struct zclient *zclient) ret = connect(sock, (struct sockaddr *)&zclient_addr, zclient_addr_len); if (ret < 0) { if (zclient_debug) - zlog_debug("%s connect failure: %d(%s)", - __PRETTY_FUNCTION__, errno, - safe_strerror(errno)); + zlog_debug("%s connect failure: %d(%s)", __func__, + errno, safe_strerror(errno)); close(sock); return -1; } @@ -958,7 +957,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api) if (api->type >= ZEBRA_ROUTE_MAX) { flog_err(EC_LIB_ZAPI_ENCODE, "%s: Specified route type (%u) is not a legal value\n", - __PRETTY_FUNCTION__, api->type); + __func__, api->type); return -1; } stream_putc(s, api->type); @@ -970,7 +969,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api) if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) { flog_err(EC_LIB_ZAPI_ENCODE, "%s: Specified route SAFI (%u) is not a legal value\n", - __PRETTY_FUNCTION__, api->safi); + __func__, api->safi); return -1; } stream_putc(s, api->safi); @@ -1122,7 +1121,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) if (api->type >= ZEBRA_ROUTE_MAX) { flog_err(EC_LIB_ZAPI_ENCODE, "%s: Specified route type: %d is not a legal value\n", - __PRETTY_FUNCTION__, api->type); + __func__, api->type); return -1; } @@ -1133,7 +1132,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) { flog_err(EC_LIB_ZAPI_ENCODE, "%s: Specified route SAFI (%u) is not a legal value\n", - __PRETTY_FUNCTION__, api->safi); + __func__, api->safi); return -1; } @@ -1146,7 +1145,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) flog_err( EC_LIB_ZAPI_ENCODE, "%s: V4 prefixlen is %d which should not be more than 32", - __PRETTY_FUNCTION__, api->prefix.prefixlen); + __func__, api->prefix.prefixlen); return -1; } break; @@ -1155,14 +1154,14 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) flog_err( EC_LIB_ZAPI_ENCODE, "%s: v6 prefixlen is %d which should not be more than 128", - __PRETTY_FUNCTION__, api->prefix.prefixlen); + __func__, api->prefix.prefixlen); return -1; } break; default: flog_err(EC_LIB_ZAPI_ENCODE, - "%s: Specified family %d is not v4 or v6", - __PRETTY_FUNCTION__, api->prefix.family); + "%s: Specified family %d is not v4 or v6", __func__, + api->prefix.family); return -1; } STREAM_GET(&api->prefix.u.prefix, s, PSIZE(api->prefix.prefixlen)); @@ -1174,7 +1173,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) flog_err( EC_LIB_ZAPI_ENCODE, "%s: SRC Prefix prefixlen received: %d is too large", - __PRETTY_FUNCTION__, api->src_prefix.prefixlen); + __func__, api->src_prefix.prefixlen); return -1; } STREAM_GET(&api->src_prefix.prefix, s, @@ -1185,7 +1184,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) flog_err( EC_LIB_ZAPI_ENCODE, "%s: SRC prefix specified in some manner that makes no sense", - __PRETTY_FUNCTION__); + __func__); return -1; } } @@ -1309,8 +1308,7 @@ bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno, STREAM_GETL(s, ifi); if (zclient_debug) - zlog_debug("%s: %u %u %u %u", __PRETTY_FUNCTION__, seq, prio, - uni, ifi); + zlog_debug("%s: %u %u %u %u", __func__, seq, prio, uni, ifi); *seqno = seq; *priority = prio; *unique = uni; @@ -1332,7 +1330,7 @@ bool zapi_ipset_notify_decode(struct stream *s, uint32_t *unique, STREAM_GETL(s, uni); if (zclient_debug) - zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); + zlog_debug("%s: %u", __func__, uni); *unique = uni; return true; @@ -1354,7 +1352,7 @@ bool zapi_ipset_entry_notify_decode(struct stream *s, uint32_t *unique, STREAM_GET(ipset_name, s, ZEBRA_IPSET_NAME_SIZE); if (zclient_debug) - zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); + zlog_debug("%s: %u", __func__, uni); *unique = uni; return true; @@ -1374,7 +1372,7 @@ bool zapi_iptable_notify_decode(struct stream *s, STREAM_GETL(s, uni); if (zclient_debug) - zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); + zlog_debug("%s: %u", __func__, uni); *unique = uni; return true; @@ -2664,8 +2662,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl) if (zl->route.prefix.prefixlen > IPV4_MAX_BITLEN) { zlog_debug( "%s: Specified prefix length %d is greater than a v4 address can support", - __PRETTY_FUNCTION__, - zl->route.prefix.prefixlen); + __func__, zl->route.prefix.prefixlen); return -1; } STREAM_GET(&zl->route.prefix.u.prefix4.s_addr, s, @@ -2675,8 +2672,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl) if (zl->route.prefix.prefixlen > IPV6_MAX_BITLEN) { zlog_debug( "%s: Specified prefix length %d is greater than a v6 address can support", - __PRETTY_FUNCTION__, - zl->route.prefix.prefixlen); + __func__, zl->route.prefix.prefixlen); return -1; } STREAM_GET(&zl->route.prefix.u.prefix6, s, psize); @@ -2684,7 +2680,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl) default: flog_err(EC_LIB_ZAPI_ENCODE, "%s: Specified family %u is not v4 or v6", - __PRETTY_FUNCTION__, zl->route.prefix.family); + __func__, zl->route.prefix.family); return -1; } |
