Statistics
| Branch: | Revision:

iof-bird-daemon / proto / ospf / iface.c @ 061ab802

History | View | Annotate | Download (15.7 KB)

1
/*
2
 *        BIRD -- OSPF
3
 *
4
 *        (c) 1999--2005 Ondrej Filip <feela@network.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

    
9
#include "ospf.h"
10

    
11
char *ospf_is[] = { "down", "loop", "waiting", "point-to-point", "drother",
12
  "backup", "dr"
13
};
14

    
15
char *ospf_ism[] = { "interface up", "wait timer fired", "backup seen",
16
  "neighbor change", "loop indicated", "unloop indicated", "interface down"
17
};
18

    
19
char *ospf_it[] = { "broadcast", "nbma", "point-to-point", "virtual link" };
20

    
21
static void
22
poll_timer_hook(timer * timer)
23
{
24
  log("POLL!");
25
  ospf_hello_send(timer, 1, NULL);
26
}
27

    
28
static void
29
hello_timer_hook(timer * timer)
30
{
31
  ospf_hello_send(timer, 0, NULL);
32
}
33

    
34
static void
35
wait_timer_hook(timer * timer)
36
{
37
  struct ospf_iface *ifa = (struct ospf_iface *) timer->data;
38
  struct proto *p = &ifa->oa->po->proto;
39

    
40
  OSPF_TRACE(D_EVENTS, "Wait timer fired on interface %s.", ifa->iface->name);
41
  ospf_iface_sm(ifa, ISM_WAITF);
42
}
43

    
44
u32
45
rxbufsize(struct ospf_iface *ifa)
46
{
47
  switch(ifa->rxbuf)
48
  {
49
    case OSPF_RXBUF_NORMAL:
50
      return (ifa->iface->mtu * 2);
51
      break;
52
    case OSPF_RXBUF_LARGE:
53
      return OSPF_MAX_PKT_SIZE;
54
      break;
55
    default:
56
      return ifa->rxbuf;
57
      break;
58
  }
59
}
60

    
61
static sock *
62
ospf_open_ip_socket(struct ospf_iface *ifa)
63
{
64
  sock *ipsk;
65
  struct proto *p = &ifa->oa->po->proto;
66

    
67
  ipsk = sk_new(p->pool);
68
  ipsk->type = SK_IP;
69
  ipsk->dport = OSPF_PROTO;
70

    
71
#ifdef OSPFv2
72
  ipsk->saddr = ifa->iface->addr->ip;
73
#else /* OSPFv3 */
74
  ipsk->saddr = ifa->lladdr;
75
#endif
76

    
77
  ipsk->tos = IP_PREC_INTERNET_CONTROL;
78
  ipsk->ttl = 1;
79
  if (ifa->type == OSPF_IT_VLINK)
80
    ipsk->ttl = 255;
81
  ipsk->rx_hook = ospf_rx_hook;
82
  ipsk->tx_hook = ospf_tx_hook;
83
  ipsk->err_hook = ospf_err_hook;
84
  ipsk->iface = ifa->iface;
85
  ipsk->rbsize = rxbufsize(ifa);
86
  ipsk->tbsize = ifa->iface->mtu;
87
  ipsk->data = (void *) ifa;
88
  if (sk_open(ipsk) != 0)
89
  {
90
    DBG("%s: SK_OPEN: ip open failed.\n", p->name);
91
    return (NULL);
92
  }
93
  DBG("%s: SK_OPEN: ip opened.\n", p->name);
94
  return (ipsk);
95
}
96

    
97

    
98
/**
99
 * ospf_iface_chstate - handle changes of interface state
100
 * @ifa: OSPF interface
101
 * @state: new state
102
 *
103
 * Many actions must be taken according to interface state changes. New network
104
 * LSAs must be originated, flushed, new multicast sockets to listen for messages for
105
 * %ALLDROUTERS have to be opened, etc.
106
 */
107
void
108
ospf_iface_chstate(struct ospf_iface *ifa, u8 state)
109
{
110
  struct proto_ospf *po = ifa->oa->po;
111
  struct proto *p = &po->proto;
112
  u8 oldstate = ifa->state;
113

    
114
  if (oldstate != state)
115
  {
116
    ifa->state = state;
117

    
118
    if (ifa->type == OSPF_IT_VLINK)
119
    {
120
      OSPF_TRACE(D_EVENTS,
121
                 "Changing state of virtual link %R from \"%s\" into \"%s\".",
122
                 ifa->vid, ospf_is[oldstate], ospf_is[state]);
123
      if (state == OSPF_IS_PTP)
124
      {
125
        ifa->ip_sk = ospf_open_ip_socket(ifa);
126
      }
127
    }
128
    else
129
    {
130
      OSPF_TRACE(D_EVENTS,
131
                 "Changing state of iface: %s from \"%s\" into \"%s\".",
132
                 ifa->iface->name, ospf_is[oldstate], ospf_is[state]);
133
      if (ifa->iface->flags & IF_MULTICAST)
134
      {
135
        if ((state == OSPF_IS_BACKUP) || (state == OSPF_IS_DR))
136
        {
137
          if ((ifa->dr_sk == NULL) && (ifa->type != OSPF_IT_NBMA))
138
          {
139
            DBG("%s: Adding new multicast socket for (B)DR\n", p->name);
140
            ifa->dr_sk = sk_new(p->pool);
141
            ifa->dr_sk->type = SK_IP_MC;
142
            ifa->dr_sk->sport = 0;
143
            ifa->dr_sk->dport = OSPF_PROTO;
144

    
145
#ifdef OSPFv2
146
            ifa->dr_sk->saddr = AllDRouters;
147
#else /* OSPFv3 */
148
            ifa->dr_sk->saddr = ifa->lladdr;
149
#endif
150

    
151
            ifa->dr_sk->daddr = AllDRouters;
152
            ifa->dr_sk->tos = IP_PREC_INTERNET_CONTROL;
153
            ifa->dr_sk->ttl = 1;
154
            ifa->dr_sk->rx_hook = ospf_rx_hook;
155
            ifa->dr_sk->tx_hook = ospf_tx_hook;
156
            ifa->dr_sk->err_hook = ospf_err_hook;
157
            ifa->dr_sk->iface = ifa->iface;
158
            ifa->dr_sk->rbsize = rxbufsize(ifa);
159
            ifa->dr_sk->tbsize = ifa->iface->mtu;
160
            ifa->dr_sk->data = (void *) ifa;
161
            if (sk_open(ifa->dr_sk) != 0)
162
            {
163
              DBG("%s: SK_OPEN: new? mc open failed.\n", p->name);
164
            }
165
          }
166
        }
167
        else
168
        {
169
          rfree(ifa->dr_sk);
170
          ifa->dr_sk = NULL;
171
        }
172
        if ((oldstate == OSPF_IS_DR) && (ifa->net_lsa != NULL))
173
        {
174
          ifa->net_lsa->lsa.age = LSA_MAXAGE;
175
          if (state >= OSPF_IS_WAITING)
176
          {
177
            ospf_lsupd_flush_nlsa(po, ifa->net_lsa);
178
          }
179
          if (can_flush_lsa(po))
180
            flush_lsa(ifa->net_lsa, po);
181
          ifa->net_lsa = NULL;
182
        }
183
      }
184
    }
185
  }
186
}
187

    
188
static void
189
ospf_iface_down(struct ospf_iface *ifa)
190
{
191
  struct ospf_neighbor *n, *nx;
192
  struct proto_ospf *po = ifa->oa->po;
193
  struct proto *p = &po->proto;
194
  struct ospf_iface *iff;
195

    
196
  /* First of all kill all the related vlinks */
197
  if (ifa->type != OSPF_IT_VLINK)
198
  {
199
    WALK_LIST(iff, po->iface_list)
200
    {
201
      if ((iff->type == OSPF_IT_VLINK) && (iff->iface == ifa->iface))
202
        ospf_iface_down(iff);
203
    }
204
  }
205

    
206
  WALK_LIST_DELSAFE(n, nx, ifa->neigh_list)
207
  {
208
    OSPF_TRACE(D_EVENTS, "Removing neighbor %I", n->ip);
209
    ospf_neigh_remove(n);
210
  }
211
  rfree(ifa->hello_sk);
212
  rfree(ifa->dr_sk);
213
  rfree(ifa->ip_sk);
214

    
215
  if (ifa->type == OSPF_IT_VLINK)
216
  {
217
    ifa->ip_sk = NULL;
218
    ifa->iface = NULL;
219
    return;
220
  }
221
  else
222
  {
223
    rfree(ifa->wait_timer);
224
    rfree(ifa->hello_timer);
225
    rfree(ifa->poll_timer);
226
    rfree(ifa->lock);
227
    rem_node(NODE ifa);
228
    mb_free(ifa);
229
  }
230
}
231

    
232
/**
233
 * ospf_iface_sm - OSPF interface state machine
234
 * @ifa: OSPF interface
235
 * @event: event comming to state machine
236
 *
237
 * This fully respects 9.3 of RFC 2328 except we don't use %LOOP state of
238
 * interface.
239
 */
240
void
241
ospf_iface_sm(struct ospf_iface *ifa, int event)
242
{
243
  struct ospf_area *oa = ifa->oa;
244

    
245
  DBG("SM on iface %s. Event is '%s'\n", ifa->iface->name, ospf_ism[event]);
246

    
247
  switch (event)
248
  {
249
  case ISM_UP:
250
    if (ifa->state == OSPF_IS_DOWN)
251
    {
252
      /* Now, nothing should be adjacent */
253
      if ((ifa->type == OSPF_IT_PTP) || (ifa->type == OSPF_IT_VLINK))
254
      {
255
        ospf_iface_chstate(ifa, OSPF_IS_PTP);
256
      }
257
      else
258
      {
259
        if (ifa->priority == 0)
260
          ospf_iface_chstate(ifa, OSPF_IS_DROTHER);
261
        else
262
        {
263
          ospf_iface_chstate(ifa, OSPF_IS_WAITING);
264
          tm_start(ifa->wait_timer, ifa->waitint);
265
        }
266
      }
267

    
268
      tm_start(ifa->hello_timer, ifa->helloint);
269

    
270
      if (ifa->poll_timer)
271
        tm_start(ifa->poll_timer, ifa->pollint);
272

    
273
      hello_timer_hook(ifa->hello_timer);
274
    }
275
    schedule_rt_lsa(ifa->oa);
276
    break;
277
  case ISM_BACKS:
278
  case ISM_WAITF:
279
    if (ifa->state == OSPF_IS_WAITING)
280
    {
281
      bdr_election(ifa);
282
    }
283
    break;
284
  case ISM_NEICH:
285
    if ((ifa->state == OSPF_IS_DROTHER) || (ifa->state == OSPF_IS_DR) ||
286
        (ifa->state == OSPF_IS_BACKUP))
287
    {
288
      bdr_election(ifa);
289
      schedule_rt_lsa(ifa->oa);
290
    }
291
    break;
292
  case ISM_DOWN:
293
    ospf_iface_chstate(ifa, OSPF_IS_DOWN);
294
    ospf_iface_down(ifa);
295
    schedule_rt_lsa(oa);
296
    break;
297
  case ISM_LOOP:                /* Useless? */
298
    ospf_iface_chstate(ifa, OSPF_IS_LOOP);
299
    ospf_iface_down(ifa);
300
    schedule_rt_lsa(ifa->oa);
301
    break;
302
  case ISM_UNLOOP:
303
    ospf_iface_chstate(ifa, OSPF_IS_DOWN);
304
    schedule_rt_lsa(ifa->oa);
305
    break;
306
  default:
307
    bug("OSPF_I_SM - Unknown event?");
308
    break;
309
  }
310

    
311
}
312

    
313
static sock *
314
ospf_open_mc_socket(struct ospf_iface *ifa)
315
{
316
  sock *mcsk;
317
  struct proto *p = &ifa->oa->po->proto;
318

    
319
  mcsk = sk_new(p->pool);
320
  mcsk->type = SK_IP_MC;
321
  mcsk->sport = 0;
322
  mcsk->dport = OSPF_PROTO;
323

    
324
#ifdef OSPFv2
325
  mcsk->saddr = AllDRouters;
326
#else /* OSPFv3 */
327
  mcsk->saddr = ifa->lladdr;
328
#endif
329

    
330
  mcsk->daddr = AllSPFRouters;
331
  mcsk->tos = IP_PREC_INTERNET_CONTROL;
332
  mcsk->ttl = 1;
333
  mcsk->rx_hook = ospf_rx_hook;
334
  mcsk->tx_hook = ospf_tx_hook;
335
  mcsk->err_hook = ospf_err_hook;
336
  mcsk->iface = ifa->iface;
337
  mcsk->rbsize = rxbufsize(ifa);
338
  mcsk->tbsize = ifa->iface->mtu;
339
  mcsk->data = (void *) ifa;
340
  if (sk_open(mcsk) != 0)
341
  {
342
    DBG("%s: SK_OPEN: mc open failed.\n", p->name);
343
    return (NULL);
344
  }
345
  DBG("%s: SK_OPEN: mc opened.\n", p->name);
346
  return (mcsk);
347
}
348

    
349
u8
350
ospf_iface_clasify(struct iface * ifa)
351
{
352
  if ((ifa->flags & (IF_MULTIACCESS | IF_MULTICAST)) ==
353
      (IF_MULTIACCESS | IF_MULTICAST))
354
    return OSPF_IT_BCAST;
355

    
356
  if ((ifa->flags & (IF_MULTIACCESS | IF_MULTICAST)) == IF_MULTIACCESS)
357
    return OSPF_IT_NBMA;
358

    
359
  return OSPF_IT_PTP;
360
}
361

    
362
struct ospf_iface *
363
ospf_iface_find(struct proto_ospf *p, struct iface *what)
364
{
365
  struct ospf_iface *i;
366

    
367
  WALK_LIST(i, p->iface_list) if ((i->iface == what) && (i->type != OSPF_IT_VLINK))
368
    return i;
369
  return NULL;
370
}
371

    
372
static void
373
ospf_iface_add(struct object_lock *lock)
374
{
375
  struct ospf_iface *ifa = lock->data;
376
  struct proto_ospf *po = ifa->oa->po;
377
  struct proto *p = &po->proto;
378
  struct iface *iface = lock->iface;
379

    
380
  ifa->lock = lock;
381

    
382
  ifa->ioprob = OSPF_I_OK;
383

    
384
  if (ifa->type != OSPF_IT_NBMA)
385
  {
386
    if ((ifa->hello_sk = ospf_open_mc_socket(ifa)) == NULL)
387
    {
388
      log("%s: Huh? could not open mc socket on interface %s?", p->name,
389
          iface->name);
390
      log("%s: Declaring as stub.", p->name);
391
      ifa->stub = 1;
392
      ifa->ioprob += OSPF_I_MC;
393
    }
394
    ifa->dr_sk = NULL;
395
  }
396

    
397
  if ((ifa->ip_sk = ospf_open_ip_socket(ifa)) == NULL)
398
  {
399
    log("%s: Huh? could not open ip socket on interface %s?", p->name,
400
        iface->name);
401
    log("%s: Declaring as stub.", p->name);
402
    ifa->stub = 1;
403
    ifa->ioprob += OSPF_I_IP;
404
  }
405

    
406
  ifa->state = OSPF_IS_DOWN;
407
  ospf_iface_sm(ifa, ISM_UP);
408
}
409

    
410
void
411
ospf_iface_new(struct proto_ospf *po, struct iface *iface,
412
               struct ospf_area_config *ac, struct ospf_iface_patt *ip)
413
{
414
  struct proto *p = &po->proto;
415
  struct ospf_iface *ifa;
416
  struct nbma_node *nbma, *nb;
417
  struct object_lock *lock;
418
  struct ospf_area *oa;
419

    
420
  ifa = mb_allocz(p->pool, sizeof(struct ospf_iface));
421
  ifa->iface = iface;
422

    
423
  ifa->cost = ip->cost;
424
  ifa->rxmtint = ip->rxmtint;
425
  ifa->inftransdelay = ip->inftransdelay;
426
  ifa->priority = ip->priority;
427
  ifa->helloint = ip->helloint;
428
  ifa->pollint = ip->pollint;
429
  ifa->strictnbma = ip->strictnbma;
430
  ifa->waitint = ip->waitint;
431
  ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead;
432
  ifa->stub = ip->stub;
433

    
434
#ifdef OSPFv2
435
  ifa->autype = ip->autype;
436
  ifa->passwords = ip->passwords;
437
#endif
438

    
439
#ifdef OSPFv3
440
  ifa->instance_id = ip->instance_id;
441

    
442
  ifa->lladdr = IPA_NONE;
443

    
444
  /* Find link-local address */
445
  if (ifa->type != OSPF_IT_VLINK)
446
    {
447
      struct ifa *a;
448
      WALK_LIST(a, iface->addrs)
449
        if (a->scope == SCOPE_LINK)
450
          {
451
            ifa->lladdr = a->ip;
452
            break;
453
          }
454

    
455
      if (! ipa_nonzero(ifa->lladdr))
456
        log(L_WARN "%s: Missing link local address on interface %s", p->name,  iface->name);
457
    }
458
#endif
459

    
460
  ifa->rxbuf = ip->rxbuf;
461

    
462
  if (ip->type == OSPF_IT_UNDEF)
463
    ifa->type = ospf_iface_clasify(ifa->iface);
464
  else
465
    ifa->type = ip->type;
466

    
467
  init_list(&ifa->neigh_list);
468
  init_list(&ifa->nbma_list);
469

    
470
  WALK_LIST(nb, ip->nbma_list)
471
  {
472
    nbma = mb_alloc(p->pool, sizeof(struct nbma_node));
473
    nbma->ip = nb->ip;
474
    nbma->eligible = nb->eligible;
475
    add_tail(&ifa->nbma_list, NODE nbma);
476
  }
477

    
478
  /* Add hello timer */
479
  ifa->hello_timer = tm_new(p->pool);
480
  ifa->hello_timer->data = ifa;
481
  ifa->hello_timer->randomize = 0;
482
  ifa->hello_timer->hook = hello_timer_hook;
483
  ifa->hello_timer->recurrent = ifa->helloint;
484
  DBG("%s: Installing hello timer. (%u)\n", p->name, ifa->helloint);
485

    
486
  if (ifa->type == OSPF_IT_NBMA)
487
  {
488
    ifa->poll_timer = tm_new(p->pool);
489
    ifa->poll_timer->data = ifa;
490
    ifa->poll_timer->randomize = 0;
491
    ifa->poll_timer->hook = poll_timer_hook;
492
    ifa->poll_timer->recurrent = ifa->pollint;
493
    DBG("%s: Installing poll timer. (%u)\n", p->name, ifa->pollint);
494
  }
495
  else
496
    ifa->poll_timer = NULL;
497

    
498
  ifa->wait_timer = tm_new(p->pool);
499
  ifa->wait_timer->data = ifa;
500
  ifa->wait_timer->randomize = 0;
501
  ifa->wait_timer->hook = wait_timer_hook;
502
  ifa->wait_timer->recurrent = 0;
503
  DBG("%s: Installing wait timer. (%u)\n", p->name, ifa->waitint);
504
  add_tail(&((struct proto_ospf *) p)->iface_list, NODE ifa);
505
  ifa->state = OSPF_IS_DOWN;
506

    
507
  ifa->oa = NULL;
508
  WALK_LIST(oa, po->area_list)
509
  {
510
    if (oa->areaid == ac->areaid)
511
    {
512
      ifa->oa = oa;
513
      break;
514
    }
515
  }
516

    
517
  if (!ifa->oa)
518
    bug("Cannot add any area to accepted Interface");
519
  else
520

    
521
  if (ifa->type == OSPF_IT_VLINK)
522
  {
523
    ifa->oa = po->backbone;
524
    ifa->voa = oa;
525
    ifa->vid = ip->vid;
526
    return;                        /* Don't lock, don't add sockets */
527
  }
528

    
529
  lock = olock_new(p->pool);
530
  lock->addr = AllSPFRouters;
531
  lock->type = OBJLOCK_IP;
532
  lock->port = OSPF_PROTO;
533
  lock->iface = iface;
534
  lock->data = ifa;
535
  lock->hook = ospf_iface_add;
536

    
537
  olock_acquire(lock);
538
}
539

    
540
void
541
ospf_iface_change_mtu(struct proto_ospf *po, struct ospf_iface *ifa)
542
{
543
  struct proto *p = &po->proto;
544
  struct ospf_packet *op;
545
  struct ospf_neighbor *n;
546
  OSPF_TRACE(D_EVENTS, "Changing MTU on interface %s.", ifa->iface->name);
547
  if (ifa->hello_sk)
548
  {
549
    ifa->hello_sk->rbsize = rxbufsize(ifa);
550
    ifa->hello_sk->tbsize = ifa->iface->mtu;
551
    sk_reallocate(ifa->hello_sk);
552
  }
553
  if (ifa->dr_sk)
554
  {
555
    ifa->dr_sk->rbsize = rxbufsize(ifa);
556
    ifa->dr_sk->tbsize = ifa->iface->mtu;
557
    sk_reallocate(ifa->dr_sk);
558
  }
559
  if (ifa->ip_sk)
560
  {
561
    ifa->ip_sk->rbsize = rxbufsize(ifa);
562
    ifa->ip_sk->tbsize = ifa->iface->mtu;
563
    sk_reallocate(ifa->ip_sk);
564
  }
565

    
566
  WALK_LIST(n, ifa->neigh_list)
567
  {
568
    op = (struct ospf_packet *) n->ldbdes;
569
    n->ldbdes = mb_allocz(n->pool, ifa->iface->mtu);
570

    
571
    if (ntohs(op->length) <= ifa->iface->mtu)        /* If the packet in old buffer is bigger, let it filled by zeros */
572
      memcpy(n->ldbdes, op, ifa->iface->mtu);        /* If the packet is old is same or smaller, copy it */
573

    
574
    rfree(op);
575
  }
576
}
577

    
578
void
579
ospf_iface_notify(struct proto *p, unsigned flags, struct iface *iface)
580
{
581
  struct proto_ospf *po = (struct proto_ospf *) p;
582
  struct ospf_config *c = (struct ospf_config *) (p->cf);
583
  struct ospf_area_config *ac;
584
  struct ospf_iface_patt *ip = NULL;
585
  struct ospf_iface *ifa;
586

    
587
  DBG("%s: If notify called\n", p->name);
588
  if (iface->flags & IF_IGNORE)
589
    return;
590

    
591
  if (flags & IF_CHANGE_UP)
592
  {
593
    WALK_LIST(ac, c->area_list)
594
    {
595
      if (ip = (struct ospf_iface_patt *)
596
          iface_patt_find(&ac->patt_list, iface))
597
        break;
598
    }
599

    
600
    if (ip)
601
    {
602
      OSPF_TRACE(D_EVENTS, "Using interface %s.", iface->name);
603
      ospf_iface_new(po, iface, ac, ip);
604
    }
605
  }
606

    
607
  if (flags & IF_CHANGE_DOWN)
608
  {
609
    if ((ifa = ospf_iface_find((struct proto_ospf *) p, iface)) != NULL)
610
    {
611
      OSPF_TRACE(D_EVENTS, "Killing interface %s.", iface->name);
612
      ospf_iface_sm(ifa, ISM_DOWN);
613
    }
614
  }
615

    
616
  if (flags & IF_CHANGE_MTU)
617
  {
618
    if ((ifa = ospf_iface_find((struct proto_ospf *) p, iface)) != NULL)
619
      ospf_iface_change_mtu(po, ifa);
620
  }
621
}
622

    
623
void
624
ospf_iface_info(struct ospf_iface *ifa)
625
{
626
  char *strict = "(strict)";
627

    
628
  if ((ifa->type != OSPF_IT_NBMA) || (ifa->strictnbma == 0))
629
    strict = "";
630
  if (ifa->type == OSPF_IT_VLINK)
631
  {
632
    cli_msg(-1015, "Virtual link to %R:", ifa->vid);
633
    cli_msg(-1015, "\tTransit area: %R (%u)", ifa->voa->areaid,
634
            ifa->voa->areaid);
635
  }
636
  else
637
  {
638
    cli_msg(-1015, "Interface \"%s\":",
639
            (ifa->iface ? ifa->iface->name : "(none)"));
640
    cli_msg(-1015, "\tType: %s %s", ospf_it[ifa->type], strict);
641
    cli_msg(-1015, "\tArea: %R (%u)", ifa->oa->areaid, ifa->oa->areaid);
642
  }
643
  cli_msg(-1015, "\tState: %s %s", ospf_is[ifa->state],
644
          ifa->stub ? "(stub)" : "");
645
  cli_msg(-1015, "\tPriority: %u", ifa->priority);
646
  cli_msg(-1015, "\tCost: %u", ifa->cost);
647
  cli_msg(-1015, "\tHello timer: %u", ifa->helloint);
648

    
649
  if (ifa->type == OSPF_IT_NBMA)
650
  {
651
    cli_msg(-1015, "\tPoll timer: %u", ifa->pollint);
652
  }
653
  cli_msg(-1015, "\tWait timer: %u", ifa->waitint);
654
  cli_msg(-1015, "\tDead timer: %u", ifa->dead);
655
  cli_msg(-1015, "\tRetransmit timer: %u", ifa->rxmtint);
656
  if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA))
657
  {
658
    cli_msg(-1015, "\tDesigned router (ID): %R", ifa->drid);
659
    cli_msg(-1015, "\tDesigned router (IP): %I", ifa->drip);
660
    cli_msg(-1015, "\tBackup designed router (ID): %R", ifa->bdrid);
661
    cli_msg(-1015, "\tBackup designed router (IP): %I", ifa->bdrip);
662
  }
663
}
664

    
665
void
666
ospf_iface_shutdown(struct ospf_iface *ifa)
667
{
668
  init_list(&ifa->neigh_list);
669
  hello_timer_hook(ifa->hello_timer);
670
}