Revision a7a7372a proto/ospf/rt.h

View differences:

proto/ospf/rt.h
2 2
 *      BIRD -- OSPF
3 3
 *
4 4
 *      (c) 2000--2004 Ondrej Filip <feela@network.cz>
5
 *	(c) 2009--2014 Ondrej Zajicek <santiago@crfreenet.org>
6
 *	(c) 2009--2014 CZ.NIC z.s.p.o.
5 7
 *
6 8
 *      Can be freely distributed and used under the terms of the GNU GPL.
7
 *
8 9
 */
9 10

  
10 11
#ifndef _BIRD_OSPF_RT_H_
......
28 29
#define ORTA_ASBR OPT_RT_E
29 30
#define ORTA_ABR  OPT_RT_B
30 31
  /*
31
   * For ORT_NET routes, the field is almost unused with one
32
   * exception: ORTA_PREF for external routes means that the route is
33
   * preferred in AS external route selection according to 16.4.1. -
34
   * it is intra-area path using non-backbone area. In other words,
35
   * the forwarding address (or ASBR if forwarding address is zero) is
36
   * intra-area (type == RTS_OSPF) and its area is not a backbone.
32
   * For ORT_NET routes, there are just several flags for external routes:
33
   *
34
   * ORTA_PREF for external routes means that the route is preferred in AS
35
   * external route selection according to 16.4.1. - it is intra-area path using
36
   * non-backbone area. In other words, the forwarding address (or ASBR if
37
   * forwarding address is zero) is intra-area (type == RTS_OSPF) and its area
38
   * is not a backbone.
39
   *
40
   * ORTA_NSSA means that the entry represents an NSSA route, and ORTA_PROP
41
   * means that the NSSA route has propagate-bit set. These flags are used in
42
   * NSSA translation.
37 43
   */
38 44
#define ORTA_PREF 0x80000000
39 45
#define ORTA_NSSA 0x40000000
......
51 57
}
52 58
orta;
53 59

  
54

  
55
/* Values for fn.flags in struct ort */
56
#define OSPF_RT_PERSISTENT	0x01
57

  
58 60
typedef struct ort
59 61
{
60 62
  /*
61
   * We use OSPF_RT_PERSISTENT to mark persistent rt entries, that are
62
   * needed for summary LSAs that don't have 'proper' rt entry (area
63
   * networks + default to stubs) to keep uid stable (used for LSA ID
64
   * in OSPFv3 - see fibnode_to_lsaid()).
65
   *
66
   * We use ORT_RT_EXPORT and ORT_RT_NSSA to note whether the
67
   * external/NSSA route was originated from the route export (in
68
   * ospf_rt_notify()) or from the NSSA route translation (in
69
   * check_nssa_lsa()).
63
   * Most OSPF routing table entries are for computed OSPF routes, these have
64
   * defined n.type. There are also few other cases: entries for configured area
65
   * networks (these have area_net field set) and entries for external routes
66
   * exported to OSPF (these have external_rte field set). These entries are
67
   * kept even if they do not contain 'proper' rt entry. That is needed to keep
68
   * allocated stable UID numbers (fn.uid), which are used as LSA IDs in OSPFv3
69
   * (see fibnode_to_lsaid()) for related LSAs (network summary LSAs in the
70
   * first case, external or NSSA LSAs in the second case). Entries for external
71
   * routes also have a second purpose - to prevent NSSA translation of received
72
   * NSSA routes if regular external routes were already originated for the same
73
   * network (see check_nssa_lsa()).
70 74
   *
71
   * old_* values are here to represent the last route update. old_rta
72
   * is cached (we keep reference), mainly for multipath nexthops.
73
   * old_rta == NULL means route was not in the last update, in that
74
   * case other old_* values are not valid.
75
   * old_* values are here to represent the last route update. old_rta is cached
76
   * (we keep reference), mainly for multipath nexthops.  old_rta == NULL means
77
   * route was not in the last update, in that case other old_* values are not
78
   * valid.
75 79
   */
76 80
  struct fib_node fn;
77 81
  orta n;
78 82
  u32 old_metric1, old_metric2, old_tag, old_rid;
79 83
  rta *old_rta;
80 84
  u8 external_rte;
85
  u8 area_net;
81 86
}
82 87
ort;
83 88

  
84 89
static inline int rt_is_nssa(ort *nf)
85 90
{ return nf->n.options & ORTA_NSSA; }
86 91

  
87
#define EXT_EXPORT 1
88
#define EXT_NSSA 2
89 92

  
90 93
/*
91 94
 * Invariants for structs top_hash_entry (nodes of LSA db)
......
97 100
 * - beware, nhs is not valid after SPF calculation
98 101
 *
99 102
 * Invariants for structs orta nodes of fib tables po->rtf, oa->rtr:
100
 * - nodes may be invalid (fn.type == 0), in that case other invariants don't hold
103
 * - nodes may be invalid (n.type == 0), in that case other invariants don't hold
101 104
 * - n.metric1 may be at most a small multiple of LSINFINITY,
102 105
 *   therefore sums do not overflow
103 106
 * - n.oa is always non-NULL

Also available in: Unified diff