summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-05 20:17:54 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-05 20:23:23 +0200
commit15569c58f8001d37bccaed7f99b6987315125036 (patch)
treeb81f9925182682ee2ad7fd969eb1de6f0072ccf8 /pimd/pim_upstream.c
parent38e385615ac3355f09e3f8df99a25a1c30af249a (diff)
*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r--pimd/pim_upstream.c130
1 files changed, 61 insertions, 69 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 940b5a33ce..ef65f097ad 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -76,8 +76,7 @@ static void pim_upstream_remove_children(struct pim_instance *pim,
listnode_delete(up->sources, child);
if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(child->flags)) {
PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(child->flags);
- child = pim_upstream_del(pim, child,
- __PRETTY_FUNCTION__);
+ child = pim_upstream_del(pim, child, __func__);
}
if (child) {
child->parent = NULL;
@@ -272,8 +271,8 @@ void pim_upstream_send_join(struct pim_upstream *up)
{
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
return;
}
@@ -281,13 +280,13 @@ void pim_upstream_send_join(struct pim_upstream *up)
char rpf_str[PREFIX_STRLEN];
pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_str,
sizeof(rpf_str));
- zlog_debug("%s: RPF'%s=%s(%s) for Interface %s",
- __PRETTY_FUNCTION__, up->sg_str, rpf_str,
+ zlog_debug("%s: RPF'%s=%s(%s) for Interface %s", __func__,
+ up->sg_str, rpf_str,
pim_upstream_state2str(up->join_state),
up->rpf.source_nexthop.interface->name);
if (pim_rpf_addr_is_inaddr_any(&up->rpf)) {
zlog_debug("%s: can't send join upstream: RPF'%s=%s",
- __PRETTY_FUNCTION__, up->sg_str, rpf_str);
+ __func__, up->sg_str, rpf_str);
/* warning only */
}
}
@@ -304,8 +303,8 @@ static int on_join_timer(struct thread *t)
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
return 0;
}
@@ -355,8 +354,7 @@ void join_timer_start(struct pim_upstream *up)
if (PIM_DEBUG_PIM_EVENTS) {
zlog_debug(
"%s: starting %d sec timer for upstream (S,G)=%s",
- __PRETTY_FUNCTION__, router->t_periodic,
- up->sg_str);
+ __func__, router->t_periodic, up->sg_str);
}
}
@@ -389,7 +387,7 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up,
{
if (PIM_DEBUG_PIM_EVENTS) {
zlog_debug("%s: restarting %d msec timer for upstream (S,G)=%s",
- __PRETTY_FUNCTION__, interval_msec, up->sg_str);
+ __func__, interval_msec, up->sg_str);
}
THREAD_OFF(up->t_join_timer);
@@ -405,8 +403,8 @@ void pim_upstream_join_suppress(struct pim_upstream *up,
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
return;
}
@@ -421,7 +419,7 @@ void pim_upstream_join_suppress(struct pim_upstream *up,
pim_inet4_dump("<rpf?>", rpf_addr, rpf_str, sizeof(rpf_str));
zlog_debug(
"%s %s: detected Join%s to RPF'(S,G)=%s: join_timer=%ld msec t_joinsuppress=%ld msec",
- __FILE__, __PRETTY_FUNCTION__, up->sg_str, rpf_str,
+ __FILE__, __func__, up->sg_str, rpf_str,
join_timer_remain_msec, t_joinsuppress_msec);
}
@@ -429,7 +427,7 @@ void pim_upstream_join_suppress(struct pim_upstream *up,
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug(
"%s %s: suppressing Join(S,G)=%s for %ld msec",
- __FILE__, __PRETTY_FUNCTION__, up->sg_str,
+ __FILE__, __func__, up->sg_str,
t_joinsuppress_msec);
}
@@ -445,8 +443,8 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label,
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
return;
}
@@ -518,8 +516,8 @@ static int pim_upstream_could_register(struct pim_upstream *up)
pim_ifp = up->rpf.source_nexthop.interface->info;
else {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
}
if (pim_ifp && PIM_I_am_DR(pim_ifp)
@@ -655,21 +653,21 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
if (up->upstream_addr.s_addr == INADDR_ANY) {
if (PIM_DEBUG_PIM_EVENTS)
- zlog_debug("%s: RPF not configured for %s",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: RPF not configured for %s", __func__,
+ up->sg_str);
return;
}
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_EVENTS)
- zlog_debug("%s: RP not reachable for %s",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: RP not reachable for %s", __func__,
+ up->sg_str);
return;
}
if (PIM_DEBUG_PIM_EVENTS) {
zlog_debug("%s: PIM_UPSTREAM_%s: (S,G) old: %s new: %s",
- __PRETTY_FUNCTION__, up->sg_str,
+ __func__, up->sg_str,
pim_upstream_state2str(up->join_state),
pim_upstream_state2str(new_state));
}
@@ -816,7 +814,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
sg->grp)) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: Received a (*,G) with no RP configured",
- __PRETTY_FUNCTION__);
+ __func__);
}
up->parent = pim_upstream_find_parent(pim, up);
@@ -837,8 +835,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
up->join_state = PIM_UPSTREAM_NOTJOINED;
up->reg_state = PIM_REG_NOINFO;
up->state_transition = pim_time_monotonic_sec();
- up->channel_oil =
- pim_channel_oil_add(pim, &up->sg, __PRETTY_FUNCTION__);
+ up->channel_oil = pim_channel_oil_add(pim, &up->sg, __func__);
up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;
up->rpf.source_nexthop.interface = NULL;
@@ -878,7 +875,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Attempting to create upstream(%s), Unable to RPF for source",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
}
if (up->rpf.source_nexthop.interface) {
@@ -910,8 +907,8 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug(
"%s: Created Upstream %s upstream_addr %s ref count %d increment",
- __PRETTY_FUNCTION__, up->sg_str,
- inet_ntoa(up->upstream_addr), up->ref_count);
+ __func__, up->sg_str, inet_ntoa(up->upstream_addr),
+ up->ref_count);
}
return up;
@@ -995,8 +992,7 @@ void pim_upstream_ref(struct pim_upstream *up, int flags, const char *name)
++up->ref_count;
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s(%s): upstream %s ref count %d increment",
- __PRETTY_FUNCTION__, name, up->sg_str,
- up->ref_count);
+ __func__, name, up->sg_str, up->ref_count);
}
struct pim_upstream *pim_upstream_add(struct pim_instance *pim,
@@ -1021,14 +1017,13 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim,
char buf[PREFIX2STR_BUFFER];
prefix2str(&up->rpf.rpf_addr, buf, sizeof(buf));
zlog_debug("%s(%s): %s, iif %s (%s) found: %d: ref_count: %d",
- __PRETTY_FUNCTION__, name,
+ __func__, name,
up->sg_str, buf, up->rpf.source_nexthop.interface ?
up->rpf.source_nexthop.interface->name : "Unknown" ,
found, up->ref_count);
} else
- zlog_debug("%s(%s): (%s) failure to create",
- __PRETTY_FUNCTION__, name,
- pim_str_sg_dump(sg));
+ zlog_debug("%s(%s): (%s) failure to create", __func__,
+ name, pim_str_sg_dump(sg));
}
return up;
@@ -1232,8 +1227,7 @@ void pim_upstream_rpf_genid_changed(struct pim_instance *pim,
sizeof(rpf_addr_str));
zlog_debug(
"%s: matching neigh=%s against upstream (S,G)=%s[%s] joined=%d rpf_addr=%s",
- __PRETTY_FUNCTION__, neigh_str, up->sg_str,
- pim->vrf->name,
+ __func__, neigh_str, up->sg_str, pim->vrf->name,
up->join_state == PIM_UPSTREAM_JOINED,
rpf_addr_str);
}
@@ -1409,13 +1403,13 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(
PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);
/* Return if upstream entry got deleted.*/
- if (!pim_upstream_del(pim, up, __PRETTY_FUNCTION__))
+ if (!pim_upstream_del(pim, up, __func__))
return NULL;
}
if (PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(up->flags)) {
PIM_UPSTREAM_FLAG_UNSET_SRC_NOCACHE(up->flags);
- if (!pim_upstream_del(pim, up, __PRETTY_FUNCTION__))
+ if (!pim_upstream_del(pim, up, __func__))
return NULL;
}
@@ -1427,7 +1421,7 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(
struct pim_upstream *parent = up->parent;
PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(up->flags);
- up = pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
+ up = pim_upstream_del(pim, up, __func__);
if (parent) {
pim_jp_agg_single_upstream_send(&parent->rpf, parent,
@@ -1559,7 +1553,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Incoming Interface: %s is different than RPF_interface(S) %s",
- __PRETTY_FUNCTION__, incoming->name,
+ __func__, incoming->name,
up->rpf.source_nexthop.interface->name);
return;
}
@@ -1567,8 +1561,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
// AND JoinDesired(S,G) == true
if (!pim_upstream_evaluate_join_desired(up->channel_oil->pim, up)) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: %s Join is not Desired",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: %s Join is not Desired", __func__,
+ up->sg_str);
return;
}
@@ -1577,7 +1571,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
up->sg.src)) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: %s is directly connected to the source",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
return;
}
@@ -1591,7 +1585,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: %s RPF_interface(S) != RPF_interface(RP(G))",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
pim_jp_agg_single_upstream_send(&starup->rpf, starup, true);
@@ -1603,7 +1597,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
&& pim_upstream_empty_inherited_olist(up)) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: %s OR inherited_olist(S,G,rpt) == NULL",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
return;
}
@@ -1613,7 +1607,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
if (up->parent && pim_rpf_is_same(&up->rpf, &up->parent->rpf)) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: %s RPF'(S,G) is the same as RPF'(*,G)",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
return;
}
@@ -1665,8 +1659,9 @@ static int pim_upstream_register_stop_timer(struct thread *t)
if (PIM_DEBUG_PIM_TRACE) {
char state_str[PIM_REG_STATE_STR_LEN];
zlog_debug("%s: (S,G)=%s[%s] upstream register stop timer %s",
- __PRETTY_FUNCTION__, up->sg_str, pim->vrf->name,
- pim_reg_state2str(up->reg_state, state_str, sizeof(state_str)));
+ __func__, up->sg_str, pim->vrf->name,
+ pim_reg_state2str(up->reg_state, state_str,
+ sizeof(state_str)));
}
switch (up->reg_state) {
@@ -1683,7 +1678,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)
if (!up->rpf.source_nexthop.interface) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
return 0;
}
@@ -1692,7 +1687,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Interface: %s is not configured for pim",
- __PRETTY_FUNCTION__,
+ __func__,
up->rpf.source_nexthop.interface->name);
return 0;
}
@@ -1705,7 +1700,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Stop sending the register, because I am the RP and we haven't seen a packet in a while",
- __PRETTY_FUNCTION__);
+ __func__);
return 0;
}
pim_null_register_send(up);
@@ -1735,7 +1730,7 @@ void pim_upstream_start_register_stop_timer(struct pim_upstream *up,
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug(
"%s: (S,G)=%s Starting upstream register stop timer %d",
- __PRETTY_FUNCTION__, up->sg_str, time);
+ __func__, up->sg_str, time);
}
thread_add_timer(router->master, pim_upstream_register_stop_timer, up,
time, &up->t_rs_timer);
@@ -1751,8 +1746,8 @@ int pim_upstream_inherited_olist_decide(struct pim_instance *pim,
if (!up->rpf.source_nexthop.interface)
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug("%s: up %s RPF is not present", __func__,
+ up->sg_str);
FOR_ALL_INTERFACES (pim->vrf, ifp) {
if (!ifp->info)
@@ -1843,8 +1838,8 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)
if (up->upstream_addr.s_addr == INADDR_ANY) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
- "%s: RP not configured for Upstream %s",
- __PRETTY_FUNCTION__, up->sg_str);
+ "%s: RP not configured for Upstream %s",
+ __func__, up->sg_str);
continue;
}
@@ -1852,7 +1847,7 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Upstream %s without a path to send join, checking",
- __PRETTY_FUNCTION__, up->sg_str);
+ __func__, up->sg_str);
old.source_nexthop.interface =
up->rpf.source_nexthop.interface;
rpf_result = pim_rpf_update(pim, up, &old, __func__);
@@ -1880,7 +1875,7 @@ void pim_upstream_terminate(struct pim_instance *pim)
struct pim_upstream *up;
while ((up = rb_pim_upstream_first(&pim->upstream_head))) {
- pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
+ pim_upstream_del(pim, up, __func__);
}
rb_pim_upstream_fini(&pim->upstream_head);
@@ -1960,8 +1955,7 @@ static void pim_upstream_sg_running(void *arg)
if (!up->channel_oil->installed) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: %s%s is not installed in mroute",
- __PRETTY_FUNCTION__, up->sg_str,
- pim->vrf->name);
+ __func__, up->sg_str, pim->vrf->name);
return;
}
@@ -1977,8 +1971,7 @@ static void pim_upstream_sg_running(void *arg)
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: Handling unscanned inherited_olist for %s[%s]",
- __PRETTY_FUNCTION__, up->sg_str,
- pim->vrf->name);
+ __func__, up->sg_str, pim->vrf->name);
pim_upstream_inherited_olist_decide(pim, up);
up->channel_oil->oil_inherited_rescan = 0;
}
@@ -1990,7 +1983,7 @@ static void pim_upstream_sg_running(void *arg)
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug(
"%s[%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)",
- __PRETTY_FUNCTION__, up->sg_str, pim->vrf->name,
+ __func__, up->sg_str, pim->vrf->name,
up->channel_oil->cc.oldpktcnt,
up->channel_oil->cc.pktcnt,
up->channel_oil->cc.lastused / 100);
@@ -2007,9 +2000,8 @@ static void pim_upstream_sg_running(void *arg)
"source reference created on kat restart %s[%s]",
up->sg_str, pim->vrf->name);
- pim_upstream_ref(up,
- PIM_UPSTREAM_FLAG_MASK_SRC_STREAM,
- __PRETTY_FUNCTION__);
+ pim_upstream_ref(up, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM,
+ __func__);
PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
pim_upstream_fhr_kat_start(up);
}