diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2024-10-02 09:22:48 -0300 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2024-11-13 12:05:35 -0300 | 
| commit | 23c7acd2327b4caeec0b4e2a1a082bfd10ede957 (patch) | |
| tree | 9f77ef3731331f591d021a0c55167430e8026546 /pimd/pim_rp.h | |
| parent | 5456bc5d9313b53b8059583cba7c95f55f08a26b (diff) | |
pim6d: support embedded-rp
Implement embedded RP support and configuration commands.
Embedded RP is disabled by default and can be globally enabled with the
command `embedded-rp` in the PIMv6 configuration node.
It supports the following options:
- Embedded RP maximum limit
- Embedded RP group filtering
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_rp.h')
| -rw-r--r-- | pimd/pim_rp.h | 56 | 
1 files changed, 55 insertions, 1 deletions
diff --git a/pimd/pim_rp.h b/pimd/pim_rp.h index 24832d0dbd..9da059f8be 100644 --- a/pimd/pim_rp.h +++ b/pimd/pim_rp.h @@ -16,7 +16,15 @@  struct pim_interface; -enum rp_source { RP_SRC_NONE = 0, RP_SRC_STATIC, RP_SRC_BSR, RP_SRC_AUTORP }; +enum rp_source { +	RP_SRC_NONE = 0, +	RP_SRC_STATIC, +	RP_SRC_BSR, +	RP_SRC_AUTORP, +#if PIM_IPV == 6 +	RP_SRC_EMBEDDED_RP, +#endif /* PIM_IPV == 6*/ +};  struct rp_info {  	struct prefix group; @@ -26,6 +34,11 @@ struct rp_info {  	char *plist;  }; +#if PIM_IPV == 6 +/** Default maximum simultaneous embedded RPs at one time. */ +#define PIM_EMBEDDED_RP_MAXIMUM 25 +#endif /* PIM_IPV == 6 */ +  void pim_rp_init(struct pim_instance *pim);  void pim_rp_free(struct pim_instance *pim); @@ -69,4 +82,45 @@ struct rp_info *pim_rp_find_match_group(struct pim_instance *pim,  					const struct prefix *group);  void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up);  void pim_rp_refresh_group_to_rp_mapping(struct pim_instance *pim); + +#if PIM_IPV == 6 +/** Check if address has valid embedded RP value. */ +bool pim_embedded_rp_is_embedded(const pim_addr *group) __attribute__((nonnull(1))); + +/** Test address against embedded RP group list filter. */ +bool pim_embedded_rp_filter_match(const struct pim_instance *pim, const pim_addr *group) +	__attribute__((nonnull(1, 2))); + +/** + * Extract embedded RP address from multicast group. + * + * Returns true if successful otherwise false. + */ +bool pim_embedded_rp_extract(const pim_addr *group, pim_addr *rp) __attribute__((nonnull(1, 2))); + +/** Allocate new embedded RP. */ +void pim_embedded_rp_new(struct pim_instance *pim, const pim_addr *group, const pim_addr *rp) +	__attribute__((nonnull(1, 2, 3))); + +/** Remove and free allocated embedded RP. */ +void pim_embedded_rp_delete(struct pim_instance *pim, const pim_addr *group) +	__attribute__((nonnull(1, 2))); + +/** Free memory allocated by embedded RP information. */ +extern void pim_embedded_rp_free(struct pim_instance *pim, struct rp_info *rp_info) +	__attribute__((nonnull(1, 2))); + +/** Toggle embedded RP state. */ +extern void pim_embedded_rp_enable(struct pim_instance *pim, bool enable) +	__attribute__((nonnull(1))); + +/** Configure embedded RP group prefix list. */ +extern void pim_embedded_rp_set_group_list(struct pim_instance *pim, const char *group_list) +	__attribute__((nonnull(1))); + +/** Configure maximum number of embedded RPs to learn. */ +extern void pim_embedded_rp_set_maximum_rps(struct pim_instance *pim, uint32_t maximum) +	__attribute__((nonnull(1))); +#endif /* PIM_IPV == 6 */ +  #endif  | 
