summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-01-18 11:37:56 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2022-02-16 16:40:56 +0100
commit5a46a3dea93fe645b4ce0f992e740081cde10dfa (patch)
tree7f0f28082588b968a412d8d09cc13ea7491c1542
parentpim6d: IPv6-adjust BSM code (diff)
downloadfrr-5a46a3dea93fe645b4ce0f992e740081cde10dfa.tar.xz
frr-5a46a3dea93fe645b4ce0f992e740081cde10dfa.zip
pim6d: drop off IGMP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--pimd/pim_cmd.c7
-rw-r--r--pimd/pim_iface.c16
-rw-r--r--pimd/pim_igmp.h27
-rw-r--r--pimd/pim_igmp_join.h6
-rw-r--r--pimd/pim_igmp_stats.h10
-rw-r--r--pimd/pim_igmpv3.h13
-rw-r--r--pimd/pim_vty.c2
-rw-r--r--pimd/pim_zebra.c2
-rw-r--r--pimd/subdir.am10
9 files changed, 83 insertions, 10 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index da5fdfa51..bf65e943f 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -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;
}
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 1cdc46df6..cf5037171 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -50,10 +50,12 @@
#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
diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h
index b82b62ea7..5c3599663 100644
--- a/pimd/pim_igmp.h
+++ b/pimd/pim_igmp.h
@@ -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 */
diff --git a/pimd/pim_igmp_join.h b/pimd/pim_igmp_join.h
index c32390276..8027b8b94 100644
--- a/pimd/pim_igmp_join.h
+++ b/pimd/pim_igmp_join.h
@@ -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;
diff --git a/pimd/pim_igmp_stats.h b/pimd/pim_igmp_stats.h
index 57b5cc62f..a70a43355 100644
--- a/pimd/pim_igmp_stats.h
+++ b/pimd/pim_igmp_stats.h
@@ -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 */
diff --git a/pimd/pim_igmpv3.h b/pimd/pim_igmpv3.h
index 7449e420e..5041e54cb 100644
--- a/pimd/pim_igmpv3.h
+++ b/pimd/pim_igmpv3.h
@@ -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 */
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index 8130aac87..b452b024e 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -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");
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index e2b17e003..422c61202 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -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)
{
diff --git a/pimd/subdir.am b/pimd/subdir.am
index 6c267f290..de5954085 100644
--- a/pimd/subdir.am
+++ b/pimd/subdir.am
@@ -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 \