From 6384c7d7aa85d1e593eca30cda48f6677b023cb0 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 2 May 2010 19:58:34 +0200 Subject: OSPF: most of summary LSA orig./flush logic rewritten. Fixes many bugs in the old code and makes it much cleaner. --- proto/ospf/rt.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'proto/ospf/rt.h') diff --git a/proto/ospf/rt.h b/proto/ospf/rt.h index 6b23bff..4fc76f4 100644 --- a/proto/ospf/rt.h +++ b/proto/ospf/rt.h @@ -47,12 +47,35 @@ orta; typedef struct ort { + /* + * We use fn.x0 to mark persistent rt entries, that are needed for summary + * LSAs that don't have 'proper' rt entry (area networks + default to stubs) + * to keep uid stable (used for LSA ID in OSPFv3 - see fibnode_to_lsaid()). + */ struct fib_node fn; orta n; orta o; } ort; +/* + * Invariants for structs top_hash_entry (nodes of LSA db) + * enforced by SPF calculation for final nodes (color == INSPF): + * - only router, network and AS-external LSAs + * - lsa.age < LSA_MAXAGE + * - dist < LSINFINITY (or 2*LSINFINITY for ext-LSAs) + * - nhi are non-NULL unless the node is oa->rt (calculating router itself) + * - beware, nhi is not valid after SPF calculation + * - nh is IFA_NONE iff the node is a local network + * + * Invariants for structs orta nodes of fib tables po->rtf, oa->rtr: + * - nodes may be invalid (fn.type == 0), in that case other invariants don't hold + * - n.metric1 may be at most a small multiple of LSINFINITY, + * therefore sums do not overflow + * - n.oa and n.ifa are always non-NULL + * - oa->rtr does not contain calculating router itself + */ + void ospf_rt_spf(struct proto_ospf *po); void ospf_rt_initort(struct fib_node *fn); -- cgit v1.2.3