summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_interface.h
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2009-08-13 15:39:43 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-04 02:03:42 +0100
commit472870f49a5c1eb18bfd30f1b06c1bff08ecd233 (patch)
tree434c61cb8bb20e909f3ae830f785e277d7d73315 /ospfd/ospf_interface.h
parent98dda61bc222aeccb754915954175d3ac8f8768d (diff)
downloadquagga-472870f49a5c1eb18bfd30f1b06c1bff08ecd233.tar.bz2
quagga-472870f49a5c1eb18bfd30f1b06c1bff08ecd233.tar.xz
ospfd: Optimize and improve SPF nexthop calculation
Maintain router LSA positions in OSPF interface. Find the OSPF interface in nexthop_calculation using the position in the router LSA. This has the following advantages: - Multiple numbered PtP interfaces with the same IP address between the same two routers. - Use Unnumbered PtP on just one end of the link. - Faster OI lookup for the OSPF interface and only done once for PtoP links. *ospf_interface.h: (struct ospf_interface) Add storage for storing router LSA position. *ospf_interface.c: (ospf_if_lookup_by_lsa_pos) lookup OSPF I/F in an area using LSA position. (ospf_lsa_pos_set) assign LSA position to OSPF interface. *ospf_lsa.c: (router_lsa_link_set) Call ospf_lsa_pos_set() to record LSA position. *ospf_spf.c: (ospf_spf_next) Count and pass along lsa position. (ospf_nexthop_calculation) Add lsa position argument. call ospf_if_lookup_by_lsa_pos() for OSFP interface handle. Clean up and remove all calls ospf_if_is_configured() the rest. Adjust a few debug logs.
Diffstat (limited to 'ospfd/ospf_interface.h')
-rw-r--r--ospfd/ospf_interface.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h
index e7823eeb..4541f0b6 100644
--- a/ospfd/ospf_interface.h
+++ b/ospfd/ospf_interface.h
@@ -125,6 +125,10 @@ struct ospf_interface
/* OSPF Area. */
struct ospf_area *area;
+/* Position range in Router LSA */
+ int lsa_pos_beg; /* inclusive, >= */
+ int lsa_pos_end; /* exclusive, < */
+
/* Interface data from zebra. */
struct interface *ifp;
struct ospf_vl_data *vl_data; /* Data for Virtual Link */
@@ -243,6 +247,9 @@ extern int ospf_if_down (struct ospf_interface *);
extern int ospf_if_is_up (struct ospf_interface *);
extern struct ospf_interface *ospf_if_exists (struct ospf_interface *);
+extern struct ospf_interface *ospf_if_lookup_by_lsa_pos (struct ospf_area *,
+ int);
+extern void ospf_lsa_pos_set(int, int, struct ospf_interface *);
extern struct ospf_interface *ospf_if_lookup_by_local_addr (struct ospf *,
struct interface
*,