]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_rpf.h
Merge branch 'frr/pull/92' (BGP Large Community support)
[mirror_frr.git] / pimd / pim_rpf.h
1 /*
2 PIM for Quagga
3 Copyright (C) 2008 Everton da Silva Marques
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING; if not, write to the
17 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18 MA 02110-1301 USA
19 */
20
21 #ifndef PIM_RPF_H
22 #define PIM_RPF_H
23
24 #include <zebra.h>
25
26 #include "pim_upstream.h"
27 #include "pim_neighbor.h"
28
29 /*
30 RFC 4601:
31
32 Metric Preference
33 Preference value assigned to the unicast routing protocol that
34 provided the route to the multicast source or Rendezvous-Point.
35
36 Metric
37 The unicast routing table metric associated with the route used to
38 reach the multicast source or Rendezvous-Point. The metric is in
39 units applicable to the unicast routing protocol used.
40 */
41 struct pim_nexthop {
42 struct in_addr last_lookup;
43 long long last_lookup_time;
44 struct interface *interface; /* RPF_interface(S) */
45 struct prefix mrib_nexthop_addr; /* MRIB.next_hop(S) */
46 uint32_t mrib_metric_preference; /* MRIB.pref(S) */
47 uint32_t mrib_route_metric; /* MRIB.metric(S) */
48 };
49
50 struct pim_rpf {
51 struct pim_nexthop source_nexthop;
52 struct prefix rpf_addr; /* RPF'(S,G) */
53 };
54
55 enum pim_rpf_result {
56 PIM_RPF_OK = 0,
57 PIM_RPF_CHANGED,
58 PIM_RPF_FAILURE
59 };
60
61 struct pim_upstream;
62
63 extern long long nexthop_lookups_avoided;
64
65 int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int neighbor_needed);
66 enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct in_addr *old_rpf_addr);
67
68 int pim_rpf_addr_is_inaddr_none (struct pim_rpf *rpf);
69 int pim_rpf_addr_is_inaddr_any (struct pim_rpf *rpf);
70
71 int pim_rpf_is_same (struct pim_rpf *rpf1, struct pim_rpf *rpf2);
72 void pim_rpf_set_refresh_time (void);
73 #endif /* PIM_RPF_H */