]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: move `%pSG4` to `%pPSG4`
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 4 Jan 2022 15:50:53 +0000 (16:50 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 12 Jan 2022 17:24:07 +0000 (18:24 +0100)
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>
doc/developer/logging.rst
lib/prefix.c
lib/prefix.h
pimd/pim_join.c
pimd/pim_mlag.c
pimd/pim_oil.c
pimd/pim_register.c
tests/lib/test_printfrr.c

index eaf8625efac9dc68355fc31b8901fd6a9a0d6dfd..e6080468201eaaf3852feb642916f85d988f2d48 100644 (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)`
 
index df753fe10b812a94a11f0eb27be0ccd897581db0..d3e8a612ebd60f52b200ab8b8b575d11f7ac464d 100644 (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)
 {
index c92f5cec5a0d6d1ac7fc5a70e0ba75a1a1ed0127..f2773240d2b9fa81036bf8545a31a5b36438bf8a 100644 (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
index 4606aec6a162805002019e0b2015c618792f8321..b2e1b1a28af8591679eef31a38b4cb65a3e35aa7 100644 (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);
                }
 
index 55d6e7e0fd5d7bc2f1c2015b640ea9d49370ceba..4f1cab7d5a19b891250d8e2b161b263d05453ea4 100644 (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);
        }
 
index c6fd6c4905a574444a2393f16676e1c553b09169..83424c1b6938e3054830616ce4c3ad34c4dc71c9 100644 (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;
index cc0dace7c2e5d06401e735609a03550cda0cf8bf..57449f816bc174ac0f5535468b6c7b3b9337e54a 100644 (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;
index 8413b7b372a6bd10890011ae299640ceb48092a4..76940775740b978f6971fce3758103ea855a000d 100644 (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 };