]>
git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_nht.h
3 * Copyright (C) 2017 Cumulus Networks, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 /* PIM nexthop cache value structure. */
33 struct pim_nexthop_cache
{
35 /* IGP route's metric. */
38 /* Nexthop number and nexthop linked list. */
40 struct nexthop
*nexthop
;
43 #define PIM_NEXTHOP_VALID (1 << 0)
44 #define PIM_NEXTHOP_ANSWER_RECEIVED (1 << 1)
47 struct hash
*upstream_hash
;
49 /* bsr_count won't currently go above 1 as we only have global_scope,
50 * but if anyone adds scope support multiple scopes may NHT-track the
56 struct pnc_hash_walk_data
{
57 struct pim_instance
*pim
;
58 struct interface
*ifp
;
61 int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS
);
62 int pim_find_or_track_nexthop(struct pim_instance
*pim
, pim_addr addr
,
63 struct pim_upstream
*up
, struct rp_info
*rp
,
64 struct pim_nexthop_cache
*out_pnc
);
65 void pim_delete_tracked_nexthop(struct pim_instance
*pim
, pim_addr addr
,
66 struct pim_upstream
*up
, struct rp_info
*rp
);
67 struct pim_nexthop_cache
*pim_nexthop_cache_find(struct pim_instance
*pim
,
69 uint32_t pim_compute_ecmp_hash(struct prefix
*src
, struct prefix
*grp
);
70 int pim_ecmp_nexthop_lookup(struct pim_instance
*pim
,
71 struct pim_nexthop
*nexthop
, pim_addr src
,
72 struct prefix
*grp
, int neighbor_needed
);
73 void pim_sendmsg_zebra_rnh(struct pim_instance
*pim
, struct zclient
*zclient
,
74 struct pim_nexthop_cache
*pnc
, int command
);
75 int pim_ecmp_fib_lookup_if_vif_index(struct pim_instance
*pim
, pim_addr src
,
77 void pim_rp_nexthop_del(struct rp_info
*rp_info
);
79 /* for RPF check on BSM message receipt */
80 void pim_nht_bsr_add(struct pim_instance
*pim
, pim_addr bsr_addr
);
81 void pim_nht_bsr_del(struct pim_instance
*pim
, pim_addr bsr_addr
);
82 /* RPF(bsr_addr) == src_ip%src_ifp? */
83 bool pim_nht_bsr_rpf_check(struct pim_instance
*pim
, pim_addr bsr_addr
,
84 struct interface
*src_ifp
, pim_addr src_ip
);
85 void pim_upstream_nh_if_update(struct pim_instance
*pim
, struct interface
*ifp
);