forked from Mirror/frr
pim6d: drop off IGMP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
809c11a9d8
commit
5a46a3dea9
|
@ -3901,7 +3901,6 @@ static void clear_mroute(struct pim_instance *pim)
|
||||||
/* scan interfaces */
|
/* scan interfaces */
|
||||||
FOR_ALL_INTERFACES (pim->vrf, ifp) {
|
FOR_ALL_INTERFACES (pim->vrf, ifp) {
|
||||||
struct pim_interface *pim_ifp = ifp->info;
|
struct pim_interface *pim_ifp = ifp->info;
|
||||||
struct gm_group *grp;
|
|
||||||
struct pim_ifchannel *ch;
|
struct pim_ifchannel *ch;
|
||||||
|
|
||||||
if (!pim_ifp)
|
if (!pim_ifp)
|
||||||
|
@ -3914,7 +3913,9 @@ static void clear_mroute(struct pim_instance *pim)
|
||||||
pim_ifchannel_delete(ch);
|
pim_ifchannel_delete(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
/* clean up all igmp groups */
|
/* clean up all igmp groups */
|
||||||
|
struct gm_group *grp;
|
||||||
|
|
||||||
if (pim_ifp->gm_group_list) {
|
if (pim_ifp->gm_group_list) {
|
||||||
while (pim_ifp->gm_group_list->count) {
|
while (pim_ifp->gm_group_list->count) {
|
||||||
|
@ -3922,6 +3923,7 @@ static void clear_mroute(struct pim_instance *pim)
|
||||||
igmp_group_delete(grp);
|
igmp_group_delete(grp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clean up all upstreams*/
|
/* clean up all upstreams*/
|
||||||
|
@ -8236,6 +8238,7 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate,
|
||||||
"IGMP version\n"
|
"IGMP version\n"
|
||||||
"IGMP version number\n")
|
"IGMP version number\n")
|
||||||
{
|
{
|
||||||
|
#if PIM_IPV == 4
|
||||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||||
int igmp_version = 2;
|
int igmp_version = 2;
|
||||||
|
|
||||||
|
@ -8249,7 +8252,7 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate,
|
||||||
igmp_version = atoi(argv[4]->arg);
|
igmp_version = atoi(argv[4]->arg);
|
||||||
|
|
||||||
igmp_send_query_on_intf(ifp, igmp_version);
|
igmp_send_query_on_intf(ifp, igmp_version);
|
||||||
|
#endif
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,12 @@
|
||||||
#include "pim_igmp_join.h"
|
#include "pim_igmp_join.h"
|
||||||
#include "pim_vxlan.h"
|
#include "pim_vxlan.h"
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
static void pim_if_igmp_join_del_all(struct interface *ifp);
|
static void pim_if_igmp_join_del_all(struct interface *ifp);
|
||||||
static int igmp_join_sock(const char *ifname, ifindex_t ifindex,
|
static int igmp_join_sock(const char *ifname, ifindex_t ifindex,
|
||||||
struct in_addr group_addr,
|
struct in_addr group_addr,
|
||||||
struct in_addr source_addr);
|
struct in_addr source_addr);
|
||||||
|
#endif
|
||||||
|
|
||||||
void pim_if_init(struct pim_instance *pim)
|
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;
|
return t_suppressed_msec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
static void igmp_join_free(struct gm_join *ij)
|
static void igmp_join_free(struct gm_join *ij)
|
||||||
{
|
{
|
||||||
XFREE(MTYPE_PIM_IGMP_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))
|
for (ALL_LIST_ELEMENTS(pim_ifp->gm_join_list, node, nextnode, ij))
|
||||||
pim_if_igmp_join_del(ifp, ij->group_addr, ij->source_addr);
|
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
|
RFC 4601
|
||||||
|
|
|
@ -105,6 +105,7 @@ struct gm_sock {
|
||||||
|
|
||||||
struct pim_interface;
|
struct pim_interface;
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
void pim_igmp_if_init(struct pim_interface *pim_ifp, struct interface *ifp);
|
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_reset(struct pim_interface *pim_ifp);
|
||||||
void pim_igmp_if_fini(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);
|
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_FORWARDING (1 << 0)
|
||||||
#define IGMP_SOURCE_MASK_DELETE (1 << 1)
|
#define IGMP_SOURCE_MASK_DELETE (1 << 1)
|
||||||
#define IGMP_SOURCE_MASK_SEND (1 << 2)
|
#define IGMP_SOURCE_MASK_SEND (1 << 2)
|
||||||
|
@ -184,6 +203,7 @@ struct gm_group {
|
||||||
int64_t last_igmp_v2_report_dsec;
|
int64_t last_igmp_v2_report_dsec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
struct gm_group *find_group_by_addr(struct gm_sock *igmp,
|
struct gm_group *find_group_by_addr(struct gm_sock *igmp,
|
||||||
struct in_addr group_addr);
|
struct in_addr group_addr);
|
||||||
struct gm_group *igmp_add_group_by_addr(struct gm_sock *igmp,
|
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_group_delete(struct gm_group *group);
|
||||||
|
|
||||||
void igmp_send_query_on_intf(struct interface *ifp, int igmp_ver);
|
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 */
|
#endif /* PIM_IGMP_H */
|
||||||
|
|
|
@ -39,9 +39,9 @@ struct group_source_req {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int pim_igmp_join_source(int fd, ifindex_t ifindex,
|
static inline int pim_igmp_join_source(int fd, ifindex_t ifindex,
|
||||||
struct in_addr group_addr,
|
struct in_addr group_addr,
|
||||||
struct in_addr source_addr)
|
struct in_addr source_addr)
|
||||||
{
|
{
|
||||||
struct group_source_req req;
|
struct group_source_req req;
|
||||||
struct sockaddr_in group;
|
struct sockaddr_in group;
|
||||||
|
|
|
@ -35,7 +35,17 @@ struct igmp_stats {
|
||||||
uint32_t unsupported;
|
uint32_t unsupported;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
void igmp_stats_init(struct igmp_stats *stats);
|
void igmp_stats_init(struct igmp_stats *stats);
|
||||||
void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b);
|
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 */
|
#endif /* PIM_IGMP_STATS_H */
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
/* OHPI: Older Host Present Interval */
|
/* OHPI: Older Host Present Interval */
|
||||||
#define PIM_IGMP_OHPI_DSEC(qrv,qqi,qri_dsec) ((qrv) * (10 * (qqi)) + (qri_dsec))
|
#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_group_reset_gmi(struct gm_group *group);
|
||||||
void igmp_source_reset_gmi(struct gm_group *group, struct gm_source *source);
|
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,
|
int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
|
||||||
const char *from_str, char *igmp_msg, int igmp_msg_len);
|
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 */
|
#endif /* PIM_IGMPV3_H */
|
||||||
|
|
|
@ -397,6 +397,7 @@ int pim_interface_config_write(struct vty *vty)
|
||||||
++writes;
|
++writes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
/* IF ip igmp join */
|
/* IF ip igmp join */
|
||||||
if (pim_ifp->gm_join_list) {
|
if (pim_ifp->gm_join_list) {
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
|
@ -428,6 +429,7 @@ int pim_interface_config_write(struct vty *vty)
|
||||||
++writes;
|
++writes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* PIM_IPV == 4 */
|
||||||
|
|
||||||
if (pim_ifp->activeactive)
|
if (pim_ifp->activeactive)
|
||||||
vty_out(vty, " ip pim active-active\n");
|
vty_out(vty, " ip pim active-active\n");
|
||||||
|
|
|
@ -468,6 +468,7 @@ void pim_zebra_init(void)
|
||||||
zclient_lookup_new();
|
zclient_lookup_new();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PIM_IPV == 4
|
||||||
void igmp_anysource_forward_start(struct pim_instance *pim,
|
void igmp_anysource_forward_start(struct pim_instance *pim,
|
||||||
struct gm_group *group)
|
struct gm_group *group)
|
||||||
{
|
{
|
||||||
|
@ -794,6 +795,7 @@ void igmp_source_forward_stop(struct gm_source *source)
|
||||||
|
|
||||||
IGMP_SOURCE_DONT_FORWARDING(source->source_flags);
|
IGMP_SOURCE_DONT_FORWARDING(source->source_flags);
|
||||||
}
|
}
|
||||||
|
#endif /* PIM_IPV == 4 */
|
||||||
|
|
||||||
void pim_forward_start(struct pim_ifchannel *ch)
|
void pim_forward_start(struct pim_ifchannel *ch)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,11 +23,6 @@ pim_common = \
|
||||||
pimd/pim_hello.c \
|
pimd/pim_hello.c \
|
||||||
pimd/pim_iface.c \
|
pimd/pim_iface.c \
|
||||||
pimd/pim_ifchannel.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_instance.c \
|
||||||
pimd/pim_int.c \
|
pimd/pim_int.c \
|
||||||
pimd/pim_join.c \
|
pimd/pim_join.c \
|
||||||
|
@ -66,6 +61,11 @@ pim_common = \
|
||||||
|
|
||||||
pimd_pimd_SOURCES = \
|
pimd_pimd_SOURCES = \
|
||||||
$(pim_common) \
|
$(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_main.c \
|
||||||
pimd/pim_msdp.c \
|
pimd/pim_msdp.c \
|
||||||
pimd/pim_msdp_packet.c \
|
pimd/pim_msdp_packet.c \
|
||||||
|
|
Loading…
Reference in a new issue