]> git.puffer.fish Git - mirror/frr.git/commitdiff
pim6d: drop off IGMP code
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 18 Jan 2022 10:37:56 +0000 (11:37 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 16 Feb 2022 15:40:56 +0000 (16:40 +0100)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
pimd/pim_cmd.c
pimd/pim_iface.c
pimd/pim_igmp.h
pimd/pim_igmp_join.h
pimd/pim_igmp_stats.h
pimd/pim_igmpv3.h
pimd/pim_vty.c
pimd/pim_zebra.c
pimd/subdir.am

index da5fdfa51e11fe0100604611116b3d550f8dba4b..bf65e943fc6fd798872c66ebe5ab50e28bb7d10d 100644 (file)
@@ -3901,7 +3901,6 @@ static void clear_mroute(struct pim_instance *pim)
        /* scan interfaces */
        FOR_ALL_INTERFACES (pim->vrf, ifp) {
                struct pim_interface *pim_ifp = ifp->info;
-               struct gm_group *grp;
                struct pim_ifchannel *ch;
 
                if (!pim_ifp)
@@ -3914,7 +3913,9 @@ static void clear_mroute(struct pim_instance *pim)
                        pim_ifchannel_delete(ch);
                }
 
+#if PIM_IPV == 4
                /* clean up all igmp groups */
+               struct gm_group *grp;
 
                if (pim_ifp->gm_group_list) {
                        while (pim_ifp->gm_group_list->count) {
@@ -3922,6 +3923,7 @@ static void clear_mroute(struct pim_instance *pim)
                                igmp_group_delete(grp);
                        }
                }
+#endif
        }
 
        /* clean up all upstreams*/
@@ -8236,6 +8238,7 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate,
              "IGMP version\n"
              "IGMP version number\n")
 {
+#if PIM_IPV == 4
        VTY_DECLVAR_CONTEXT(interface, ifp);
        int igmp_version = 2;
 
@@ -8249,7 +8252,7 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate,
                igmp_version = atoi(argv[4]->arg);
 
        igmp_send_query_on_intf(ifp, igmp_version);
-
+#endif
        return CMD_SUCCESS;
 }
 
index 1cdc46df6aebab5b978e397d3801a4e7daf53fb1..cf503717120f3b9ef910afc6a5a4fbc530598502 100644 (file)
 #include "pim_igmp_join.h"
 #include "pim_vxlan.h"
 
+#if PIM_IPV == 4
 static void pim_if_igmp_join_del_all(struct interface *ifp);
 static int igmp_join_sock(const char *ifname, ifindex_t ifindex,
                          struct in_addr group_addr,
                          struct in_addr source_addr);
+#endif
 
 void pim_if_init(struct pim_instance *pim)
 {
@@ -1148,6 +1150,7 @@ long pim_if_t_suppressed_msec(struct interface *ifp)
        return t_suppressed_msec;
 }
 
+#if PIM_IPV == 4
 static void igmp_join_free(struct gm_join *ij)
 {
        XFREE(MTYPE_PIM_IGMP_JOIN, ij);
@@ -1358,6 +1361,19 @@ static void pim_if_igmp_join_del_all(struct interface *ifp)
        for (ALL_LIST_ELEMENTS(pim_ifp->gm_join_list, node, nextnode, ij))
                pim_if_igmp_join_del(ifp, ij->group_addr, ij->source_addr);
 }
+#else /* PIM_IPV != 4 */
+ferr_r pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,
+                           struct in_addr source_addr)
+{
+       return ferr_ok();
+}
+
+int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,
+                        struct in_addr source_addr)
+{
+       return 0;
+}
+#endif /* PIM_IPV != 4 */
 
 /*
   RFC 4601
index b82b62ea74cff6d20ddc317f03561d644ddc9f70..5c359966349f1e8a8c4643437cc59d28a9611e3e 100644 (file)
@@ -105,6 +105,7 @@ struct gm_sock {
 
 struct pim_interface;
 
+#if PIM_IPV == 4
 void pim_igmp_if_init(struct pim_interface *pim_ifp, struct interface *ifp);
 void pim_igmp_if_reset(struct pim_interface *pim_ifp);
 void pim_igmp_if_fini(struct pim_interface *pim_ifp);
@@ -126,6 +127,24 @@ void pim_igmp_other_querier_timer_off(struct gm_sock *igmp);
 
 int igmp_validate_checksum(char *igmp_msg, int igmp_msg_len);
 
+#else /* PIM_IPV != 4 */
+static inline void pim_igmp_general_query_on(struct gm_sock *igmp)
+{
+}
+
+static inline void pim_igmp_general_query_off(struct gm_sock *igmp)
+{
+}
+
+static inline void pim_igmp_other_querier_timer_on(struct gm_sock *igmp)
+{
+}
+
+static inline void pim_igmp_other_querier_timer_off(struct gm_sock *igmp)
+{
+}
+#endif /* PIM_IPV == 4 */
+
 #define IGMP_SOURCE_MASK_FORWARDING        (1 << 0)
 #define IGMP_SOURCE_MASK_DELETE            (1 << 1)
 #define IGMP_SOURCE_MASK_SEND              (1 << 2)
@@ -184,6 +203,7 @@ struct gm_group {
        int64_t last_igmp_v2_report_dsec;
 };
 
+#if PIM_IPV == 4
 struct gm_group *find_group_by_addr(struct gm_sock *igmp,
                                    struct in_addr group_addr);
 struct gm_group *igmp_add_group_by_addr(struct gm_sock *igmp,
@@ -210,4 +230,11 @@ void igmp_send_query(int igmp_version, struct gm_group *group, int fd,
 void igmp_group_delete(struct gm_group *group);
 
 void igmp_send_query_on_intf(struct interface *ifp, int igmp_ver);
+
+#else /* PIM_IPV != 4 */
+static inline void igmp_startup_mode_on(struct gm_sock *igmp)
+{
+}
+#endif /* PIM_IPV != 4 */
+
 #endif /* PIM_IGMP_H */
index c3239027647cc3a0ebe8e90007a28b0444fe73e5..8027b8b94b721f04f3e587d5e521af42e6860377 100644 (file)
@@ -39,9 +39,9 @@ struct group_source_req {
 };
 #endif
 
-static int pim_igmp_join_source(int fd, ifindex_t ifindex,
-                               struct in_addr group_addr,
-                               struct in_addr source_addr)
+static inline int pim_igmp_join_source(int fd, ifindex_t ifindex,
+                                      struct in_addr group_addr,
+                                      struct in_addr source_addr)
 {
        struct group_source_req req;
        struct sockaddr_in group;
index 57b5cc62f4b7d72583feb9dbf9683f8593419cb2..a70a4335579e5f2e8901aee5eca4408f8ab29ecf 100644 (file)
@@ -35,7 +35,17 @@ struct igmp_stats {
        uint32_t        unsupported;
 };
 
+#if PIM_IPV == 4
 void igmp_stats_init(struct igmp_stats *stats);
 void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b);
+#else
+static inline void igmp_stats_init(struct igmp_stats *stats)
+{
+}
+
+static inline void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b)
+{
+}
+#endif
 
 #endif /* PIM_IGMP_STATS_H */
index 7449e420e42154c1b36de1c57f33d6f8934f69ec..5041e54cb495e912b22faeda0e57ea668247d7fc 100644 (file)
@@ -53,6 +53,7 @@
 /* OHPI: Older Host Present Interval */
 #define PIM_IGMP_OHPI_DSEC(qrv,qqi,qri_dsec) ((qrv) * (10 * (qqi)) + (qri_dsec))
 
+#if PIM_IPV == 4
 void igmp_group_reset_gmi(struct gm_group *group);
 void igmp_source_reset_gmi(struct gm_group *group, struct gm_source *source);
 
@@ -98,4 +99,16 @@ void igmp_v3_recv_query(struct gm_sock *igmp, const char *from_str,
 int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
                        const char *from_str, char *igmp_msg, int igmp_msg_len);
 
+#else /* PIM_IPV != 4 */
+static inline void igmp_group_reset_gmi(struct gm_group *group)
+{
+}
+
+
+static inline void igmp_source_reset_gmi(struct gm_group *group,
+                                        struct gm_source *source)
+{
+}
+#endif
+
 #endif /* PIM_IGMPV3_H */
index 8130aac87209b796d49c1d18a0bff19f7551eaca..b452b024edada24493b7e444829c3ebc0a59c6b1 100644 (file)
@@ -397,6 +397,7 @@ int pim_interface_config_write(struct vty *vty)
                                        ++writes;
                                }
 
+#if PIM_IPV == 4
                                /* IF ip igmp join */
                                if (pim_ifp->gm_join_list) {
                                        struct listnode *node;
@@ -428,6 +429,7 @@ int pim_interface_config_write(struct vty *vty)
                                                ++writes;
                                        }
                                }
+#endif /* PIM_IPV == 4 */
 
                                if (pim_ifp->activeactive)
                                        vty_out(vty, " ip pim active-active\n");
index e2b17e00366230fd2a13c7b0d591addc806b1fbc..422c612029c2a9ef450deafb1a18f2b34b566374 100644 (file)
@@ -468,6 +468,7 @@ void pim_zebra_init(void)
        zclient_lookup_new();
 }
 
+#if PIM_IPV == 4
 void igmp_anysource_forward_start(struct pim_instance *pim,
                                  struct gm_group *group)
 {
@@ -794,6 +795,7 @@ void igmp_source_forward_stop(struct gm_source *source)
 
        IGMP_SOURCE_DONT_FORWARDING(source->source_flags);
 }
+#endif /* PIM_IPV == 4 */
 
 void pim_forward_start(struct pim_ifchannel *ch)
 {
index 6c267f290cedd7110aefa1fa989873e4f4d42585..de5954085b6152740b71e0c95803942ed7177022 100644 (file)
@@ -23,11 +23,6 @@ pim_common = \
        pimd/pim_hello.c \
        pimd/pim_iface.c \
        pimd/pim_ifchannel.c \
-       pimd/pim_igmp.c \
-       pimd/pim_igmp_mtrace.c \
-       pimd/pim_igmp_stats.c \
-       pimd/pim_igmpv2.c \
-       pimd/pim_igmpv3.c \
        pimd/pim_instance.c \
        pimd/pim_int.c \
        pimd/pim_join.c \
@@ -66,6 +61,11 @@ pim_common = \
 
 pimd_pimd_SOURCES = \
        $(pim_common) \
+       pimd/pim_igmp.c \
+       pimd/pim_igmp_mtrace.c \
+       pimd/pim_igmp_stats.c \
+       pimd/pim_igmpv2.c \
+       pimd/pim_igmpv3.c \
        pimd/pim_main.c \
        pimd/pim_msdp.c \
        pimd/pim_msdp_packet.c \