Revision 178a197a proto/ospf/config.Y

View differences:

proto/ospf/config.Y
19 19
static struct nbma_node *this_nbma;
20 20
static list *this_nets;
21 21
static struct area_net_config *this_pref;
22
static struct ospf_stubnet_config *this_stubnet; 
22
static struct ospf_stubnet_config *this_stubnet;
23 23

  
24 24
static inline int ospf_cfg_is_v2(void) { return OSPF_CFG->ospf2; }
25 25
static inline int ospf_cfg_is_v3(void) { return ! OSPF_CFG->ospf2; }
......
32 32
  if (ip->deadint == 0)
33 33
    ip->deadint = ip->deadc * ip->helloint;
34 34

  
35
  if (ip->waitint == 0)
36
    ip->waitint = ip->deadc * ip->helloint;
37

  
35 38
  ip->passwords = get_passwords();
36 39

  
37 40
  if ((ip->autype == OSPF_AUTH_CRYPT) && (ip->helloint < 5))
......
159 162
 | ECMP bool LIMIT expr { OSPF_CFG->ecmp = $2 ? $4 : 0; if ($4 < 0) cf_error("ECMP limit cannot be negative"); }
160 163
 | MERGE EXTERNAL bool { OSPF_CFG->merge_external = $3; }
161 164
 | TICK expr { OSPF_CFG->tick = $2; if($2<=0) cf_error("Tick must be greater than zero"); }
165
 | INSTANCE ID expr { OSPF_CFG->instance_id = $3; if (($3<0) || ($3>255)) cf_error("Instance ID must be in range 0-255"); }
162 166
 | ospf_area
163 167
 ;
164 168

  
......
213 217
     add_tail(&this_area->stubnet_list, NODE this_stubnet);
214 218
     this_stubnet->px = $1;
215 219
     this_stubnet->cost = COST_D;
216
   } 
220
   }
217 221
 ;
218 222

  
219 223
ospf_stubnet_opts:
......
239 243

  
240 244
ospf_vlink_item:
241 245
 | HELLO expr { OSPF_PATT->helloint = $2 ; if (($2<=0) || ($2>65535)) cf_error("Hello interval must be in range 1-65535"); }
242
 | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=0) cf_error("Retransmit int must be greater than zero"); }
246
 | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=1) cf_error("Retransmit int must be greater than one"); }
243 247
 | TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); }
244
 | WAIT expr { OSPF_PATT->waitint = $2 ; }
248
 | WAIT expr { OSPF_PATT->waitint = $2 ; if ($2<=1) cf_error("Wait interval must be greater than one"); }
245 249
 | DEAD expr { OSPF_PATT->deadint = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); }
246 250
 | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); }
247 251
 | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE;  }
......
261 265
  OSPF_PATT->helloint = HELLOINT_D;
262 266
  OSPF_PATT->rxmtint = RXMTINT_D;
263 267
  OSPF_PATT->inftransdelay = INFTRANSDELAY_D;
264
  OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D;
265 268
  OSPF_PATT->deadc = DEADC_D;
266
  OSPF_PATT->deadint = 0;
267 269
  OSPF_PATT->type = OSPF_IT_VLINK;
270
  OSPF_PATT->instance_id = OSPF_CFG->instance_id;
268 271
  init_list(&OSPF_PATT->nbma_list);
269
  OSPF_PATT->autype = OSPF_AUTH_NONE;
270 272
  reset_passwords();
271 273
 }
272 274
;
......
275 277
   COST expr { OSPF_PATT->cost = $2 ; if (($2<=0) || ($2>65535)) cf_error("Cost must be in range 1-65535"); }
276 278
 | HELLO expr { OSPF_PATT->helloint = $2 ; if (($2<=0) || ($2>65535)) cf_error("Hello interval must be in range 1-65535"); }
277 279
 | POLL expr { OSPF_PATT->pollint = $2 ; if ($2<=0) cf_error("Poll int must be greater than zero"); }
278
 | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=0) cf_error("Retransmit int must be greater than zero"); }
279
 | WAIT expr { OSPF_PATT->waitint = $2 ; }
280
 | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=1) cf_error("Retransmit int must be greater than one"); }
281
 | WAIT expr { OSPF_PATT->waitint = $2 ; if ($2<=1) cf_error("Wait interval must be greater than one"); }
280 282
 | DEAD expr { OSPF_PATT->deadint = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); }
281 283
 | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); }
282 284
 | TYPE BROADCAST { OSPF_PATT->type = OSPF_IT_BCAST ; }
......
300 302
 | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE; }
301 303
 | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE; ospf_check_auth(); }
302 304
 | AUTHENTICATION CRYPTOGRAPHIC { OSPF_PATT->autype = OSPF_AUTH_CRYPT; ospf_check_auth(); }
303
 | RX BUFFER NORMAL { OSPF_PATT->rx_buffer = 0; } 
304
 | RX BUFFER LARGE { OSPF_PATT->rx_buffer = OSPF_MAX_PKT_SIZE; } 
305
 | RX BUFFER NORMAL { OSPF_PATT->rx_buffer = 0; }
306
 | RX BUFFER LARGE { OSPF_PATT->rx_buffer = OSPF_MAX_PKT_SIZE; }
305 307
 | RX BUFFER expr { OSPF_PATT->rx_buffer = $3; if (($3 < OSPF_MIN_PKT_SIZE) || ($3 > OSPF_MAX_PKT_SIZE)) cf_error("Buffer size must be in range 256-65535"); }
306 308
 | TX tos { OSPF_PATT->tx_tos = $2; }
307 309
 | TX PRIORITY expr { OSPF_PATT->tx_priority = $3; }
......
344 346
 /* empty */ { $$ = 0; }
345 347
 | ELIGIBLE { $$ = 1; }
346 348
 ;
347
 
349

  
348 350
nbma_item: ipa nbma_eligible ';'
349 351
 {
350 352
   this_nbma = cfg_allocz(sizeof(struct nbma_node));
......
353 355
   this_nbma->eligible=$2;
354 356
 }
355 357
;
356
 
358

  
357 359
ospf_iface_start:
358 360
 {
359 361
  this_ipatt = cfg_allocz(sizeof(struct ospf_iface_patt));
......
365 367
  OSPF_PATT->rxmtint = RXMTINT_D;
366 368
  OSPF_PATT->inftransdelay = INFTRANSDELAY_D;
367 369
  OSPF_PATT->priority = PRIORITY_D;
368
  OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D;
369 370
  OSPF_PATT->deadc = DEADC_D;
370
  OSPF_PATT->deadint = 0;
371 371
  OSPF_PATT->type = OSPF_IT_UNDEF;
372
  OSPF_PATT->instance_id = OSPF_CFG->instance_id;
372 373
  init_list(&OSPF_PATT->nbma_list);
373
  OSPF_PATT->autype = OSPF_AUTH_NONE;
374 374
  OSPF_PATT->ptp_netmask = 2; /* not specified */
375 375
  OSPF_PATT->tx_tos = IP_PREC_INTERNET_CONTROL;
376 376
  OSPF_PATT->tx_priority = sk_priority_control;
......
380 380

  
381 381
ospf_instance_id:
382 382
   /* empty */
383
 | INSTANCE expr { OSPF_PATT->instance_id = $2; }
383
 | INSTANCE expr { OSPF_PATT->instance_id = $2; if (($2<0) || ($2>255)) cf_error("Instance ID must be in range 0-255"); }
384 384
 ;
385 385

  
386 386
ospf_iface_patt_list:
387 387
   iface_patt_list { if (ospf_cfg_is_v3()) iface_patt_check(); } ospf_instance_id
388
 ; 
388
 ;
389 389

  
390 390
ospf_iface_opts:
391 391
   /* empty */

Also available in: Unified diff