]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_igmpv3.h
bgpd: fix the IGP metric for best path selection on VPN import
[mirror_frr.git] / pimd / pim_igmpv3.h
index 3a4a81d97ed9e24e156c8aeff2bbbeaa488f11e8..5041e54cb495e912b22faeda0e57ea668247d7fc 100644 (file)
@@ -1,22 +1,21 @@
 /*
-  PIM for Quagga
-  Copyright (C) 2008  Everton da Silva Marques
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-  
-  You should have received a copy of the GNU General Public License
-  along with this program; see the file COPYING; if not, write to the
-  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-  MA 02110-1301 USA
-*/
+ * PIM for Quagga
+ * Copyright (C) 2008  Everton da Silva Marques
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
 
 #ifndef PIM_IGMPV3_H
 #define PIM_IGMPV3_H
@@ -24,6 +23,8 @@
 #include <zebra.h>
 #include "if.h"
 
+#include "pim_igmp.h"
+
 #define IGMP_V3_CHECKSUM_OFFSET            (2)
 #define IGMP_V3_REPORT_NUMGROUPS_OFFSET    (6)
 #define IGMP_V3_REPORT_GROUPPRECORD_OFFSET (8)
 /* OHPI: Older Host Present Interval */
 #define PIM_IGMP_OHPI_DSEC(qrv,qqi,qri_dsec) ((qrv) * (10 * (qqi)) + (qri_dsec))
 
-void igmp_group_reset_gmi(struct igmp_group *group);
-void igmp_source_reset_gmi(struct igmp_sock *igmp,
-                          struct igmp_group *group,
-                          struct igmp_source *source);
+#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);
 
-void igmp_source_free(struct igmp_source *source);
-void igmp_source_delete(struct igmp_source *source);
+void igmp_source_free(struct gm_source *source);
+void igmp_source_delete(struct gm_source *source);
 void igmp_source_delete_expired(struct list *source_list);
 
-void igmpv3_report_isin(struct igmp_sock *igmp, struct in_addr from,
-                       struct in_addr group_addr,
-                       int num_sources, struct in_addr *sources);
-void igmpv3_report_isex(struct igmp_sock *igmp, struct in_addr from,
-                       struct in_addr group_addr,
-                        int num_sources, struct in_addr *sources,
-                        int from_igmp_v2_report);
-void igmpv3_report_toin(struct igmp_sock *igmp, struct in_addr from,
-                       struct in_addr group_addr,
-                       int num_sources, struct in_addr *sources);
-void igmpv3_report_toex(struct igmp_sock *igmp, struct in_addr from,
-                       struct in_addr group_addr,
-                       int num_sources, struct in_addr *sources);
-void igmpv3_report_allow(struct igmp_sock *igmp, struct in_addr from,
-                        struct in_addr group_addr,
-                        int num_sources, struct in_addr *sources);
-void igmpv3_report_block(struct igmp_sock *igmp, struct in_addr from,
-                        struct in_addr group_addr,
-                        int num_sources, struct in_addr *sources);
-
-void igmp_group_timer_lower_to_lmqt(struct igmp_group *group);
-void igmp_source_timer_lower_to_lmqt(struct igmp_source *source);
-
-struct igmp_source *igmp_find_source_by_addr(struct igmp_group *group,
-                                            struct in_addr src_addr);
-
-void igmp_v3_send_query (struct igmp_group *group,
-                         int fd,
-                         const char *ifname,
-                         char *query_buf,
-                         int query_buf_size,
-                         int num_sources,
-                         struct in_addr dst_addr,
-                         struct in_addr group_addr,
-                         int query_max_response_time_dsec,
-                         uint8_t s_flag,
-                         uint8_t querier_robustness_variable,
-                         uint16_t querier_query_interval);
-
-void igmp_v3_recv_query (struct igmp_sock *igmp, const char *from_str,
-                         char *igmp_msg);
-
-int igmp_v3_recv_report (struct igmp_sock *igmp,
-                         struct in_addr from, const char *from_str,
-                         char *igmp_msg, int igmp_msg_len);
+void igmpv3_report_isin(struct gm_sock *igmp, struct in_addr from,
+                       struct in_addr group_addr, int num_sources,
+                       struct in_addr *sources);
+void igmpv3_report_isex(struct gm_sock *igmp, struct in_addr from,
+                       struct in_addr group_addr, int num_sources,
+                       struct in_addr *sources, int from_igmp_v2_report);
+void igmpv3_report_toin(struct gm_sock *igmp, struct in_addr from,
+                       struct in_addr group_addr, int num_sources,
+                       struct in_addr *sources);
+void igmpv3_report_toex(struct gm_sock *igmp, struct in_addr from,
+                       struct in_addr group_addr, int num_sources,
+                       struct in_addr *sources);
+void igmpv3_report_allow(struct gm_sock *igmp, struct in_addr from,
+                        struct in_addr group_addr, int num_sources,
+                        struct in_addr *sources);
+void igmpv3_report_block(struct gm_sock *igmp, struct in_addr from,
+                        struct in_addr group_addr, int num_sources,
+                        struct in_addr *sources);
+
+void igmp_group_timer_lower_to_lmqt(struct gm_group *group);
+void igmp_source_timer_lower_to_lmqt(struct gm_source *source);
+
+struct gm_source *igmp_find_source_by_addr(struct gm_group *group,
+                                          struct in_addr src_addr);
+
+void igmp_v3_send_query(struct gm_group *group, int fd, const char *ifname,
+                       char *query_buf, int query_buf_size, int num_sources,
+                       struct in_addr dst_addr, struct in_addr group_addr,
+                       int query_max_response_time_dsec, uint8_t s_flag,
+                       uint8_t querier_robustness_variable,
+                       uint16_t querier_query_interval);
+
+void igmp_v3_recv_query(struct gm_sock *igmp, const char *from_str,
+                       char *igmp_msg);
+
+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 */