]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_iface.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / pimd / pim_iface.h
index 2ba06318b0a8aaff849ad1b01d857e23df995271..a7dc097f882cbda1a7237e2391313ef2c744c063 100644 (file)
@@ -1,21 +1,20 @@
 /*
-  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_IFACE_H
 
 #include "if.h"
 #include "vty.h"
+#include "vrf.h"
+#include "zclient.h"
+#include "ferr.h"
 
 #include "pim_igmp.h"
 #include "pim_upstream.h"
+#include "bfd.h"
 
 #define PIM_IF_MASK_PIM                             (1 << 0)
 #define PIM_IF_MASK_IGMP                            (1 << 1)
@@ -64,22 +67,23 @@ enum pim_secondary_addr_flags {
 };
 
 struct pim_secondary_addr {
-       struct in_addr addr;
+       struct prefix addr;
        enum pim_secondary_addr_flags flags;
 };
 
 struct pim_interface {
        uint32_t options; /* bit vector */
        ifindex_t mroute_vif_index;
+       struct pim_instance *pim;
+
        struct in_addr primary_address; /* remember addr to detect change */
        struct list *sec_addr_list;     /* list of struct pim_secondary_addr */
        struct in_addr update_source;   /* user can statically set the primary
                                         * address of the interface */
 
-       int igmp_version;                     /* IGMP version */
-       int igmp_default_robustness_variable; /* IGMPv3 QRV */
-       int
-               igmp_default_query_interval;   /* IGMPv3 secs between general
+       int igmp_version;                      /* IGMP version */
+       int igmp_default_robustness_variable;  /* IGMPv3 QRV */
+       int igmp_default_query_interval;       /* IGMPv3 secs between general
                                                  queries */
        int igmp_query_max_response_time_dsec; /* IGMPv3 Max Response Time in
                                                  dsecs for general queries */
@@ -102,8 +106,7 @@ struct pim_interface {
        uint16_t pim_override_interval_msec; /* config */
        struct list *pim_neighbor_list;      /* list of struct pim_neighbor */
        struct list *upstream_switch_list;
-       struct list *pim_ifchannel_list; /* list of struct pim_ifchannel */
-       struct hash *pim_ifchannel_hash;
+       struct pim_ifchannel_rb ifchannel_rb;
 
        /* neighbors without lan_delay */
        int pim_number_of_nonlandelay_neighbors;
@@ -118,15 +121,27 @@ struct pim_interface {
        uint32_t pim_dr_priority;         /* config */
        int pim_dr_num_nondrpri_neighbors; /* neighbors without dr_pri */
 
+       /* boundary prefix-list */
+       char *boundary_oil_plist;
+
        int64_t pim_ifstat_start; /* start timestamp for stats */
        uint32_t pim_ifstat_hello_sent;
        uint32_t pim_ifstat_hello_sendfail;
        uint32_t pim_ifstat_hello_recv;
        uint32_t pim_ifstat_hello_recvfail;
+       uint32_t pim_ifstat_join_recv;
+       uint32_t pim_ifstat_join_send;
+       uint32_t pim_ifstat_prune_recv;
+       uint32_t pim_ifstat_prune_send;
+       uint32_t pim_ifstat_reg_recv;
+       uint32_t pim_ifstat_reg_send;
+       uint32_t pim_ifstat_reg_stop_recv;
+       uint32_t pim_ifstat_reg_stop_send;
+       uint32_t pim_ifstat_assert_recv;
+       uint32_t pim_ifstat_assert_send;
+       struct bfd_info *bfd_info;
 };
 
-extern struct interface *pim_regiface;
-extern struct list *pim_ifchannel_list;
 /*
   if default_holdtime is set (>= 0), use it;
   otherwise default_holdtime is 3.5 * hello_period
@@ -136,10 +151,11 @@ extern struct list *pim_ifchannel_list;
                 ? ((pim_ifp)->pim_hello_period * 7 / 2)                       \
                 : ((pim_ifp)->pim_default_holdtime))
 
-void pim_if_init(void);
-void pim_if_terminate(void);
+void pim_if_init(struct pim_instance *pim);
+void pim_if_terminate(struct pim_instance *pim);
 
-struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim);
+struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
+                                bool ispimreg);
 void pim_if_delete(struct interface *ifp);
 void pim_if_addr_add(struct connected *ifc);
 void pim_if_addr_del(struct connected *ifc, int force_prim_as_any);
@@ -148,16 +164,15 @@ void pim_if_addr_del_all(struct interface *ifp);
 void pim_if_addr_del_all_igmp(struct interface *ifp);
 void pim_if_addr_del_all_pim(struct interface *ifp);
 
-struct interface *pim_if_lookup_address_vrf(struct in_addr src,
-                                           vrf_id_t vrf_id);
-
-int pim_if_add_vif(struct interface *ifp);
+int pim_if_add_vif(struct interface *ifp, bool ispimreg);
 int pim_if_del_vif(struct interface *ifp);
-void pim_if_add_vif_all(void);
-void pim_if_del_vif_all(void);
+void pim_if_add_vif_all(struct pim_instance *pim);
+void pim_if_del_vif_all(struct pim_instance *pim);
 
-struct interface *pim_if_find_by_vif_index(ifindex_t vif_index);
-int pim_if_find_vifindex_by_ifindex(ifindex_t ifindex);
+struct interface *pim_if_find_by_vif_index(struct pim_instance *pim,
+                                          ifindex_t vif_index);
+int pim_if_find_vifindex_by_ifindex(struct pim_instance *pim,
+                                   ifindex_t ifindex);
 
 int pim_if_lan_delay_enabled(struct interface *ifp);
 uint16_t pim_if_effective_propagation_delay_msec(struct interface *ifp);
@@ -171,8 +186,8 @@ int pim_if_t_override_msec(struct interface *ifp);
 
 struct in_addr pim_find_primary_addr(struct interface *ifp);
 
-int pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,
-                        struct in_addr source_addr);
+ferr_r pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,
+                           struct in_addr source_addr);
 int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,
                         struct in_addr source_addr);
 
@@ -188,9 +203,12 @@ void pim_if_update_join_desired(struct pim_interface *pim_ifp);
 
 void pim_if_update_assert_tracking_desired(struct interface *ifp);
 
-void pim_if_create_pimreg(void);
+void pim_if_create_pimreg(struct pim_instance *pim);
 
 int pim_if_connected_to_source(struct interface *ifp, struct in_addr src);
 int pim_update_source_set(struct interface *ifp, struct in_addr source);
 
+bool pim_if_is_vrf_device(struct interface *ifp);
+
+int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
 #endif /* PIM_IFACE_H */