]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim_rpf.h
bgpd: fix the IGP metric for best path selection on VPN import
[mirror_frr.git] / pimd / pim_rpf.h
CommitLineData
12e41d03 1/*
896014f4
DL
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 along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
12e41d03
DL
19
20#ifndef PIM_RPF_H
21#define PIM_RPF_H
22
23#include <zebra.h>
d02ea606 24#include "pim_str.h"
12e41d03 25
993e3d8e
DL
26struct pim_instance;
27
bfea315d
DS
28/*
29 RFC 4601:
30
31 Metric Preference
32 Preference value assigned to the unicast routing protocol that
33 provided the route to the multicast source or Rendezvous-Point.
34
35 Metric
36 The unicast routing table metric associated with the route used to
37 reach the multicast source or Rendezvous-Point. The metric is in
38 units applicable to the unicast routing protocol used.
39*/
40struct pim_nexthop {
d02ea606 41 pim_addr last_lookup;
d62a17ae 42 long long last_lookup_time;
43 struct interface *interface; /* RPF_interface(S) */
a1bc5746 44 pim_addr mrib_nexthop_addr; /* MRIB.next_hop(S) */
d62a17ae 45 uint32_t mrib_metric_preference; /* MRIB.pref(S) */
46 uint32_t mrib_route_metric; /* MRIB.metric(S) */
47 struct pim_neighbor *nbr;
bfea315d
DS
48};
49
50struct pim_rpf {
d62a17ae 51 struct pim_nexthop source_nexthop;
490e5b18 52 pim_addr rpf_addr; /* RPF'(S,G) */
bfea315d
DS
53};
54
d62a17ae 55enum pim_rpf_result { PIM_RPF_OK = 0, PIM_RPF_CHANGED, PIM_RPF_FAILURE };
bfea315d
DS
56
57struct pim_upstream;
58
d8b87afe 59unsigned int pim_rpf_hash_key(const void *arg);
74df8d6d 60bool pim_rpf_equal(const void *arg1, const void *arg2);
c2cf4b02 61
ade155e1 62bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
00b1f412 63 pim_addr addr, int neighbor_needed);
2002dcdb 64enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
ae14da48 65 struct pim_upstream *up,
8c55c132 66 struct pim_rpf *old, const char *caller);
1250cb5d
SP
67void pim_upstream_rpf_clear(struct pim_instance *pim,
68 struct pim_upstream *up);
d62a17ae 69int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf);
e71bf8f7 70
d62a17ae 71int pim_rpf_is_same(struct pim_rpf *rpf1, struct pim_rpf *rpf2);
bfc92019 72void pim_rpf_set_refresh_time(struct pim_instance *pim);
12e41d03 73#endif /* PIM_RPF_H */