]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_iface.h
Merge pull request #10746 from ton31337/feature/show_group_type_under_rp_info_cli
[mirror_frr.git] / pimd / pim_iface.h
index bf8e4bd02436e30b5f3c4ca0ba25e470f159393f..00ec8e74278027b368b6813c9950fabcbb000bb6 100644 (file)
@@ -32,6 +32,7 @@
 #include "pim_upstream.h"
 #include "pim_instance.h"
 #include "bfd.h"
+#include "pim_str.h"
 
 #define PIM_IF_MASK_PIM                             (1 << 0)
 #define PIM_IF_MASK_IGMP                            (1 << 1)
@@ -58,7 +59,8 @@
 #define PIM_IF_DONT_PIM_CAN_DISABLE_JOIN_SUPPRESSION(options)                  \
        ((options) &= ~PIM_IF_MASK_PIM_CAN_DISABLE_JOIN_SUPPRESSION)
 
-#define PIM_I_am_DR(pim_ifp) (pim_ifp)->pim_dr_addr.s_addr == (pim_ifp)->primary_address.s_addr
+#define PIM_I_am_DR(pim_ifp)                                                   \
+       !pim_addr_cmp((pim_ifp)->pim_dr_addr, (pim_ifp)->primary_address)
 #define PIM_I_am_DualActive(pim_ifp) (pim_ifp)->activeactive == true
 
 /* Macros for interface flags */
@@ -76,7 +78,7 @@
 #define PIM_IF_FLAG_UNSET_HELLO_SENT(flags) ((flags) &= ~PIM_IF_FLAG_HELLO_SENT)
 
 struct pim_iface_upstream_switch {
-       struct in_addr address;
+       pim_addr address;
        struct list *us;
 };
 
@@ -94,31 +96,32 @@ 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 */
+       pim_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
+       pim_addr update_source;         /* user can statically set the primary
                                         * address of the interface */
 
-       int version;                      /* IGMP or MLD version */
-       int default_robustness_variable;  /* IGMP or MLD QRV */
-       int default_query_interval;       /* IGMP or MLD secs between general
+       int igmp_version;                    /* IGMP version */
+       int gm_default_robustness_variable;  /* IGMP or MLD QRV */
+       int gm_default_query_interval;       /* IGMP or MLD secs between general
                                                  queries */
-       int query_max_response_time_dsec; /* IGMP or MLD Max Response Time in
+       int gm_query_max_response_time_dsec; /* IGMP or MLD Max Response Time in
                                                  dsecs for general queries */
-       int specific_query_max_response_time_dsec; /* IGMP or MLD Max Response
-                                                          Time in dsecs called
-                                                          as last member query
-                                                          interval, defines the
-                                                          maximum response time
-                                                          advertised in IGMP
-                                                          group-specific
-                                                          queries */
-       int last_member_query_count; /* IGMP or MLD last member query count */
-       struct list *socket_list;    /* list of struct IGMP or MLD sock */
-       struct list *join_list;      /* list of struct IGMP or MLD join */
-       struct list *group_list;     /* list of struct IGMP or MLD group */
-       struct hash *group_hash;
+       int gm_specific_query_max_response_time_dsec; /* IGMP or MLD Max
+                                                        Response Time in dsecs
+                                                        called as last member
+                                                        query interval, defines
+                                                        the maximum response
+                                                        time advertised in IGMP
+                                                        group-specific
+                                                        queries */
+       int gm_last_member_query_count;               /* IGMP or MLD last member
+                                                        query count
+                                                      */
+       struct list *gm_socket_list; /* list of struct IGMP or MLD sock */
+       struct list *gm_join_list;   /* list of struct IGMP or MLD join */
+       struct list *gm_group_list;  /* list of struct IGMP or MLD group */
+       struct hash *gm_group_hash;
 
        int pim_sock_fd;                /* PIM socket file descriptor */
        struct thread *t_pim_sock_read; /* thread for reading PIM socket */
@@ -144,7 +147,7 @@ struct pim_interface {
        int64_t pim_dr_election_last; /* timestamp */
        int pim_dr_election_count;
        int pim_dr_election_changes;
-       struct in_addr pim_dr_addr;
+       pim_addr pim_dr_addr;
        uint32_t pim_dr_priority;         /* config */
        int pim_dr_num_nondrpri_neighbors; /* neighbors without dr_pri */
 
@@ -189,8 +192,8 @@ struct pim_interface {
 };
 
 /*
-  if default_holdtime is set (>= 0), use it;
-  otherwise default_holdtime is 3.5 * hello_period
* if default_holdtime is set (>= 0), use it;
* otherwise default_holdtime is 3.5 * hello_period
  */
 #define PIM_IF_DEFAULT_HOLDTIME(pim_ifp)                                       \
        (((pim_ifp)->pim_default_holdtime < 0)                                 \
@@ -223,13 +226,12 @@ int pim_if_lan_delay_enabled(struct interface *ifp);
 uint16_t pim_if_effective_propagation_delay_msec(struct interface *ifp);
 uint16_t pim_if_effective_override_interval_msec(struct interface *ifp);
 uint16_t pim_if_jp_override_interval_msec(struct interface *ifp);
-struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp,
-                                         struct in_addr addr);
+struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp, pim_addr addr);
 
 long pim_if_t_suppressed_msec(struct interface *ifp);
 int pim_if_t_override_msec(struct interface *ifp);
 
-struct in_addr pim_find_primary_addr(struct interface *ifp);
+pim_addr pim_find_primary_addr(struct interface *ifp);
 
 ferr_r pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,
                            struct in_addr source_addr);
@@ -238,8 +240,7 @@ int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,
 
 void pim_if_update_could_assert(struct interface *ifp);
 
-void pim_if_assert_on_neighbor_down(struct interface *ifp,
-                                   struct in_addr neigh_addr);
+void pim_if_assert_on_neighbor_down(struct interface *ifp, pim_addr neigh_addr);
 
 void pim_if_rpf_interface_changed(struct interface *old_rpf_ifp,
                                  struct pim_upstream *up);
@@ -250,16 +251,13 @@ void pim_if_update_assert_tracking_desired(struct interface *ifp);
 
 void pim_if_create_pimreg(struct pim_instance *pim);
 
-struct prefix *pim_if_connected_to_source(struct interface *ifp, struct in_addr src);
-int pim_update_source_set(struct interface *ifp, struct in_addr source);
+struct prefix *pim_if_connected_to_source(struct interface *ifp, pim_addr src);
+int pim_update_source_set(struct interface *ifp, pim_addr source);
 
 bool pim_if_is_vrf_device(struct interface *ifp);
 
 int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
 
-extern int pim_ifp_create(struct interface *ifp);
-extern int pim_ifp_up(struct interface *ifp);
-extern int pim_ifp_down(struct interface *ifp);
-extern int pim_ifp_destroy(struct interface *ifp);
+void pim_iface_init(void);
 
 #endif /* PIM_IFACE_H */