pim6d: drop off IGMP code

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2022-01-18 11:37:56 +01:00
parent 809c11a9d8
commit 5a46a3dea9
9 changed files with 83 additions and 10 deletions

View 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;
}

View file

@ -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

View 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 */

View 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;

View 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 */

View 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 */

View 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");

View 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)
{

View 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 \