Revision 9669362f

View differences:

proto/ospf/dbdes.c
149 149
  n=(struct ospf_neighbor *)timer->data;
150 150
  ifa=n->ifa;
151 151
  p=(struct proto *)(ifa->proto);
152
  debug("%s: RXMT timer fired on interface %s for neigh: %I.\n",
152
  DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
153 153
    p->name, ifa->iface->name, n->rid);
154 154
  if(n->state<NEIGHBOR_LOADING) ospf_dbdes_tx(n);
155 155
  else
proto/ospf/hello.c
183 183

  
184 184
  ifa=(struct ospf_iface *)timer->data;
185 185
  p=(struct proto *)(ifa->proto);
186
  debug("%s: Hello timer fired on interface %s.\n",
186
  DBG("%s: Hello timer fired on interface %s.\n",
187 187
    p->name, ifa->iface->name);
188 188
  /* Now we should send a hello packet */
189 189
  /* First a common packet header */
proto/ospf/lsack.c
15 15
  struct ospf_packet *op;
16 16
  struct ospf_lsack_packet *pk;
17 17
  sock *sk=n->ifa->ip_sk;
18
  struct proto *p=&n->ifa->proto->proto;
18 19
  u16 len;
19 20

  
20 21
  DBG("Sending direct ACK to %I for Type: %u, ID: %I, RT: %I\n",n->rid,
......
30 31
  op->length=htons(len);
31 32
  ospf_pkt_finalize(n->ifa, op);
32 33
  sk_send_to(sk,len, n->ip, OSPF_PROTO);
34
  debug("%s: LS ack sent to %I\n", p->name, n->ip);
33 35
}
34 36

  
35 37
void
......
160 162

  
161 163
  if((n=find_neigh(ifa, nrid))==NULL)
162 164
  {
163
    debug("%s: Received lsack from unknown neigbor! (%I)\n", p->name,
165
    debug("%s: Received LS ack from unknown neigbor! (%I)\n", p->name,
164 166
      nrid);
165 167
    return ;
166 168
  }
167 169

  
168 170
  if(n->state<NEIGHBOR_EXCHANGE) return;
169
  
171

  
172
  debug("%s: Received LS ack from %I\n", p->name,
173
      n->ip);
174

  
170 175
  nolsa=(ntohs(ps->ospf_packet.length)-sizeof(struct ospf_lsack_packet))/
171 176
    sizeof(struct ospf_lsa_header);
172 177
  DBG("Received %d lsa ack(s)\n",nolsa);
......
180 185
    if(lsa_comp(&lsa,&en->lsa)!=CMP_SAME)
181 186
    {
182 187
      log("Strange LS acknoledgement from %I",n->rid);
188
      log("Id: %I, Rt: %I, Type: %u",lsa.id, lsa.rt, lsa.type);
189
      log("I have: Age: %u, Seqno: %u", en->lsa.age, en->lsa.sn);
190
      log("He has: Age: %u, Seqno: %u", lsa.age, lsa.sn);
183 191
      continue;
184 192
    }
185 193

  
proto/ospf/lsreq.c
18 18
  struct ospf_lsreq_header *lsh;
19 19
  u16 length;
20 20
  int i,j;
21
  struct proto *p=&n->ifa->proto->proto;
21 22

  
22 23
  pk=(struct ospf_lsreq_packet *)n->ifa->ip_sk->tbuf;
23 24
  op=(struct ospf_packet *)n->ifa->ip_sk->tbuf;
......
54 55
  op->length=htons(length);
55 56
  ospf_pkt_finalize(n->ifa, op);
56 57
  sk_send_to(n->ifa->ip_sk,length, n->ip, OSPF_PROTO);
57
  DBG("Lsreq send to: %I\n", n->rid);
58
  debug("%s: LS request sent to: %I\n", p->name, n->rid);
58 59
}
59 60

  
60 61
void
......
63 64
  struct ospf_iface *ifa;
64 65
  struct proto *p;
65 66
  struct ospf_neighbor *n;
67
  struct top_hash_entry *en;
66 68

  
67 69
  n=(struct ospf_neighbor *)timer->data;
68 70
  ifa=n->ifa;
69 71
  p=(struct proto *)(ifa->proto);
70
  debug("%s: LSRR timer fired on interface %s for neigh: %I.\n",
72

  
73
  DBG("%s: LSRR timer fired on interface %s for neigh: %I.\n",
71 74
    p->name, ifa->iface->name, n->rid);
72 75
  if(n->state<NEIGHBOR_FULL) ospf_lsreq_tx(n);
73 76
  else
74 77
  {
75
    int i;	/* FIXME Retransmit lsupd again */
78
    if(!EMPTY_SLIST(n->lsrtl))
79
    {
80
      list uplist;
81
      slab *upslab;
82
      struct l_lsr_head *llsh;
83

  
84
      init_list(&uplist);
85
      upslab=sl_new(p->pool,sizeof(struct l_lsr_head));
86

  
87
      WALK_SLIST(SNODE en,n->lsrtl)
88
      {
89
	if((SNODE en)->next==(SNODE en)) die("BUGGGGGG");
90
        llsh=sl_alloc(upslab);
91
        llsh->lsh.id=en->lsa.id;
92
        llsh->lsh.rt=en->lsa.rt;
93
        llsh->lsh.type=en->lsa.type;
94
	DBG("Working on ID: %I, RT: %I, Type: %u\n",en->lsa.id,en->lsa.rt,en->lsa.type);
95
        add_tail(&uplist, NODE llsh);
96
      }
97
      ospf_lsupd_tx_list(n, &uplist);
98
      rfree(upslab);
99
    }
76 100
  }
77 101
}
78 102

  
......
95 119

  
96 120
  if((n=find_neigh(ifa, nrid))==NULL)
97 121
  {
98
    debug("%s: Received lsreq from unknown neigbor! (%I)\n", p->name,
122
    debug("%s: Received lsreq from unknown neighbor! (%I)\n", p->name,
99 123
      nrid);
100 124
    return ;
101 125
  }
102
  if(n->state<NEIGHBOR_EXCHANGE) debug("%s: Ignoring it.\n", p->name);
126
  if(n->state<NEIGHBOR_EXCHANGE) return;
127

  
128
  debug("%s: Received LS req from neighbor: %I\n",p->name, n->ip);
103 129

  
104 130
  length=htons(ps->ospf_packet.length);
105 131
  lsh=(void *)(ps+1);
proto/ospf/lsupd.c
69 69
	}
70 70
      }
71 71
      if(nn==n) continue;
72
      en=ospf_hash_get_header(nn->lsrth, hh);
72
      if((en=ospf_hash_find_header(nn->lsrth, hh))==NULL)
73
      {
74
        en=ospf_hash_get_header(nn->lsrth, hh);
75
      }
76
      else
77
      {
78
        s_rem_node(SNODE en);
79
      }
73 80
      s_add_tail(&nn->lsrtl, SNODE en);
74 81
      ret=1;
82
      DBG("Adding LSA lsrt RT: %I, Id: %I, Type: %u for n: %I\n",
83
        en->lsa.rt,en->lsa.id, en->lsa.type, nn->ip);
75 84
    }
76 85
    if(ret==0) continue;
77 86
    if(ifa==iff)
......
147 156
  struct top_hash_entry *en;
148 157
  struct ospf_lsupd_packet *pk;
149 158
  struct ospf_packet *op;
159
  struct proto *p=&n->ifa->oa->po->proto;
150 160
  void *pktpos;
151 161
  u8 ii;
152 162
  u8 *jj=n->ifa->ip_sk->tbuf;
......
174 184
      op->length=htons(len);
175 185
      ospf_pkt_finalize(n->ifa, op);
176 186
		       
177
      for(ii=0;ii<(len-SIPH);ii+=4)
178
        DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
179

  
180 187
      sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
188
      debug("%s: LS upd sent to %I\n", p->name, n->ip);
181 189

  
182 190
      DBG("LSupd: next packet\n");
183 191
      fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
......
201 209
    DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
202 210

  
203 211
  sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
204
  DBG("LSupd: sent\n");
212
  debug("%s: LS upd sent to %I\n", p->name, n->ip);
205 213
}
206 214

  
207 215
void
......
233 241
    return;
234 242
  }
235 243

  
244
  debug("%s: Received LS upd from (%I)\n", p->name, n->ip); 
245

  
236 246
  lsa=(struct ospf_lsa_header *)(ps+1);
237 247
  area=htonl(ps->ospf_packet.areaid);
238 248
  oa=ospf_find_area((struct proto_ospf *)p,area);
proto/ospf/ospf.h
27 27
#include "conf/conf.h"
28 28
#include "lib/string.h"
29 29

  
30
#define LOCAL_DEBUG
31

  
32 30
#define OSPF_PROTO 89
33 31
#ifndef IPV6
34 32
#define OSPF_VERSION 2
proto/ospf/topology.c
7 7
 *	Can be freely distributed and used under the terms of the GNU GPL.
8 8
 */
9 9

  
10
#define LOCAL_DEBUG
11

  
12 10
#include "nest/bird.h"
13 11
#include "lib/string.h"
14 12

  
......
34 32
  struct top_hash_entry *old;
35 33
  struct proto_ospf *po=(struct proto_ospf *)p;
36 34

  
37
  DBG("%s: Originating RT_lsa body for area \"%I\".\n", po->proto.name, oa->areaid);
35
  DBG("%s: Originating RT_lsa body for area \"%I\".\n", po->proto.name,
36
    oa->areaid);
38 37

  
39
  WALK_LIST (ifa, p->iface_list) i++;
38
  WALK_LIST (ifa, p->iface_list)
40 39
  {
41 40
    if((ifa->an==oa->areaid) && (ifa->state!=OSPF_IS_DOWN))
42 41
    {
......
226 225
  struct top_hash_entry *en;
227 226
  void *body;
228 227

  
229
  DBG("%s: Originating RT_lsa for area \"%I\".\n", po->proto.name, oa->areaid);
228
  debug("%s: Originating RT_lsa for area \"%I\".\n",po->proto.name,oa->areaid);
230 229

  
231 230
  lsa.age=0;
232 231
  lsa.id=rtid;
......
287 286

  
288 287
  if(ifa->state!=OSPF_IS_DR) return;
289 288

  
290
  DBG("%s: Originating Net lsa for iface \"%s\".\n", po->proto.name, ifa->iface->name);
289
  debug("%s: Originating Net lsa for iface \"%s\".\n", po->proto.name,
290
    ifa->iface->name);
291 291

  
292 292
  if(ifa->fadj==0)
293 293
  {

Also available in: Unified diff