Revision 1186369b proto/ospf/rt.c

View differences:

proto/ospf/rt.c
28 28
  f->nhi=NULL;
29 29
}
30 30

  
31
/**
32
 * ospf_rt_spfa - calculate internal routes
33
 * @oa: OSPF area
34
 *
35
 * Calculation of internal paths in area is described in 16.1 of RFC 2328.
36
 * It's based on Dijkstra shortest path tree algorithmus.
37
 * RFC recommends to add ASBR routers into routing table. I don't do this
38
 * and latter parts of routing table calculation looks directly into LSA
39
 * Database. This function is invoked from area_disp().
40
 */
31 41
void
32 42
ospf_rt_spfa(struct ospf_area *oa)
33 43
{
......
38 48
  struct fib *in=&oa->infib;
39 49
  struct infib *nf;
40 50
  struct fib_iterator fit;
41
  bird_clock_t delta;
42 51
  int age=0,flush=0;
43 52
  struct proto *p=&oa->po->proto;
44 53
  struct proto_ospf *po=oa->po;
......
220 229
  
221 230
        a0.proto=p;
222 231
        a0.source=RTS_OSPF;
223
        a0.scope=SCOPE_UNIVERSE;	/* What's this good for? */
232
        a0.scope=SCOPE_UNIVERSE;
224 233
        a0.cast=RTC_UNICAST;
225 234
        if(ipa_to_u32(en->nh)==0) a0.dest=RTD_DEVICE;
226 235
        else a0.dest=RTD_ROUTER;
......
232 241
        e=rte_get_temp(&a0);
233 242
        e->u.ospf.metric1=nf->metric;
234 243
        e->u.ospf.metric2=LSINFINITY;
235
        e->u.ospf.tag=0;			/* FIXME Some config? */
244
        e->u.ospf.tag=0;
236 245
        e->pflags = 0;
237 246
        e->net=ne;
238 247
	e->pref = p->preference;
......
248 257
  ospf_ext_spfa(po);
249 258
}
250 259

  
260
/**
261
 * ospf_ext_spfa - calculate external paths
262
 * @po: protocol
263
 *
264
 * After routing table for any area is calculated, calculation of external
265
 * path is invoked. This process is described in 16.6 of RFC 2328.
266
 * Inter- and Intra-area paths are always prefered over externals.
267
 */
251 268
void
252 269
ospf_ext_spfa(struct proto_ospf *po)	/* FIXME looking into inter-area */
253 270
{
......
454 471
  
455 472
      a0.proto=p;
456 473
      a0.source=RTS_OSPF_EXT;
457
      a0.scope=SCOPE_UNIVERSE;	/* What's this good for? */
474
      a0.scope=SCOPE_UNIVERSE;
458 475
      a0.cast=RTC_UNICAST;
459 476
      a0.dest=RTD_ROUTER;
460 477
      a0.flags=0;

Also available in: Unified diff