diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-09-07 21:34:29 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-22 02:26:08 +0100 |
commit | 99deb321fcbd6b0519d21ccc1498e88341bd6bd7 (patch) | |
tree | 0375eade2ec1452e01b665f38668c695e27a2c6e /pimd/pim_neighbor.c | |
parent | pimd: Allow ip address selection for BGP unnumbered (diff) | |
download | frr-99deb321fcbd6b0519d21ccc1498e88341bd6bd7.tar.xz frr-99deb321fcbd6b0519d21ccc1498e88341bd6bd7.zip |
pimd: Add the ability to lookup neighbor on a interface
On a specified interface return the single
neighbor on that interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_neighbor.c')
-rw-r--r-- | pimd/pim_neighbor.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 61e19d800..ba2fc753b 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -403,6 +403,22 @@ struct pim_neighbor *pim_neighbor_find(struct interface *ifp, return 0; } +/* + * Find the *one* interface out + * this interface. If more than + * one return NULL + */ +struct pim_neighbor * +pim_neighbor_find_if (struct interface *ifp) +{ + struct pim_interface *pim_ifp = ifp->info; + + if (pim_ifp->pim_neighbor_list->count != 1) + return NULL; + + return listnode_head (pim_ifp->pim_neighbor_list); +} + struct pim_neighbor *pim_neighbor_add(struct interface *ifp, struct in_addr source_addr, pim_hello_options hello_options, |