diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2012-07-07 17:06:11 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2012-07-25 18:07:30 +0200 |
commit | c81ee5c94f5b34375f3ef276fdb9bde9098e7ecb (patch) | |
tree | dad1ab0d81b72a7c7a869bc7dc051b703deec9be /ospfd/ospf_interface.h | |
parent | 7b92589c225ae46417fc3fa0714a1b6f53f19c51 (diff) |
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 is possible because
the only time nexthop_calculation needs to look up interfaces
is when dealing with its own Router LSA.
This has the following advantages:
- Multiple PtP interfaces with the same IP address between 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.c: (router_lsa_link_set) record Router 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.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_interface.h')
-rw-r--r-- | ospfd/ospf_interface.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index 6db88773..9de65507 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -127,6 +127,10 @@ struct ospf_interface /* OSPF Area. */ struct ospf_area *area; + /* Position range in Router LSA */ + uint16_t lsa_pos_beg; /* inclusive, >= */ + uint16_t lsa_pos_end; /* exclusive, < */ + /* Interface data from zebra. */ struct interface *ifp; struct ospf_vl_data *vl_data; /* Data for Virtual Link */ @@ -244,6 +248,8 @@ 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 struct ospf_interface *ospf_if_lookup_by_local_addr (struct ospf *, struct interface *, |