2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-02-04 07:01:14 +01:00
|
|
|
/*
|
2017-05-13 10:25:29 +02:00
|
|
|
* PIM for Quagga
|
|
|
|
* Copyright (C) 2008 Everton da Silva Marques
|
|
|
|
*/
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#ifndef PIM_RPF_H
|
|
|
|
#define PIM_RPF_H
|
|
|
|
|
|
|
|
#include <zebra.h>
|
2021-12-14 13:17:29 +01:00
|
|
|
#include "pim_str.h"
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2022-05-06 12:36:51 +02:00
|
|
|
struct pim_instance;
|
|
|
|
|
2016-09-02 17:03:43 +02:00
|
|
|
/*
|
|
|
|
RFC 4601:
|
|
|
|
|
|
|
|
Metric Preference
|
|
|
|
Preference value assigned to the unicast routing protocol that
|
|
|
|
provided the route to the multicast source or Rendezvous-Point.
|
|
|
|
|
|
|
|
Metric
|
|
|
|
The unicast routing table metric associated with the route used to
|
|
|
|
reach the multicast source or Rendezvous-Point. The metric is in
|
|
|
|
units applicable to the unicast routing protocol used.
|
|
|
|
*/
|
|
|
|
struct pim_nexthop {
|
2021-12-14 13:17:29 +01:00
|
|
|
pim_addr last_lookup;
|
2016-10-27 17:54:55 +02:00
|
|
|
long long last_lookup_time;
|
2016-09-02 17:03:43 +02:00
|
|
|
struct interface *interface; /* RPF_interface(S) */
|
2022-04-07 07:34:38 +02:00
|
|
|
pim_addr mrib_nexthop_addr; /* MRIB.next_hop(S) */
|
2016-09-02 17:03:43 +02:00
|
|
|
uint32_t mrib_metric_preference; /* MRIB.pref(S) */
|
|
|
|
uint32_t mrib_route_metric; /* MRIB.metric(S) */
|
2017-02-15 03:32:16 +01:00
|
|
|
struct pim_neighbor *nbr;
|
2016-09-02 17:03:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct pim_rpf {
|
|
|
|
struct pim_nexthop source_nexthop;
|
2022-04-27 10:19:18 +02:00
|
|
|
pim_addr rpf_addr; /* RPF'(S,G) */
|
2016-09-02 17:03:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum pim_rpf_result { PIM_RPF_OK = 0, PIM_RPF_CHANGED, PIM_RPF_FAILURE };
|
|
|
|
|
|
|
|
struct pim_upstream;
|
|
|
|
|
2019-05-14 22:19:07 +02:00
|
|
|
unsigned int pim_rpf_hash_key(const void *arg);
|
2018-10-17 21:27:12 +02:00
|
|
|
bool pim_rpf_equal(const void *arg1, const void *arg2);
|
2017-05-19 00:51:31 +02:00
|
|
|
|
2019-04-01 21:41:32 +02:00
|
|
|
bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
|
2022-01-18 11:54:36 +01:00
|
|
|
pim_addr addr, int neighbor_needed);
|
2017-05-24 16:37:23 +02:00
|
|
|
enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
|
2019-05-03 00:25:57 +02:00
|
|
|
struct pim_upstream *up,
|
2019-11-15 20:37:31 +01:00
|
|
|
struct pim_rpf *old, const char *caller);
|
2019-02-22 16:29:24 +01:00
|
|
|
void pim_upstream_rpf_clear(struct pim_instance *pim,
|
|
|
|
struct pim_upstream *up);
|
2016-09-02 18:17:10 +02:00
|
|
|
int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf);
|
2016-10-27 17:54:55 +02:00
|
|
|
|
2016-11-02 15:53:28 +01:00
|
|
|
int pim_rpf_is_same(struct pim_rpf *rpf1, struct pim_rpf *rpf2);
|
2018-03-18 02:34:55 +01:00
|
|
|
void pim_rpf_set_refresh_time(struct pim_instance *pim);
|
2015-02-04 07:01:14 +01:00
|
|
|
#endif /* PIM_RPF_H */
|