summaryrefslogtreecommitdiffstats
path: root/proto/ospf/rt.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-08-08 01:45:31 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-08-08 01:45:31 +0200
commited317862c2958303cf541fe63f4ea26d00918a9a (patch)
tree2dd59479e17a3f6107f5e77d459942fe53991ecb /proto/ospf/rt.h
parentaca0e79faa391a2841134dac78a499dfdca68bd9 (diff)
downloadbird-ed317862c2958303cf541fe63f4ea26d00918a9a.tar
bird-ed317862c2958303cf541fe63f4ea26d00918a9a.zip
OSPF NSSA support, inter-area LSA translation.
Diffstat (limited to 'proto/ospf/rt.h')
-rw-r--r--proto/ospf/rt.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/proto/ospf/rt.h b/proto/ospf/rt.h
index bf234f5..cb4b652 100644
--- a/proto/ospf/rt.h
+++ b/proto/ospf/rt.h
@@ -35,6 +35,9 @@ typedef struct orta
* intra-area (type == RTS_OSPF) and its area is not a backbone.
*/
#define ORTA_PREF 0x80000000
+#define ORTA_NSSA 0x40000000
+#define ORTA_PROP 0x20000000
+
u32 metric1;
u32 metric2;
u32 tag;
@@ -43,13 +46,10 @@ typedef struct orta
struct ospf_area *voa; /* Used when route is replaced in ospf_rt_sum_tr(),
NULL otherwise */
struct mpnh *nhs; /* Next hops computed during SPF */
+ struct top_hash_entry *en; /* LSA responsible for this orta */
}
orta;
-// struct ospf_iface *ifa; /* Outgoing interface */
-// ip_addr nh; /* Next hop */
-
-
typedef struct ort
{
/*
@@ -57,6 +57,10 @@ typedef struct ort
* 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()).
*
+ * We use fn.x1 to note whether the external route was originated
+ * from the route export (in ospf_rt_notify()) or from the NSSA
+ * route translation (in check_nssa_lsa()).
+ *
* old_* values are here to represent the last route update. old_rta
* is cached (we keep reference), mainly for multipath nexthops.
* old_rta == NULL means route wasn not in the last update, in that
@@ -69,6 +73,13 @@ typedef struct ort
}
ort;
+static inline int rt_is_nssa(ort *nf)
+{ return nf->n.options & ORTA_NSSA; }
+
+
+#define EXT_EXPORT 1
+#define EXT_NSSA 2
+
/*
* Invariants for structs top_hash_entry (nodes of LSA db)
* enforced by SPF calculation for final nodes (color == INSPF):