From f41b4a021659dd48d62b1a7aac4b28e3663dbdaa Mon Sep 17 00:00:00 2001 From: Dinesh Dutt Date: Sat, 24 Aug 2013 08:00:37 +0000 Subject: ospf6d: add overload support OSPFv3: Support setting/clearing overload bit on router It is sometimes necessary for a router to gracefully remove itself from the SPF tree i.e. it cannot act as a transit router. It does this by setting the overload bit in the router LSA. This patch adds support for enabling/disabling the overload bit. Signed-off-by: Dinesh G Dutt Reviewed-by: Pradosh Mohapatra [DL: patch applied with fuzz] Signed-off-by: David Lamparter --- ospf6d/ospf6_intra.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ospf6d/ospf6_intra.c') diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index c08a6ae6..025a7710 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -104,6 +104,29 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) return 0; } +int +ospf6_router_is_stub_router (struct ospf6_lsa *lsa) +{ + struct ospf6_router_lsa *rtr_lsa; + + if (lsa != NULL && OSPF6_LSA_IS_TYPE (ROUTER, lsa)) + { + rtr_lsa = (struct ospf6_router_lsa *) + ((caddr_t) lsa->header + sizeof (struct ospf6_lsa_header)); + + if (!OSPF6_OPT_ISSET (rtr_lsa->options, OSPF6_OPT_R)) + { + return (OSPF6_IS_STUB_ROUTER); + } + else if (!OSPF6_OPT_ISSET (rtr_lsa->options, OSPF6_OPT_V6)) + { + return (OSPF6_IS_STUB_ROUTER_V6); + } + } + + return (OSPF6_NOT_STUB_ROUTER); +} + int ospf6_router_lsa_originate (struct thread *thread) { -- cgit v1.2.3