From bfea315d4f24d456b4ecff6a53cca2389d667eb3 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 2 Sep 2016 11:03:43 -0400 Subject: [PATCH] pimd: Move rpf code into pim_rpf.h The pim_rpf code needs to be in pim_rpf.h as that it belongs in there. Signed-off-by: Donald Sharp --- pimd/pim_rpf.h | 32 ++++++++++++++++++++++++++++++++ pimd/pim_upstream.h | 32 ++------------------------------ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/pimd/pim_rpf.h b/pimd/pim_rpf.h index ab16039a29..9e183a0895 100644 --- a/pimd/pim_rpf.h +++ b/pimd/pim_rpf.h @@ -27,6 +27,38 @@ #include "pim_upstream.h" #include "pim_neighbor.h" +/* + RFC 4601: + + Metric Preference + Preference value assigned to the unicast routing protocol that + provided the route to the multicast source or Rendezvous-Point. + + Metric + The unicast routing table metric associated with the route used to + reach the multicast source or Rendezvous-Point. The metric is in + units applicable to the unicast routing protocol used. +*/ +struct pim_nexthop { + struct interface *interface; /* RPF_interface(S) */ + struct in_addr mrib_nexthop_addr; /* MRIB.next_hop(S) */ + uint32_t mrib_metric_preference; /* MRIB.pref(S) */ + uint32_t mrib_route_metric; /* MRIB.metric(S) */ +}; + +struct pim_rpf { + struct pim_nexthop source_nexthop; + struct in_addr rpf_addr; /* RPF'(S,G) */ +}; + +enum pim_rpf_result { + PIM_RPF_OK = 0, + PIM_RPF_CHANGED, + PIM_RPF_FAILURE +}; + +struct pim_upstream; + int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr); enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct in_addr *old_rpf_addr); diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index 95492b27c1..cd30343492 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -25,6 +25,8 @@ #include #include +#include + #define PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED (1 << 0) #define PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED_UPDATED (2 << 0) @@ -37,36 +39,6 @@ #define PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED) #define PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED_UPDATED(flags) ((flags) &= ~PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED_UPDATED) -/* - RFC 4601: - - Metric Preference - Preference value assigned to the unicast routing protocol that - provided the route to the multicast source or Rendezvous-Point. - - Metric - The unicast routing table metric associated with the route used to - reach the multicast source or Rendezvous-Point. The metric is in - units applicable to the unicast routing protocol used. -*/ -struct pim_nexthop { - struct interface *interface; /* RPF_interface(S) */ - struct in_addr mrib_nexthop_addr; /* MRIB.next_hop(S) */ - uint32_t mrib_metric_preference; /* MRIB.pref(S) */ - uint32_t mrib_route_metric; /* MRIB.metric(S) */ -}; - -struct pim_rpf { - struct pim_nexthop source_nexthop; - struct in_addr rpf_addr; /* RPF'(S,G) */ -}; - -enum pim_rpf_result { - PIM_RPF_OK = 0, - PIM_RPF_CHANGED, - PIM_RPF_FAILURE -}; - enum pim_upstream_state { PIM_UPSTREAM_NOTJOINED, PIM_UPSTREAM_JOINED, -- 2.39.5