Revision e81b440f

View differences:

client/client.c
311 311
    }
312 312

  
313 313
  if (nstate == STATE_PROMPT)
314
    if (input_initialized)
315
      input_reveal();
316
    else
317
      input_init();
314
    {
315
      if (input_initialized)
316
	input_reveal();
317
      else
318
	input_init();
319
    }
318 320

  
319 321
  if (nstate != STATE_PROMPT)
320 322
    input_hide();
......
372 374
    die("fcntl: %m");
373 375
}
374 376

  
377
#define PRINTF(LEN, PARGS...) do { if (!skip_input) len = printf(PARGS); } while(0)
378

  
375 379
static void
376 380
server_got_reply(char *x)
377 381
{
......
379 383
  int len = 0;
380 384

  
381 385
  if (*x == '+')			/* Async reply */
382
    skip_input || (len = printf(">>> %s\n", x+1));
386
    PRINTF(len, ">>> %s\n", x+1);
383 387
  else if (x[0] == ' ')			/* Continuation */
384
    skip_input || (len = printf("%s%s\n", verbose ? "     " : "", x+1));
388
    PRINTF(len, "%s%s\n", verbose ? "     " : "", x+1);
385 389
  else if (strlen(x) > 4 &&
386 390
	   sscanf(x, "%d", &code) == 1 && code >= 0 && code < 10000 &&
387 391
	   (x[4] == ' ' || x[4] == '-'))
388 392
    {
389 393
      if (code)
390
	skip_input || (len = printf("%s\n", verbose ? x : x+5));
394
	PRINTF(len, "%s\n", verbose ? x : x+5);
391 395
      if (x[4] == ' ')
392 396
      {
393 397
	nstate = STATE_PROMPT;
......
396 400
      }
397 401
    }
398 402
  else
399
    skip_input || (len = printf("??? <%s>\n", x));
403
    PRINTF(len, "??? <%s>\n", x);
400 404

  
401 405
  if (skip_input)
402 406
    return;
conf/gen_keywords.m4
23 23
m4_define(CF_DEFINES, `m4_divert(-1)')
24 24

  
25 25
# Keywords are translated to C initializers
26
m4_define(CF_handle_kw, `m4_divert(1){ "m4_translit($1,[[A-Z]],[[a-z]])", $1 },
26
m4_define(CF_handle_kw, `m4_divert(1){ "m4_translit($1,[[A-Z]],[[a-z]])", $1, NULL },
27 27
m4_divert(-1)')
28 28
m4_define(CF_keywd, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)CF_handle_kw($1)]])')
29 29
m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token[[]]CF_toks
......
34 34
')
35 35

  
36 36
# Enums are translated to C initializers: use CF_ENUM(typename, prefix, values)
37
m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix[[]]$1) },
37
m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix[[]]$1), NULL },
38 38
m4_divert(-1)')
39 39
m4_define(CF_ENUM, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix]],$2)CF_iterate([[CF_enum]], [[m4_shift(m4_shift($@))]])DNL')
40 40

  
......
42 42
m4_m4wrap(`
43 43
m4_divert(0)
44 44
static struct keyword keyword_list[] = {
45
m4_undivert(1){ NULL, -1 } };
45
m4_undivert(1){ NULL, -1, NULL } };
46 46
')
47 47

  
48 48
# As we are processing C source, we must access all M4 primitives via
configure.in
8 8

  
9 9
AC_ARG_ENABLE(debug,[  --enable-debug          enable internal debugging routines (default: disabled)],,enable_debug=no)
10 10
AC_ARG_ENABLE(memcheck,[  --enable-memcheck       check memory allocations when debugging (default: enabled)],,enable_memcheck=yes)
11
AC_ARG_ENABLE(warnings,[  --enable-warnings       enable extra warnings (default: disabled)],,enable_warnings=no)
12 11
AC_ARG_ENABLE(client,[  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
13 12
AC_ARG_ENABLE(ipv6,[  --enable-ipv6           enable building of IPv6 version (default: disabled)],,enable_ipv6=no)
14 13
AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
......
56 55

  
57 56
AC_CANONICAL_HOST
58 57

  
59
AC_PROG_CC
60
if test -z "$GCC" ; then
61
	AC_MSG_ERROR([This program requires the GNU C Compiler.])
62
	fi
63 58
AC_MSG_CHECKING([what CFLAGS should we use])
64 59
if test "$ac_test_CFLAGS" != set ; then
65
	if test "$enable_warnings" = yes ; then
66
		WARNS=" -Wmissing-prototypes -Wundef"
67
	else
68
		WARNS=" -Wno-unused"
69
	fi
70
	CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-pointer-sign -Wno-parentheses$WARNS"
71
fi
72
if test "$with_sysinclude" != no -a -n "$with_sysinclude"; then
73
	CPPFLAGS="$CPPFLAGS -I$with_sysinclude"
60
	CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wno-pointer-sign -Wno-parentheses"
74 61
fi
75 62
AC_MSG_RESULT($CFLAGS)
76 63

  
64
AC_PROG_CC
65
if test -z "$GCC" ; then
66
	AC_MSG_ERROR([This program requires the GNU C Compiler.])
67
fi
68

  
77 69
AC_PROG_CPP
78 70
AC_PROG_INSTALL
79 71
AC_PROG_RANLIB
lib/event.c
49 49
  "Event",
50 50
  sizeof(event),
51 51
  (void (*)(resource *)) ev_postpone,
52
  ev_dump
52
  ev_dump,
53
  NULL
53 54
};
54 55

  
55 56
/**
lib/ip.h
46 46

  
47 47
struct prefix {
48 48
  ip_addr addr;
49
  int len;
49
  unsigned int len;
50 50
};
51 51

  
52 52
#define ip_is_prefix(a,l) (!ipa_nonzero(ipa_and(a, ipa_not(ipa_mkmask(l)))))
lib/ipv4.h
72 72
u32 ipv4_class_mask(u32);
73 73
byte *ipv4_skip_header(byte *, int *);
74 74

  
75
static inline int ipv4_has_link_scope(u32 a)
75
static inline int ipv4_has_link_scope(u32 a UNUSED)
76 76
{
77 77
  return 0;
78 78
}
lib/socket.h
66 66
int sk_set_ipv6_checksum(sock *s, int offset);
67 67
#endif
68 68

  
69
int sk_set_broadcast(sock *s, int enable);
70

  
69 71
static inline int
70 72
sk_send_buffer_empty(sock *sk)
71 73
{
nest/a-path.c
385 385
  struct pm_pos pos[2048 + 1];
386 386
  int plen = parse_path(path, pos);
387 387
  int l, h, i, nh, nl;
388
  u32 val;
388
  u32 val = 0;
389 389

  
390 390
  /* l and h are bound of interval of positions where
391 391
     are marked states */
......
417 417
	  goto step;
418 418
	case PM_QUESTION:
419 419
	step:
420
	  nh = -1;
420
	  nh = nl = -1;
421 421
	  for (i = h; i >= l; i--)
422 422
	    if (pos[i].mark)
423 423
	      {
nest/cli.c
357 357
	free = (c->ring_end - c->ring_buf) - (c->ring_write - c->ring_read + 1);
358 358
      else
359 359
	free = c->ring_read - c->ring_write - 1;
360
      if (len > free ||
361
	  free < c->log_threshold && class < (unsigned) L_INFO[0])
360
      if ((len > free) ||
361
	  (free < c->log_threshold && class < (unsigned) L_INFO[0]))
362 362
	{
363 363
	  c->ring_overflow++;
364 364
	  continue;
nest/locks.c
97 97
  "ObjLock",
98 98
  sizeof(struct object_lock),
99 99
  olock_free,
100
  olock_dump
100
  olock_dump,
101
  NULL
101 102
};
102 103

  
103 104
/**
nest/proto.c
51 51
static void
52 52
proto_relink(struct proto *p)
53 53
{
54
  list *l;
54
  list *l = NULL;
55 55

  
56 56
  if (p->debug & D_STATES)
57 57
    {
nest/rt-table.c
158 158
}
159 159

  
160 160
static inline void
161
do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old, ea_list *tmpa, int class, int refeed)
161
do_rte_announce(struct announce_hook *a, int type UNUSED, net *net, rte *new, rte *old, ea_list *tmpa, int class, int refeed)
162 162
{
163 163
  struct proto *p = a->proto;
164 164
  struct filter *filter = p->out_filter;
......
196 196
	}
197 197
      else if (ok)
198 198
	rte_trace_out(D_FILTERS, p, new, "forced accept by protocol");
199
      else if (filter == FILTER_REJECT ||
200
	       filter && f_run(filter, &new, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
199
      else if ((filter == FILTER_REJECT) ||
200
	       (filter && f_run(filter, &new, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
201 201
	{
202 202
	  stats->exp_updates_filtered++;
203 203
	  drop_reason = "filtered out";
......
329 329
 * the protocol gets called.
330 330
 */
331 331
static void
332
rte_announce(rtable *tab, int type, net *net, rte *new, rte *old, ea_list *tmpa)
332
rte_announce(rtable *tab, unsigned type, net *net, rte *new, rte *old, ea_list *tmpa)
333 333
{
334 334
  struct announce_hook *a;
335 335
  int class = ipa_classify(net->n.prefix);
......
1203 1203
		 'configure soft' command may change the export filter
1204 1204
		 and do not update routes */
1205 1205

  
1206
	      if (p1->out_filter == FILTER_REJECT ||
1207
		  p1->out_filter && f_run(p1->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
1206
	      if ((p1->out_filter == FILTER_REJECT) ||
1207
		  (p1->out_filter && f_run(p1->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
1208 1208
		ok = 0;
1209 1209
	    }
1210 1210
	}
proto/bgp/attrs.c
47 47
}
48 48

  
49 49
static void
50
bgp_format_origin(eattr *a, byte *buf, int buflen)
50
bgp_format_origin(eattr *a, byte *buf, int buflen UNUSED)
51 51
{
52 52
  static char *bgp_origin_names[] = { "IGP", "EGP", "Incomplete" };
53 53

  
......
257 257
    NULL, NULL },
258 258
  { "cluster_list", -1, BAF_OPTIONAL, EAF_TYPE_INT_SET, 0,			/* BA_CLUSTER_LIST */
259 259
    bgp_check_cluster_list, bgp_format_cluster_list }, 
260
  { NULL, },									/* BA_DPA */
261
  { NULL, },									/* BA_ADVERTISER */
262
  { NULL, },									/* BA_RCID_PATH */
260
  { .name = NULL },								/* BA_DPA */
261
  { .name = NULL },									/* BA_ADVERTISER */
262
  { .name = NULL },									/* BA_RCID_PATH */
263 263
  { "mp_reach_nlri", -1, BAF_OPTIONAL, EAF_TYPE_OPAQUE, 1,			/* BA_MP_REACH_NLRI */
264 264
    bgp_check_reach_nlri, NULL },
265 265
  { "mp_unreach_nlri", -1, BAF_OPTIONAL, EAF_TYPE_OPAQUE, 1,			/* BA_MP_UNREACH_NLRI */
266 266
    bgp_check_unreach_nlri, NULL },
267
  { NULL, },									/* BA_EXTENDED_COMM */
267
  {  .name = NULL },									/* BA_EXTENDED_COMM */
268 268
  { "as4_path", -1, BAF_OPTIONAL | BAF_TRANSITIVE, EAF_TYPE_OPAQUE, 1,		/* BA_AS4_PATH */
269 269
    NULL, NULL },
270 270
  { "as4_aggregator", -1, BAF_OPTIONAL | BAF_TRANSITIVE, EAF_TYPE_OPAQUE, 1,	/* BA_AS4_PATH */
proto/bgp/bgp.c
203 203
void
204 204
bgp_close_conn(struct bgp_conn *conn)
205 205
{
206
  struct bgp_proto *p = conn->bgp;
206
  // struct bgp_proto *p = conn->bgp;
207 207

  
208 208
  DBG("BGP: Closing connection\n");
209 209
  conn->packets_to_send = 0;
......
237 237

  
238 238
  DBG("BGP: Updating startup delay\n");
239 239

  
240
  if (p->last_proto_error && ((now - p->last_proto_error) >= cf->error_amnesia_time))
240
  if (p->last_proto_error && ((now - p->last_proto_error) >= (int) cf->error_amnesia_time))
241 241
    p->startup_delay = 0;
242 242

  
243 243
  p->last_proto_error = now;
......
492 492
}
493 493

  
494 494
static void
495
bgp_setup_sk(struct bgp_proto *p, struct bgp_conn *conn, sock *s)
495
bgp_setup_sk(struct bgp_conn *conn, sock *s)
496 496
{
497 497
  s->data = conn;
498 498
  s->err_hook = bgp_sock_err;
......
555 555
  s->tx_hook = bgp_connected;
556 556
  BGP_TRACE(D_EVENTS, "Connecting to %I from local address %I", s->daddr, s->saddr);
557 557
  bgp_setup_conn(p, conn);
558
  bgp_setup_sk(p, conn, s);
558
  bgp_setup_sk(conn, s);
559 559
  bgp_conn_set_state(conn, BS_CONNECT);
560 560
  if (sk_open(s))
561 561
    {
......
601 601
	      goto err;
602 602

  
603 603
	    bgp_setup_conn(p, &p->incoming_conn);
604
	    bgp_setup_sk(p, &p->incoming_conn, sk);
604
	    bgp_setup_sk(&p->incoming_conn, sk);
605 605
	    sk_set_ttl(sk, p->cf->multihop ? : 1);
606 606
	    bgp_send_open(&p->incoming_conn);
607 607
	    return 0;
......
615 615
}
616 616

  
617 617
static void
618
bgp_listen_sock_err(sock *sk, int err)
618
bgp_listen_sock_err(sock *sk UNUSED, int err)
619 619
{
620 620
  if (err == ECONNABORTED)
621 621
    log(L_WARN "BGP: Incoming connection aborted");
proto/bgp/packets.c
44 44
mrt_put_bgp4_hdr(byte *buf, struct bgp_conn *conn, int as4)
45 45
{
46 46
  struct bgp_proto *p = conn->bgp;
47
  ip_addr local_addr;
48 47

  
49 48
  if (as4)
50 49
    {
......
614 613
void
615 614
bgp_parse_capabilities(struct bgp_conn *conn, byte *opt, int len)
616 615
{
617
  struct bgp_proto *p = conn->bgp;
616
  // struct bgp_proto *p = conn->bgp;
618 617
  int cl;
619 618

  
620 619
  while (len > 0)
proto/ospf/hello.c
48 48
  struct proto_ospf *po = ifa->oa->po;
49 49
  struct proto *p = &po->proto;
50 50
  char *beg = "Bad OSPF HELLO packet from ", *rec = " received: ";
51
  unsigned int size, i, twoway, oldpriority, eligible, peers;
52
  u32 olddr, oldbdr, oldiface_id, tmp;
51
  unsigned int size, i, twoway, eligible, peers;
52
  u32 tmp;
53 53
  u32 *pnrid;
54 54

  
55 55
  size = ntohs(ps_i->length);
......
188 188
  if (!twoway)
189 189
    ospf_neigh_sm(n, INM_1WAYREC);
190 190

  
191
  olddr = n->dr;
192
  oldbdr = n->bdr;
193
  oldpriority = n->priority;
191
  u32 olddr = n->dr;
192
  u32 oldbdr = n->bdr;
193
  u32 oldpriority = n->priority;
194 194
#ifdef OSPFv3
195
  oldiface_id = n->iface_id;
195
  u32 oldiface_id = n->iface_id;
196 196
#endif
197 197

  
198 198
  n->dr = ntohl(ps->dr);
proto/ospf/lsalib.c
122 122
}
123 123

  
124 124
void
125
htonlsab(void *h, void *n, u16 type, u16 len)
125
htonlsab(void *h, void *n, u16 len)
126 126
{
127 127
  u32 *hid = h;
128 128
  u32 *nid = n;
129
  int i;
129
  unsigned i;
130 130

  
131 131
  for (i = 0; i < (len / sizeof(u32)); i++)
132 132
    nid[i] = htonl(hid[i]);
133 133
}
134 134

  
135 135
void
136
ntohlsab(void *n, void *h, u16 type, u16 len)
136
ntohlsab(void *n, void *h, u16 len)
137 137
{
138 138
  u32 *nid = n;
139 139
  u32 *hid = h;
140
  int i;
140
  unsigned i;
141 141

  
142 142
  for (i = 0; i < (len / sizeof(u32)); i++)
143 143
    hid[i] = ntohl(nid[i]);
......
185 185
lsasum_calculate(struct ospf_lsa_header *h, void *body)
186 186
{
187 187
  u16 length = h->length;
188
  u16 type = h->type;
189 188

  
190 189
  //  log(L_WARN "Checksum %R %R %d start (len %d)", h->id, h->rt, h->type, length);
191 190
  htonlsah(h, h);
192
  htonlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
191
  htonlsab(body, body, length - sizeof(struct ospf_lsa_header));
193 192

  
194 193
  /*
195 194
  char buf[1024];
......
203 202
  //  log(L_WARN "Checksum result %4x", h->checksum);
204 203

  
205 204
  ntohlsah(h, h);
206
  ntohlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
205
  ntohlsab(body, body, length - sizeof(struct ospf_lsa_header));
207 206
}
208 207

  
209 208
/*
......
325 324
}
326 325

  
327 326
static int
328
lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body)
327
lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body UNUSED)
329 328
{
330 329
  if (lsa->length < (HDRLEN + sizeof(struct ospf_lsa_net)))
331 330
    return 0;
proto/ospf/lsalib.h
12 12

  
13 13
void htonlsah(struct ospf_lsa_header *h, struct ospf_lsa_header *n);
14 14
void ntohlsah(struct ospf_lsa_header *n, struct ospf_lsa_header *h);
15
void htonlsab(void *h, void *n, u16 type, u16 len);
16
void ntohlsab(void *n, void *h, u16 type, u16 len);
15
void htonlsab(void *h, void *n, u16 len);
16
void ntohlsab(void *n, void *h, u16 len);
17 17
void lsasum_calculate(struct ospf_lsa_header *header, void *body);
18 18
u16 lsasum_check(struct ospf_lsa_header *h, void *body);
19 19
#define CMP_NEWER 1
proto/ospf/lsupd.c
290 290
	htonlsah(hh, lh);
291 291
	help = (u8 *) (lh + 1);
292 292
	en = ospf_hash_find_header(po->gr, domain, hh);
293
	htonlsab(en->lsa_body, help, hh->type, hh->length
294
		 - sizeof(struct ospf_lsa_header));
293
	htonlsab(en->lsa_body, help, hh->length - sizeof(struct ospf_lsa_header));
295 294
      }
296 295

  
297 296
      len = sizeof(struct ospf_lsupd_packet) + ntohs(lh->length);
......
386 385
    }
387 386
    htonlsah(&(en->lsa), pktpos);
388 387
    pktpos = pktpos + sizeof(struct ospf_lsa_header);
389
    htonlsab(en->lsa_body, pktpos, en->lsa.type, en->lsa.length
390
	     - sizeof(struct ospf_lsa_header));
388
    htonlsab(en->lsa_body, pktpos, en->lsa.length - sizeof(struct ospf_lsa_header));
391 389
    pktpos = pktpos + en->lsa.length - sizeof(struct ospf_lsa_header);
392 390
    len += en->lsa.length;
393 391
    lsano++;
......
630 628

  
631 629
      /* pg 144 (5d) */
632 630
      void *body = mb_alloc(p->pool, lsatmp.length - sizeof(struct ospf_lsa_header));
633
      ntohlsab(lsa + 1, body, lsatmp.type,
634
	       lsatmp.length - sizeof(struct ospf_lsa_header));
631
      ntohlsab(lsa + 1, body, lsatmp.length - sizeof(struct ospf_lsa_header));
635 632

  
636 633
      /* We will do validation check after flooding and
637 634
	 acknowledging given LSA to minimize problems
proto/ospf/neighbor.c
440 440
bdr_election(struct ospf_iface *ifa)
441 441
{
442 442
  struct proto_ospf *po = ifa->oa->po;
443
  struct proto *p = &po->proto;
444 443
  u32 myid = po->router_id;
445 444
  struct ospf_neighbor *neigh, *ndr, *nbdr, me;
446 445
  int doadj;
......
632 631
rxmt_timer_hook(timer * timer)
633 632
{
634 633
  struct ospf_neighbor *n = (struct ospf_neighbor *) timer->data;
635
  struct proto *p = &n->ifa->oa->po->proto;
634
  // struct proto *p = &n->ifa->oa->po->proto;
636 635
  struct top_hash_entry *en;
637 636

  
638 637
  DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
proto/ospf/ospf.c
224 224
    }
225 225
  }
226 226

  
227
  /*
227 228
  OSPF_TRACE(D_EVENTS, "LSA graph dump start:");
228 229
  ospf_top_dump(po->gr, p);
229 230
  OSPF_TRACE(D_EVENTS, "LSA graph dump finished");
231
  */
230 232
  neigh_dump_all();
231 233
}
232 234

  
......
500 502
}
501 503

  
502 504
static void
503
ospf_ifa_notify(struct proto *p, unsigned flags, struct ifa *a)
505
ospf_ifa_notify(struct proto *p, unsigned flags UNUSED, struct ifa *a)
504 506
{
505 507
  struct proto_ospf *po = (struct proto_ospf *) p;
506 508
  struct ospf_iface *ifa;
......
915 917
void
916 918
ospf_sh_neigh(struct proto *p, char *iff)
917 919
{
918
  struct ospf_iface *ifa = NULL, *f;
920
  struct ospf_iface *ifa = NULL;
919 921
  struct ospf_neighbor *n;
920 922
  struct proto_ospf *po = (struct proto_ospf *) p;
921 923

  
......
1006 1008
ospf_sh_iface(struct proto *p, char *iff)
1007 1009
{
1008 1010
  struct proto_ospf *po = (struct proto_ospf *) p;
1009
  struct ospf_iface *ifa = NULL, *f;
1011
  struct ospf_iface *ifa = NULL;
1010 1012

  
1011 1013
  if (p->proto_state != PS_UP)
1012 1014
  {
......
1193 1195
static inline void
1194 1196
show_lsa_sum_net(struct top_hash_entry *he)
1195 1197
{
1196
  struct ospf_lsa_header *lsa = &(he->lsa);
1197 1198
  ip_addr ip;
1198 1199
  int pxlen;
1199 1200

  
......
1217 1218
  u32 dst_rid, options;
1218 1219

  
1219 1220
#ifdef OSPFv2
1220
  struct ospf_lsa_sum *ls = he->lsa_body;
1221
  //  struct ospf_lsa_sum *ls = he->lsa_body;
1221 1222
  dst_rid = he->lsa.id;
1222 1223
  options = 0;
1223 1224
#else /* OSPFv3 */
......
1235 1236
{
1236 1237
  struct ospf_lsa_header *lsa = &(he->lsa);
1237 1238
  struct ospf_lsa_ext *ext = he->lsa_body;
1238
  struct ospf_lsa_ext_tos *et = (struct ospf_lsa_ext_tos *) (ext + 1);
1239 1239
  char str_via[STD_ADDRESS_P_LENGTH + 8] = "";
1240 1240
  char str_tag[16] = "";
1241 1241
  ip_addr ip, rt_fwaddr;
......
1493 1493
    
1494 1494
    if ((dscope != last_dscope) || (hea[i]->domain != last_domain))
1495 1495
    {
1496
      struct iface *ifa;
1497

  
1498 1496
      cli_msg(-1017, "");
1499 1497
      switch (dscope)
1500 1498
      {
......
1506 1504
	  break;
1507 1505
#ifdef OSPFv3
1508 1506
	case LSA_SCOPE_LINK:
1509
	  ifa = if_find_by_index(hea[i]->domain);
1507
	  struct iface *ifa = if_find_by_index(hea[i]->domain);
1510 1508
	  cli_msg(-1017, "Link %s", (ifa != NULL) ? ifa->name : "?");
1511 1509
	  break;
1512 1510
#endif
proto/ospf/ospf.h
704 704
  struct top_hash_entry *pxr_lsa; /* Originated prefix LSA */
705 705
  list cand;			/* List of candidates for RT calc. */
706 706
  struct fib net_fib;		/* Networks to advertise or not */
707
  int stub;
707
  unsigned stub;
708 708
  int trcap;			/* Transit capability? */
709 709
  u32 options;			/* Optional features */
710 710
  struct proto_ospf *po;
......
781 781
#ifdef OSPFv3
782 782
void schedule_link_lsa(struct ospf_iface *ifa);
783 783
#else
784
static inline void schedule_link_lsa(struct ospf_iface *ifa) {}
784
static inline void schedule_link_lsa(struct ospf_iface *ifa UNUSED) {}
785 785
#endif
786 786

  
787 787
void ospf_sh_neigh(struct proto *p, char *iff);
788 788
void ospf_sh(struct proto *p);
789 789
void ospf_sh_iface(struct proto *p, char *iff);
790 790
void ospf_sh_state(struct proto *p, int verbose);
791
void ospf_sh_lsadb(struct proto *p);
791 792

  
792 793

  
793 794
#define EA_OSPF_METRIC1	EA_CODE(EAP_OSPF, 0)
proto/ospf/packet.c
14 14
ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
15 15
{
16 16
  struct proto_ospf *po = ifa->oa->po;
17
  struct proto *p = &po->proto;
18 17
  struct ospf_packet *pkt;
19 18

  
20 19
  pkt = (struct ospf_packet *) buf;
proto/ospf/rt.c
226 226
static void
227 227
ospf_rt_spfa_rtlinks(struct ospf_area *oa, struct top_hash_entry *act, struct top_hash_entry *en)
228 228
{
229
  struct proto *p = &oa->po->proto;
229
  // struct proto *p = &oa->po->proto;
230 230
  struct proto_ospf *po = oa->po;
231 231
  orta nf;
232 232
  u32 i;
......
519 519
static void
520 520
ospf_rt_sum_tr(struct ospf_area *oa)
521 521
{
522
  struct proto *p = &oa->po->proto;
522
  // struct proto *p = &oa->po->proto;
523 523
  struct proto_ospf *po = oa->po;
524 524
  struct ospf_area *bb = po->backbone;
525 525
  ip_addr ip, abrip;
......
1077 1077
calc_next_hop(struct ospf_area *oa, struct top_hash_entry *en,
1078 1078
	      struct top_hash_entry *par)
1079 1079
{
1080
  // struct proto *p = &oa->po->proto;
1080 1081
  struct ospf_neighbor *neigh;
1081
  struct proto *p = &oa->po->proto;
1082 1082
  struct proto_ospf *po = oa->po;
1083 1083
  struct ospf_iface *ifa;
1084 1084

  
proto/ospf/topology.c
744 744
}
745 745

  
746 746
void
747
originate_sum_rt_lsa(struct ospf_area *oa, struct fib_node *fn, int metric, u32 options)
747
originate_sum_rt_lsa(struct ospf_area *oa, struct fib_node *fn, int metric, u32 options UNUSED)
748 748
{
749 749
  struct proto_ospf *po = oa->po;
750 750
  struct proto *p = &po->proto;
......
899 899
  u32 tag = ea_get_int(attrs, EA_OSPF_TAG, 0);
900 900
  int gw = 0;
901 901
  int size = sizeof(struct ospf_lsa_ext);
902
  u32 *buf;
903 902

  
904 903
  if ((e->attrs->dest == RTD_ROUTER) &&
905 904
      !ipa_equal(e->attrs->gw, IPA_NONE) &&
......
927 926
  ext->fwaddr = gw ? e->attrs->gw : IPA_NONE;
928 927
  ext->tag = tag;
929 928
#else /* OSPFv3 */
930
  buf = ext->rest;
929
  u32 *buf = ext->rest;
931 930
  buf = put_ipv6_prefix(buf, n->n.prefix, n->n.pxlen, 0, 0);
932 931

  
933 932
  if (gw)
......
1017 1016
{
1018 1017
  struct proto *p = &po->proto;
1019 1018
  struct fib_node *fn = &n->n;
1020
  struct ospf_area *oa;
1021 1019
  struct top_hash_entry *en;
1022 1020

  
1023 1021
  OSPF_TRACE(D_EVENTS, "Flushing AS-external-LSA for %I/%d",
......
1651 1649
  bug("ospf_hash_delete() called for invalid node");
1652 1650
}
1653 1651

  
1652
/*
1654 1653
static void
1655 1654
ospf_dump_lsa(struct top_hash_entry *he, struct proto *p)
1656 1655
{
1657
  /*
1656

  
1658 1657
  struct ospf_lsa_rt *rt = NULL;
1659 1658
  struct ospf_lsa_rt_link *rr = NULL;
1660 1659
  struct ospf_lsa_net *ln = NULL;
......
1688 1687
    default:
1689 1688
      break;
1690 1689
    }
1691
  */
1692 1690
}
1693 1691

  
1694 1692
void
......
1704 1702
      ospf_dump_lsa(e, p);
1705 1703
  }
1706 1704
}
1705
*/
1707 1706

  
1708 1707
/* This is very inefficient, please don't call it often */
1709 1708

  
proto/pipe/pipe.c
168 168
static int
169 169
pipe_reconfigure(struct proto *P, struct proto_config *new)
170 170
{
171
  struct pipe_proto *p = (struct pipe_proto *) P;
171
  // struct pipe_proto *p = (struct pipe_proto *) P;
172 172
  struct pipe_config *o = (struct pipe_config *) P->cf;
173 173
  struct pipe_config *n = (struct pipe_config *) new;
174 174

  
proto/rip/rip.c
752 752
    return NULL;
753 753
  }
754 754
  /* On dummy, we just return non-working socket, so that user gets error every time anyone requests table */
755
  return rif;
755 756
}
756 757

  
757 758
static void
......
956 957
static void
957 958
rip_rte_remove(net *net UNUSED, rte *rte)
958 959
{
959
  struct proto *p = rte->attrs->proto;
960
  // struct proto *p = rte->attrs->proto;
960 961
  CHK_MAGIC;
961 962
  DBG( "rip_rte_remove: %p\n", rte );
962 963
  rem_node( &rte->u.rip.garbage );
sysdep/linux/sysio.h
87 87
#define fill_mreq_ifa fill_mreq
88 88
#define fill_mreq_grp fill_mreq
89 89

  
90
static inline fill_mreq(struct ip_mreqn *m, struct iface *ifa, ip_addr maddr)
90
static inline void fill_mreq(struct ip_mreqn *m, struct iface *ifa, ip_addr maddr)
91 91
{
92 92
  bzero(m, sizeof(*m));
93 93
  m->imr_ifindex = ifa->index;
sysdep/unix/io.c
70 70
  "FILE",
71 71
  sizeof(struct rfile),
72 72
  rf_free,
73
  rf_dump
73
  rf_dump,
74
  NULL
74 75
};
75 76

  
76 77
void *
......
195 196
  "Timer",
196 197
  sizeof(timer),
197 198
  tm_free,
198
  tm_dump
199
  tm_dump,
200
  NULL
199 201
};
200 202

  
201 203
/**
......
564 566
  "Socket",
565 567
  sizeof(sock),
566 568
  sk_free,
567
  sk_dump
569
  sk_dump,
570
  NULL
568 571
};
569 572

  
570 573
/**
......
640 643
}
641 644

  
642 645
static inline void
643
fill_in_sockifa(sockaddr *sa, struct iface *ifa)
646
fill_in_sockifa(sockaddr *sa UNUSED, struct iface *ifa UNUSED)
644 647
{
645 648
}
646 649

  
......
1492 1495
	    {
1493 1496
	      sock *s = current_sock;
1494 1497
	      int e;
1495
	      int steps;
1496 1498

  
1497 1499
	      if ((s->type < SK_MAGIC) && FD_ISSET(s->fd, &rd) && s->rx_hook)
1498 1500
		{
sysdep/unix/log.c
19 19
#include <stdlib.h>
20 20
#include <stdarg.h>
21 21
#include <time.h>
22
#include <unistd.h>
22 23

  
23 24
#include "nest/bird.h"
24 25
#include "nest/cli.h"
sysdep/unix/unix.h
17 17
void async_dump(void);
18 18
void async_shutdown(void);
19 19
void cmd_reconfig(char *name, int type);
20
void cmd_shutdown(void);
20 21

  
21 22
/* io.c */
22 23

  

Also available in: Unified diff