#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)
#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 */
#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;
};
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 */
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 */
};
/*
- 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) \
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);
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);
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 */