]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
12e41d03 | 2 | /* |
896014f4 DL |
3 | * PIM for Quagga |
4 | * Copyright (C) 2008 Everton da Silva Marques | |
896014f4 | 5 | */ |
12e41d03 DL |
6 | |
7 | #ifndef PIM_RPF_H | |
8 | #define PIM_RPF_H | |
9 | ||
10 | #include <zebra.h> | |
d02ea606 | 11 | #include "pim_str.h" |
12e41d03 | 12 | |
993e3d8e DL |
13 | struct pim_instance; |
14 | ||
bfea315d DS |
15 | /* |
16 | RFC 4601: | |
17 | ||
18 | Metric Preference | |
19 | Preference value assigned to the unicast routing protocol that | |
20 | provided the route to the multicast source or Rendezvous-Point. | |
21 | ||
22 | Metric | |
23 | The unicast routing table metric associated with the route used to | |
24 | reach the multicast source or Rendezvous-Point. The metric is in | |
25 | units applicable to the unicast routing protocol used. | |
26 | */ | |
27 | struct pim_nexthop { | |
d02ea606 | 28 | pim_addr last_lookup; |
d62a17ae | 29 | long long last_lookup_time; |
30 | struct interface *interface; /* RPF_interface(S) */ | |
a1bc5746 | 31 | pim_addr mrib_nexthop_addr; /* MRIB.next_hop(S) */ |
d62a17ae | 32 | uint32_t mrib_metric_preference; /* MRIB.pref(S) */ |
33 | uint32_t mrib_route_metric; /* MRIB.metric(S) */ | |
34 | struct pim_neighbor *nbr; | |
bfea315d DS |
35 | }; |
36 | ||
37 | struct pim_rpf { | |
d62a17ae | 38 | struct pim_nexthop source_nexthop; |
490e5b18 | 39 | pim_addr rpf_addr; /* RPF'(S,G) */ |
bfea315d DS |
40 | }; |
41 | ||
d62a17ae | 42 | enum pim_rpf_result { PIM_RPF_OK = 0, PIM_RPF_CHANGED, PIM_RPF_FAILURE }; |
bfea315d DS |
43 | |
44 | struct pim_upstream; | |
45 | ||
d8b87afe | 46 | unsigned int pim_rpf_hash_key(const void *arg); |
74df8d6d | 47 | bool pim_rpf_equal(const void *arg1, const void *arg2); |
c2cf4b02 | 48 | |
ade155e1 | 49 | bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop, |
00b1f412 | 50 | pim_addr addr, int neighbor_needed); |
2002dcdb | 51 | enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, |
ae14da48 | 52 | struct pim_upstream *up, |
8c55c132 | 53 | struct pim_rpf *old, const char *caller); |
1250cb5d SP |
54 | void pim_upstream_rpf_clear(struct pim_instance *pim, |
55 | struct pim_upstream *up); | |
d62a17ae | 56 | int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf); |
e71bf8f7 | 57 | |
d62a17ae | 58 | int pim_rpf_is_same(struct pim_rpf *rpf1, struct pim_rpf *rpf2); |
bfc92019 | 59 | void pim_rpf_set_refresh_time(struct pim_instance *pim); |
12e41d03 | 60 | #endif /* PIM_RPF_H */ |