pimd: move %pSG4 to %pPSG4

Since this is only used in very few places, moving it out of the way is
reasonable.  (`%pSG` will be pim_sgaddr)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2022-01-04 16:50:53 +01:00
parent 10fe382b13
commit d51f8b0f1e
8 changed files with 20 additions and 19 deletions

View File

@ -153,11 +153,11 @@ Networking data types
- :c:struct:`prefix_ls`
- :c:struct:`prefix_rd`
- :c:struct:`prefix_ptr`
- :c:struct:`prefix_sg` (use :frrfmt:`%pSG4`)
- :c:struct:`prefix_sg` (use :frrfmt:`%pPSG4`)
- :c:union:`prefixptr` (dereference to get :c:struct:`prefix`)
- :c:union:`prefixconstptr` (dereference to get :c:struct:`prefix`)
.. frrfmt:: %pSG4 (struct prefix_sg *)
.. frrfmt:: %pPSG4 (struct prefix_sg *)
:frrfmtout:`(*,1.2.3.4)`

View File

@ -1421,7 +1421,7 @@ static ssize_t printfrr_pfx(struct fbuf *buf, struct printfrr_eargs *ea,
return bputs(buf, cbuf);
}
printfrr_ext_autoreg_p("SG4", printfrr_psg)
printfrr_ext_autoreg_p("PSG4", printfrr_psg)
static ssize_t printfrr_psg(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr)
{

View File

@ -602,7 +602,7 @@ static inline int is_default_host_route(const struct prefix *p)
#pragma FRR printfrr_ext "%pFX" (struct prefix_evpn *)
#pragma FRR printfrr_ext "%pFX" (struct prefix_fs *)
#pragma FRR printfrr_ext "%pSG4" (struct prefix_sg *)
#pragma FRR printfrr_ext "%pPSG4" (struct prefix_sg *)
#endif
#ifdef __cplusplus

View File

@ -87,8 +87,8 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
if (!rp) {
zlog_warn("%s: Lookup of RP failed for %pSG4", __func__,
sg);
zlog_warn("%s: Lookup of RP failed for %pPSG4",
__func__, sg);
return;
}
/*
@ -160,7 +160,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
pim_inet4_dump("<received?>", sg->src, received_rp,
sizeof(received_rp));
zlog_debug("%s: Prune received with RP(%s) for %pSG4",
zlog_debug("%s: Prune received with RP(%s) for %pPSG4",
__func__, received_rp, sg);
}

View File

@ -743,11 +743,11 @@ static void pim_mlag_process_mroute_add(struct mlag_mroute_add msg)
sg.src.s_addr = ntohl(msg.source_ip);
zlog_debug(
"%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x (%pSG4) cost: %u",
"%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x (%pPSG4) cost: %u",
__func__, msg.vrf_name, msg.source_ip, msg.group_ip,
&sg, msg.cost_to_rp);
zlog_debug(
"(%pSG4)owner_id: %d, DR: %d, Dual active: %d, vrf_id: 0x%x intf_name: %s",
"(%pPSG4)owner_id: %d, DR: %d, Dual active: %d, vrf_id: 0x%x intf_name: %s",
&sg, msg.owner_id, msg.am_i_dr, msg.am_i_dual_active,
msg.vrf_id, msg.intf_name);
}
@ -772,10 +772,10 @@ static void pim_mlag_process_mroute_del(struct mlag_mroute_del msg)
sg.grp.s_addr = ntohl(msg.group_ip);
sg.src.s_addr = ntohl(msg.source_ip);
zlog_debug(
"%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x(%pSG4)",
"%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x(%pPSG4)",
__func__, msg.vrf_name, msg.source_ip, msg.group_ip,
&sg);
zlog_debug("(%pSG4)owner_id: %d, vrf_id: 0x%x intf_name: %s",
zlog_debug("(%pPSG4)owner_id: %d, vrf_id: 0x%x intf_name: %s",
&sg, msg.owner_id, msg.vrf_id, msg.intf_name);
}

View File

@ -145,7 +145,7 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
if (PIM_DEBUG_MROUTE)
zlog_debug(
"%s(%s): Existing oil for %pSG4 Ref Count: %d (Post Increment)",
"%s(%s): Existing oil for %pPSG4 Ref Count: %d (Post Increment)",
__func__, name, sg, c_oil->oil_ref_count);
return c_oil;
}
@ -178,7 +178,7 @@ struct channel_oil *pim_channel_oil_del(struct channel_oil *c_oil,
.grp = c_oil->oil.mfcc_origin};
zlog_debug(
"%s(%s): Del oil for %pSG4, Ref Count: %d (Predecrement)",
"%s(%s): Del oil for %pPSG4, Ref Count: %d (Predecrement)",
__func__, name, &sg, c_oil->oil_ref_count);
}
--c_oil->oil_ref_count;

View File

@ -415,8 +415,9 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
pim_inet4_dump("<src?>", src_addr,
src_str,
sizeof(src_str));
zlog_debug("%s: Sending register-stop to %s for %pSG4 due to prefix-list denial, dropping packet",
__func__, src_str, &sg);
zlog_debug(
"%s: Sending register-stop to %s for %pPSG4 due to prefix-list denial, dropping packet",
__func__, src_str, &sg);
}
return 0;

View File

@ -206,16 +206,16 @@ int main(int argc, char **argv)
struct prefix_sg sg;
sg.src.s_addr = INADDR_ANY;
sg.grp.s_addr = INADDR_ANY;
printchk("(*,*)", "%pSG4", &sg);
printchk("(*,*)", "%pPSG4", &sg);
inet_aton("192.168.1.2", &sg.src);
printchk("(192.168.1.2,*)", "%pSG4", &sg);
printchk("(192.168.1.2,*)", "%pPSG4", &sg);
inet_aton("224.1.2.3", &sg.grp);
printchk("(192.168.1.2,224.1.2.3)", "%pSG4", &sg);
printchk("(192.168.1.2,224.1.2.3)", "%pPSG4", &sg);
sg.src.s_addr = INADDR_ANY;
printchk("(*,224.1.2.3)", "%pSG4", &sg);
printchk("(*,224.1.2.3)", "%pPSG4", &sg);
uint8_t randhex[] = { 0x12, 0x34, 0x00, 0xca, 0xfe, 0x00, 0xaa, 0x55 };