Statistics
| Branch: | Revision:

iof-bird-daemon / proto / rip / rip.c @ 9607536d

History | View | Annotate | Download (17 KB)

1
/*
2
 *        Rest in pieces - RIP protocol
3
 *
4
 *        Copyright (c) 1998, 1999 Pavel Machek <pavel@ucw.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

    
9
#define LOCAL_DEBUG
10

    
11
#include <string.h>
12
#include <stdlib.h>
13

    
14
#include "nest/bird.h"
15
#include "nest/iface.h"
16
#include "nest/protocol.h"
17
#include "nest/route.h"
18
#include "lib/socket.h"
19
#include "lib/resource.h"
20
#include "lib/lists.h"
21
#include "lib/timer.h"
22

    
23
#include "rip.h"
24

    
25
#define P ((struct rip_proto *) p)
26
#define P_CF ((struct rip_proto_config *)p->cf)
27
#define E ((struct rip_entry *) e)
28

    
29
static void
30
rip_reply(struct proto *p)
31
{
32
#if 0
33
  P->listen->tbuf = "ACK!";
34
  sk_send_to( P->listen, 5, P->listen->faddr, P->listen->fport );
35
#endif
36
}
37

    
38
#define P_NAME p->name
39

    
40
/*
41
 * Output processing
42
 */
43

    
44
static void
45
rip_tx_err( sock *s, int err )
46
{
47
  struct rip_connection *c = s->data;
48
  struct proto *p = c->proto;
49
  log( L_ERR "Unexpected error at rip transmit: %m" );
50
}
51

    
52
static void
53
rip_tx( sock *s )
54
{
55
  struct rip_interface *rif = s->data;
56
  struct rip_connection *c = rif->busy;
57
  struct proto *p = c->proto;
58
  struct rip_packet *packet = (void *) s->tbuf;
59
  int i;
60

    
61
  do {
62

    
63
    if (c->done) {
64
      DBG( "Looks like I'm" );
65
      c->rif->busy = NULL;
66
      rem_node(NODE c);
67
      mb_free(c);
68
      DBG( " done\n" );
69
      return;
70
    }
71

    
72
    DBG( "Preparing packet to send: " );
73

    
74
    packet->heading.command = RIPCMD_RESPONSE;
75
    packet->heading.version = RIP_V2;
76
    packet->heading.unused  = 0;
77

    
78
    i = !!P_CF->authtype;
79
    FIB_ITERATE_START(&P->rtable, &c->iter, z) {
80
      struct rip_entry *e = (struct rip_entry *) z;
81
      DBG( "." );
82
      packet->block[i].family  = htons( 2 ); /* AF_INET */
83
      packet->block[i].tag     = htons( e->tag );
84
      packet->block[i].network = e->n.prefix;
85
      packet->block[i].netmask = ipa_mkmask( e->n.pxlen );
86
      packet->block[i].nexthop = IPA_NONE; /* FIXME: How should I set it? My own IP address? */
87
      packet->block[i].metric  = htonl( e->metric );
88
      if (ipa_equal(e->whotoldme, s->daddr)) {
89
        DBG( "(split horizont)" );
90
        /* FIXME: should we do it in all cases? */
91
        packet->block[i].metric = P_CF->infinity;
92
      }
93
      ipa_hton( packet->block[i].network );
94
      ipa_hton( packet->block[i].netmask );
95
      ipa_hton( packet->block[i].nexthop );
96

    
97
      if (i++ == 25) {
98
        FIB_ITERATE_PUT(&c->iter, z);
99
        goto break_loop;
100
      }
101
    } FIB_ITERATE_END(z);
102
    c->done = 1;
103

    
104
  break_loop:
105

    
106
    if (P_CF->authtype)
107
      rip_outgoing_authentication(p, &packet->block[0], packet, i);
108

    
109
    DBG( ", sending %d blocks, ", i );
110

    
111
    if (ipa_nonzero(c->daddr))
112
      i = sk_send_to( s, sizeof( struct rip_packet_heading ) + i*sizeof( struct rip_block ), c->daddr, c->dport );
113
    else
114
      i = sk_send( s, sizeof( struct rip_packet_heading ) + i*sizeof( struct rip_block ) );
115

    
116
    DBG( "it wants more\n" );
117
  
118
  } while (i>0);
119
  
120
  if (i<0) rip_tx_err( s, i );
121
  DBG( "blocked\n" );
122
}
123

    
124
static void
125
rip_sendto( struct proto *p, ip_addr daddr, int dport, struct rip_interface *rif )
126
{
127
  struct iface *iface = rif->iface;
128
  struct rip_connection *c = mb_alloc( p->pool, sizeof( struct rip_connection ));
129
  static int num = 0;
130

    
131
  if (rif->busy) {
132
    log (L_WARN "Interface %s is much too slow, dropping request", iface->name);
133
    return;
134
  }
135
  rif->busy = c;
136
  
137
  c->addr = daddr;
138
  c->proto = p;
139
  c->num = num++;
140
  c->rif = rif;
141

    
142
  c->dport = dport;
143
  c->daddr = daddr;
144
  if (c->rif->sock->data != rif)
145
    bug("not enough send magic");
146
#if 0
147
  if (sk_open(c->send)<0) {
148
    log( L_ERR "Could not open socket for data send to %I:%d on %s", daddr, dport, rif->iface->name );
149
    return;
150
  }
151
#endif
152

    
153
  c->done = 0;
154
  fit_init( &c->iter, &P->rtable );
155
  add_head( &P->connections, NODE c );
156
  debug( "Sending my routing table to %I:%d on %s\n", daddr, dport, rif->iface->name );
157

    
158
  rip_tx(c->rif->sock);
159
}
160

    
161
static struct rip_interface*
162
find_interface(struct proto *p, struct iface *what)
163
{
164
  struct rip_interface *i;
165

    
166
  WALK_LIST (i, P->interfaces)
167
    if (i->iface == what)
168
      return i;
169
  return NULL;
170
}
171

    
172
/*
173
 * Input processing
174
 */
175

    
176
/* Let main routing table know about our new entry */
177
static void
178
advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme )
179
{
180
  rta *a, A;
181
  rte *r;
182
  net *n;
183
  neighbor *neighbor;
184
  struct rip_interface *rif;
185

    
186
  bzero(&A, sizeof(A));
187
  A.proto = p;
188
  A.source = RTS_RIP;
189
  A.scope = SCOPE_UNIVERSE;
190
  A.cast = RTC_UNICAST;
191
  A.dest = RTD_ROUTER;
192
  A.flags = 0;
193
  A.gw = ipa_nonzero(b->nexthop) ? b->nexthop : whotoldme;
194
  A.from = whotoldme;
195

    
196
  /* FIXME: Check if destination looks valid - ie not net 0 or 127 */
197

    
198
  neighbor = neigh_find( p, &A.gw, 0 );
199
  if (!neighbor) {
200
    log( L_ERR "%I asked me to route %I/%I using not-neighbor %I.", A.from, b->network, b->netmask, A.gw );
201
    return;
202
  }
203

    
204
  A.iface = neighbor->iface;
205
  if (!(rif = neighbor->data)) {
206
    rif = neighbor->data = find_interface(p, A.iface);
207
  }
208
  if (!rif) {
209
    bug("Route packet using unknown interface? No.");
210
    return;
211
  }
212
    
213
  /* set to: interface of nexthop */
214
  a = rta_lookup(&A);
215
  if (ipa_mklen(b->netmask)==-1)  {
216
    log( L_ERR "%I asked me to route %I/%I, but that is not valid netmask.", A.from, b->network, b->netmask );
217
    return;
218
  }
219
  n = net_get( p->table, b->network, ipa_mklen( b->netmask ));
220
  r = rte_get_temp(a);
221
  r->u.rip.metric = ntohl(b->metric) + rif->patt->metric;
222
  if (r->u.rip.metric > P_CF->infinity) r->u.rip.metric = P_CF->infinity;
223
  r->u.rip.tag = ntohl(b->tag);
224
  r->net = n;
225
  r->pflags = 0; /* Here go my flags */
226
  rte_update( p->table, n, p, r );
227
  DBG( "done\n" );
228
}
229

    
230
static void
231
process_block( struct proto *p, struct rip_block *block, ip_addr whotoldme )
232
{
233
  struct rip_entry *e;
234
  int metric = ntohl( block->metric );
235
  ip_addr network = block->network;
236

    
237
  CHK_MAGIC;
238
  if ((!metric) || (metric > P_CF->infinity)) {
239
    log( L_WARN "Got metric %d from %I", metric, whotoldme );
240
    return;
241
  }
242

    
243
  debug( "block: %I tells me: %I/%I available, metric %d... ", whotoldme, network, block->netmask, metric );
244

    
245
  advertise_entry( p, block, whotoldme );
246
}
247

    
248
#define BAD( x ) { log( L_WARN "RIP/%s: " x, P_NAME ); return 1; }
249

    
250
static int
251
rip_process_packet( struct proto *p, struct rip_packet *packet, int num, ip_addr whotoldme, int port )
252
{
253
  int i;
254
  int native_class = 0;
255

    
256
  switch( packet->heading.version ) {
257
  case RIP_V1: DBG( "Rip1: " ); break;
258
  case RIP_V2: DBG( "Rip2: " ); break;
259
  default: BAD( "Unknown version" );
260
  }
261

    
262
  switch( packet->heading.command ) {
263
  case RIPCMD_REQUEST: DBG( "Asked to send my routing table\n" ); 
264
    /* FIXME: should have configurable: ignore always, honour to neighbours, honour always. FIXME: use one global socket for these. FIXME: synchronization - if two ask me at same time */
265
              rip_sendto( p, whotoldme, port, NULL ); /* no broadcast */
266
          break;
267
  case RIPCMD_RESPONSE: DBG( "*** Rtable from %I\n", whotoldme ); 
268
          if (port != P_CF->port) {
269
            log( L_ERR "%I send me routing info from port %d", whotoldme, port );
270
#if 0
271
            return 0;
272
#else
273
            log( L_ERR "...ignoring" );
274
#endif
275
          }
276

    
277
          if (!neigh_find( p, &whotoldme, 0 )) {
278
            log( L_ERR "%I send me routing info but he is not my neighbour", whotoldme );
279
            return 0;
280
          }
281

    
282
          /* FIXME: Should check if it is not my own packet */
283

    
284
          for (i=0; i<num; i++) {
285
            struct rip_block *block = &packet->block[i];
286
            if (block->family == 0xffff)
287
              if (!i) {
288
                if (rip_incoming_authentication(p, block, packet, num))
289
                  BAD( "Authentication failed" );
290
              } else BAD( "Authentication is not the first!" );
291
            ipa_ntoh( block->network );
292
            ipa_ntoh( block->netmask );
293
            ipa_ntoh( block->nexthop );
294
            if (packet->heading.version == RIP_V1) {
295
              block->netmask = block->network; /* MJ: why are macros like this?! */
296
              ipa_class_mask( block->netmask );
297
            }
298
            process_block( p, block, whotoldme );
299
          }
300
          break;
301
  case RIPCMD_TRACEON:
302
  case RIPCMD_TRACEOFF: BAD( "I was asked for traceon/traceoff" );
303
  case 5: BAD( "Some Sun extension around here" );
304
  default: BAD( "Unknown command" );
305
  }
306

    
307
  rip_reply(p);
308
  return 0;
309
}
310

    
311
static int
312
rip_rx(sock *s, int size)
313
{
314
  struct rip_interface *i = s->data;
315
  struct proto *p = i->proto;
316
  int num;
317

    
318
  CHK_MAGIC;
319
  DBG( "RIP: message came: %d bytes\n", size );
320
  size -= sizeof( struct rip_packet_heading );
321
  if (size < 0) BAD( "Too small packet" );
322
  if (size % sizeof( struct rip_block )) BAD( "Odd sized packet" );
323
  num = size / sizeof( struct rip_block );
324
  if (num>25) BAD( "Too many blocks" );
325

    
326
  rip_process_packet( p, (struct rip_packet *) s->rbuf, num, s->faddr, s->fport );
327
  return 1;
328
}
329

    
330
/*
331
 * Interface to rest of bird
332
 */
333

    
334
static void
335
rip_dump_entry( struct rip_entry *e )
336
{
337
  debug( "%I told me %d/%d ago: to %I/%d go via %I, metric %d ", 
338
  e->whotoldme, e->updated-now, e->changed-now, e->n.prefix, e->n.pxlen, e->nexthop, e->metric );
339
  if (e->flags & RIP_F_EXTERNAL) debug( "[external]" );
340
  debug( "\n" );
341
}
342

    
343
static void
344
rip_timer(timer *t)
345
{
346
  struct proto *p = t->data;
347
  struct rip_entry *e, *et;
348

    
349
  CHK_MAGIC;
350
  DBG( "RIP: tick tock\n" );
351
  
352
  WALK_LIST_DELSAFE( e, et, P->garbage ) {
353
    rte *rte;
354
    rte = SKIP_BACK( struct rte, u.rip.garbage, e );
355
    DBG( "Garbage: " ); rte_dump( rte );
356

    
357
    if (now - rte->lastmod > P_CF->garbage_time) {
358
      debug( "RIP: entry is too old: " ); rte_dump( rte );
359
      rte_discard(p->table, rte);
360
    }
361
  }
362

    
363
  DBG( "RIP: Broadcasting routing tables\n" );
364
  {
365
    struct rip_interface *rif;
366

    
367
    WALK_LIST( rif, P->interfaces ) {
368
      struct iface *iface = rif->iface;
369

    
370
      if (!iface) continue;
371
      if (rif->patt->mode & IM_QUIET) continue;
372
      if (!(iface->flags & IF_UP)) continue;
373

    
374
      rip_sendto( p, IPA_NONE, 0, rif );
375
    }
376
  }
377

    
378
  DBG( "RIP: tick tock done\n" );
379
}
380

    
381
static int
382
rip_start(struct proto *p)
383
{
384
  struct rip_interface *rif;
385
  DBG( "RIP: starting instance...\n" );
386

    
387
  P->magic = RIP_MAGIC;
388
  fib_init( &P->rtable, p->pool, sizeof( struct rip_entry ), 0, NULL );
389
  init_list( &P->connections );
390
  init_list( &P->garbage );
391
  init_list( &P->interfaces );
392
  P->timer = tm_new( p->pool );
393
  P->timer->data = p;
394
  P->timer->randomize = 5;
395
  P->timer->recurrent = P_CF->period; 
396
  P->timer->hook = rip_timer;
397
  tm_start( P->timer, 5 );
398
  rif = new_iface(p, NULL, 0, NULL);        /* Initialize dummy interface */
399
  add_head( &P->interfaces, NODE rif );
400
  CHK_MAGIC;
401

    
402
  rip_init_instance(p);
403

    
404
  DBG( "RIP: ...done\n");
405
  return PS_UP;
406
}
407

    
408
static struct proto *
409
rip_init(struct proto_config *cfg)
410
{
411
  struct proto *p = proto_new(cfg, sizeof(struct rip_proto));
412

    
413
  return p;
414
}
415

    
416
static void
417
rip_dump(struct proto *p)
418
{
419
  int i;
420
  node *w, *e;
421
  struct rip_interface *rif;
422
  i = 0;
423

    
424
  CHK_MAGIC;
425
  WALK_LIST( w, P->connections ) {
426
    struct rip_connection *n = (void *) w;
427
    debug( "RIP: connection #%d: %I\n", n->num, n->addr );
428
  }
429
  i = 0;
430
  FIB_WALK( &P->rtable, e ) {
431
    debug( "RIP: entry #%d: ", i++ );
432
    rip_dump_entry( E );
433
  } FIB_WALK_END;
434
  i = 0;
435
  WALK_LIST( rif, P->interfaces ) {
436
    debug( "RIP: interface #%d: %s, %I, busy = %x\n", i++, rif->iface?rif->iface->name:"(dummy)", rif->sock->daddr, rif->busy );
437
  }
438
}
439

    
440
static int
441
rip_want_this_if(struct rip_interface *iface)
442
{
443
  return 1;
444
}
445

    
446
static void
447
kill_iface(struct proto *p, struct rip_interface *i)
448
{
449
  DBG( "RIP: Interface %s disappeared\n", i->iface->name);
450
  rfree(i->sock);
451
  mb_free(i);
452
}
453

    
454
/*
455
 * new maybe null if we are creating initial send socket 
456
 */
457
struct rip_interface *
458
new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_patt *patt )
459
{
460
  struct rip_interface *rif;
461
  int want_multicast = 0;
462

    
463
  rif = mb_allocz(p->pool, sizeof( struct rip_interface ));
464
  rif->iface = new;
465
  rif->proto = p;
466
  rif->busy = NULL;
467
  rif->patt = (struct rip_patt *) patt;
468

    
469
  if (rif->patt)
470
    want_multicast = (!(rif->patt->mode & IM_BROADCAST)) && (flags & IF_MULTICAST);
471
  /* lookup multicasts over unnumbered links - no: rip is not defined over unnumbered links */
472

    
473
  rif->sock = sk_new( p->pool );
474
  rif->sock->type = want_multicast?SK_UDP_MC:SK_UDP;
475
  rif->sock->sport = P_CF->port;
476
  rif->sock->rx_hook = rip_rx;
477
  rif->sock->data = rif;
478
  rif->sock->rbsize = 10240;
479
  rif->sock->iface = new;                /* Automagically works for dummy interface */
480
  rif->sock->tbuf = mb_alloc( p->pool, sizeof( struct rip_packet ));
481
  rif->sock->tx_hook = rip_tx;
482
  rif->sock->err_hook = rip_tx_err;
483
  rif->sock->daddr = IPA_NONE;
484
  rif->sock->dport = P_CF->port;
485
  rif->sock->ttl = 1; /* FIXME: care must be taken not to send requested responses from this socket */
486

    
487
  if (want_multicast)
488
    rif->sock->daddr = ipa_from_u32(0xe0000009);
489
  if (flags & IF_BROADCAST)
490
    rif->sock->daddr = new->addr->brd;
491
  if (flags & IF_UNNUMBERED)        /* Hmm, rip is not defined over unnumbered links */
492
    rif->sock->daddr = new->addr->opposite;
493

    
494
  if (!ipa_nonzero(rif->sock->daddr)) {
495
    log( L_WARN "RIP/%s: interface %s is too strange for me", P_NAME, rif->iface ? rif->iface->name : "(dummy)" );
496
  } else
497
    if (!(rif->patt->mode & IM_NOLISTEN))
498
      if (sk_open(rif->sock)<0)
499
        log( L_WARN "RIP/%s: could not listen on %s", P_NAME, rif->iface ? rif->iface->name : "(dummy)" );
500
  
501
  return rif;
502
}
503

    
504
static void
505
rip_if_notify(struct proto *p, unsigned c, struct iface *iface)
506
{
507
  DBG( "RIP: if notify\n" );
508
  if (iface->flags & IF_IGNORE)
509
    return;
510
  if (c & IF_CHANGE_DOWN) {
511
    struct rip_interface *i;
512
    i = find_interface(p, iface);
513
    if (i) {
514
      rem_node(NODE i);
515
      kill_iface(p, i);
516
    }
517
  }
518
  if (c & IF_CHANGE_UP) {
519
    struct rip_interface *rif;
520
    struct iface_patt *k = iface_patt_match(&P_CF->iface_list, iface);
521

    
522
    if (!k) return; /* We are not interested in this interface */
523
    DBG("adding interface %s\n", iface->name );
524
    rif = new_iface(p, iface, iface->flags, k);
525
    add_head( &P->interfaces, NODE rif );
526
  }
527
}
528

    
529
static struct ea_list *
530
rip_gen_attrs(struct proto *p, struct linpool *pool, int metric, u16 tag)
531
{
532
  struct ea_list *l = lp_alloc(pool, sizeof(struct ea_list) + 2*sizeof(eattr));
533

    
534
  l->next = NULL;
535
  l->flags = EALF_SORTED;
536
  l->count = 2;
537
  l->attrs[0].id = EA_RIP_TAG;
538
  l->attrs[0].flags = 0;
539
  l->attrs[0].type = EAF_TYPE_INT | EAF_INLINE;
540
  l->attrs[0].u.data = tag;
541
  l->attrs[1].id = EA_RIP_TAG;
542
  l->attrs[1].flags = 0;
543
  l->attrs[1].type = EAF_TYPE_INT | EAF_INLINE;
544
  l->attrs[1].u.data = metric;
545
  return l;
546
}
547

    
548
static int
549
rip_import_control(struct proto *p, struct rte **rt, struct ea_list **attrs, struct linpool *pool)
550
{
551
  if ((*rt)->attrs->proto == p)        /* My own must not be touched */
552
    return 1;
553

    
554
  if ((*rt)->attrs->source != RTS_RIP) {
555
    struct ea_list *new = rip_gen_attrs(p, pool, 1, 0);
556
    new->next = *attrs;
557
    *attrs = new;
558
  }
559
  return 0;
560
}
561

    
562
static struct ea_list *
563
rip_make_tmp_attrs(struct rte *rt, struct linpool *pool)
564
{
565
  struct proto *p = rt->attrs->proto;
566
  return rip_gen_attrs(p, pool, rt->u.rip.metric, rt->u.rip.tag);
567
}
568

    
569
static void 
570
rip_store_tmp_attrs(struct rte *rt, struct ea_list *attrs)
571
{
572
  struct proto *p = rt->attrs->proto;
573

    
574
  rt->u.rip.tag = ea_find(attrs, EA_RIP_TAG)->u.data;
575
  rt->u.rip.metric = ea_find(attrs, EA_RIP_TAG)->u.data;
576
}
577

    
578
static void
579
rip_rt_notify(struct proto *p, struct network *net, struct rte *new, struct rte *old, struct ea_list *attrs)
580
{
581
  CHK_MAGIC;
582

    
583
  if (old) {
584
    struct rip_entry *e = fib_find( &P->rtable, &net->n.prefix, net->n.pxlen );
585
    if (!e)
586
      log( L_BUG "Deleting nonexistent entry?!" );
587
    fib_delete( &P->rtable, e );
588
  }
589

    
590
  if (new) {
591
    struct rip_entry *e;
592
    if (fib_find( &P->rtable, &net->n.prefix, net->n.pxlen ))
593
      log( L_BUG "Inserting entry which is already there?" );
594
    e = fib_get( &P->rtable, &net->n.prefix, net->n.pxlen );
595

    
596
    e->nexthop = new->attrs->gw;
597
    e->tag = ea_find(attrs, EA_RIP_TAG)->u.data;
598
    e->metric = ea_find(attrs, EA_RIP_TAG)->u.data;
599
    if (e->metric > P_CF->infinity)
600
      e->metric = P_CF->infinity;
601
    if (!e->metric)
602
      e->metric = 1;
603
    e->whotoldme = new->attrs->from;
604
    e->updated = e->changed = now;
605
    e->flags = 0;
606
  }
607
}
608

    
609
static int
610
rip_rte_better(struct rte *new, struct rte *old)
611
{
612
  if (old->u.rip.metric < new->u.rip.metric)
613
    return 0;
614

    
615
  if (old->u.rip.metric > new->u.rip.metric)
616
    return 1;
617

    
618
  /* FIXME */
619
#define old_metric_is_much_older_than_new_metric 0
620
  if ((old->u.rip.metric == new->u.rip.metric) && (old_metric_is_much_older_than_new_metric))
621
    return 1;
622

    
623
  return 0;
624
}
625

    
626
static void
627
rip_rte_insert(net *net, rte *rte)
628
{
629
  struct proto *p = rte->attrs->proto;
630
  add_head( &P->garbage, &rte->u.rip.garbage );
631
}
632

    
633
static void
634
rip_rte_remove(net *net, rte *rte)
635
{
636
  struct proto *p = rte->attrs->proto;
637
  rem_node( &rte->u.rip.garbage );
638
}
639

    
640
void
641
rip_init_instance(struct proto *p)
642
{
643
  p->preference = DEF_PREF_RIP;
644
  p->if_notify = rip_if_notify;
645
  p->rt_notify = rip_rt_notify;
646
  p->import_control = rip_import_control;
647
  p->rte_better = rip_rte_better;
648
  p->rte_insert = rip_rte_insert;
649
  p->rte_remove = rip_rte_remove;
650
}
651

    
652
void
653
rip_init_config(struct rip_proto_config *c)
654
{
655
  init_list(&c->iface_list);
656
  c->infinity        = 16;
657
  c->port        = 520;
658
  c->period        = 30;
659
  c->garbage_time = 120+180;
660
  c->passwords        = NULL;
661
  c->authtype        = AT_NONE;
662
}
663

    
664
static void
665
rip_preconfig(struct protocol *x, struct config *c)
666
{
667
  DBG( "RIP: preconfig\n" );
668
}
669

    
670
static void
671
rip_postconfig(struct proto_config *c)
672
{
673
}
674

    
675
struct protocol proto_rip = {
676
  name: "RIP",
677
  preconfig: rip_preconfig,
678
  postconfig: rip_postconfig,
679

    
680
  init: rip_init,
681
  dump: rip_dump,
682
  start: rip_start,
683
};