diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-05-02 19:58:34 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-05-02 19:58:34 +0200 |
commit | 6384c7d7aa85d1e593eca30cda48f6677b023cb0 (patch) | |
tree | 6c926854e331ab87fe98d6dca9c95c708843a086 /proto/ospf/rt.h | |
parent | ba321706578de8402d50214a9e79a65835cdd821 (diff) |
OSPF: most of summary LSA orig./flush logic rewritten.
Fixes many bugs in the old code and makes it much cleaner.
Diffstat (limited to 'proto/ospf/rt.h')
-rw-r--r-- | proto/ospf/rt.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/proto/ospf/rt.h b/proto/ospf/rt.h index 6b23bffe..4fc76f44 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); |