From 4f559f6cd3a0377391a32a307729479e7081cb16 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Fri, 7 Aug 2009 10:48:15 +0000 Subject: ospfd: Impl. command ip ospf area Use with interface command: interface ppp0 ip ospf area 0.0.0.0 This will enable OSPF on ppp0 with area 0.0.0.0 Remove with "no ip ospf area" --- ospfd/ospf_interface.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ospfd/ospf_interface.h') diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index ab0b7580..c962d74c 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -47,6 +47,7 @@ struct ospf_if_params DECLARE_IF_PARAM (u_int32_t, retransmit_interval); /* Retransmission Interval */ DECLARE_IF_PARAM (u_char, passive_interface); /* OSPF Interface is passive: no sending or receiving (no need to join multicast groups) */ DECLARE_IF_PARAM (u_char, priority); /* OSPF Interface priority */ + DECLARE_IF_PARAM (struct in_addr, if_area); /* Enable OSPF on this interface with area if_area */ DECLARE_IF_PARAM (u_char, type); /* type of interface */ #define OSPF_IF_ACTIVE 0 #define OSPF_IF_PASSIVE 1 -- cgit v1.2.3 From 98dda61bc222aeccb754915954175d3ac8f8768d Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Thu, 13 Aug 2009 15:39:42 +0000 Subject: ospfd: Update SPF calculation for unnumbered links Add support for real unnumbered PtP interfaces in ospf_nexthop_calculation(). Add ospf_if_lookup_by_ifindex() to support Unnumbered PtP links. This version does not support: - Multiple numbered PtP interfaces with the same IP address between the same two routers. - Unnumbered PtP on just one end of the link. * ospfd/ospf_interface.c: Add ospf_if_lookup_by_ifindex(). * ospfd/ospf_interface.h: ditto. * ospfd/ospf_spf.c: ospf_nexthop_calculation (), call ospf_if_lookup_by_ifindex() for Unnumbered PtP links. --- ospfd/ospf_interface.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ospfd/ospf_interface.h') diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index c962d74c..e7823eeb 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -257,7 +257,8 @@ extern struct ospf_interface *ospf_if_lookup_recv_if (struct ospf *, struct interface *); extern struct ospf_interface *ospf_if_is_configured (struct ospf *, struct in_addr *); - +extern struct ospf_interface *ospf_if_lookup_by_ifindex(struct ospf_area *, + unsigned int); extern struct ospf_if_params *ospf_lookup_if_params (struct interface *, struct in_addr); extern struct ospf_if_params *ospf_get_if_params (struct interface *, -- cgit v1.2.3 From 472870f49a5c1eb18bfd30f1b06c1bff08ecd233 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Thu, 13 Aug 2009 15:39:43 +0000 Subject: 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. --- ospfd/ospf_interface.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ospfd/ospf_interface.h') 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 *, -- cgit v1.2.3