Revision d7c06285

View differences:

doc/bird.sgml
393 393
	Set BIRD's router ID based on an IP address of an interface specified by
394 394
	an interface pattern. The option is applicable for IPv4 version only.
395 395
	See <ref id="dsc-iface" name="interface"> section for detailed
396
	description of interface patterns.
396
	description of interface patterns with extended clauses.
397 397

  
398 398
	<tag>listen bgp [address <m/address/] [port <m/port/] [dual]</tag>
399 399
	This option allows to specify address and port where BGP protocol should
......
569 569
	given interface-specific options. A set of interfaces specified by one
570 570
	interface option is described using an interface pattern. The interface
571 571
	pattern consists of a sequence of clauses (separated by commas), each
572
	clause may contain a mask, a prefix, or both of them. An interface
573
	matches the clause if its name matches the mask (if specified) and its
574
	address matches the prefix (if specified). Mask is specified as
575
	shell-like pattern. For IPv6, the prefix part of a clause is generally
576
	ignored and interfaces are matched just by their name.
572
	clause is a mask specified as a shell-like pattern. Interfaces are
573
	matched by their name.
577 574

  
578 575
	An interface matches the pattern if it matches any of its clauses. If
579 576
	the clause begins with <cf/-/, matching interfaces are excluded. Patterns
580
	are parsed left-to-right, thus <cf/interface "eth0", -"eth*", "*";/
577
	are processed left-to-right, thus <cf/interface "eth0", -"eth*", "*";/
581 578
	means eth0 and all non-ethernets.
582 579

  
580
	Some protocols (namely OSPFv2 and Direct) support extended clauses that
581
	may contain a mask, a prefix, or both of them. An interface matches such
582
	clause if its name matches the mask (if specified) and its address
583
	matches the prefix (if specified). Extended clauses are used when the
584
	protocol handles multiple addresses on an interface independently.
585

  
583 586
	An interface option can be used more times with different interface-specific
584 587
	options, in that case for given interface the first matching interface
585 588
	option is used.
586 589
	
587
	This option is allowed in Direct, OSPF, RIP and RAdv protocols, but in
588
	OSPF protocol it is used in <cf/area/ subsection.
590
	This option is allowed in BFD, Direct, OSPF, RAdv and RIP protocols, but
591
	in OSPF protocol it is used in the <cf/area/ subsection.
589 592

  
590 593
	Default: none.
591 594

  
......
2094 2097
	<tag>interface <m/pattern [, ...]/</tag>
2095 2098
	By default, the Direct protocol will generate device routes for all the
2096 2099
	interfaces available. If you want to restrict it to some subset of
2097
	interfaces (for example if you're using multiple routing tables for
2098
	policy routing and some of the policy domains don't contain all
2099
	interfaces), just use this clause.
2100
	interfaces or addresses (e.g. if you're using multiple routing tables
2101
	for policy routing and some of the policy domains don't contain all
2102
	interfaces), just use this clause. See <ref id="dsc-iface" name="interface">
2103
	common option for detailed description. The Direct protocol uses
2104
	extended interface clauses.
2100 2105
</descrip>
2101 2106

  
2102 2107
<p>Direct device routes don't contain any specific attributes.
......
2468 2473
	<tag>interface <M>pattern</M> [instance <m/num/]</tag>
2469 2474
	Defines that the specified interfaces belong to the area being defined.
2470 2475
	See <ref id="dsc-iface" name="interface"> common option for detailed
2471
	description. In OSPFv3, you can specify instance ID for that interface
2472
	description, so it is possible to have several instances of that
2473
	interface with different options or even in different areas.
2476
	description. In OSPFv2, extended interface clauses are used, because
2477
	OSPFv2 handles each network prefix as a separate virtual interface. In
2478
	OSPFv3, you can specify instance ID for that interface description, so
2479
	it is possible to have several instances of that interface with
2480
	different options or even in different areas.
2474 2481

  
2475 2482
	<tag>virtual link <M>id</M> [instance <m/num/]</tag>
2476 2483
	Virtual link to router with the router id. Virtual link acts as a
nest/config.Y
24 24
static struct password_item *this_p_item;
25 25
static int password_id;
26 26

  
27
static void
28
iface_patt_check(void)
29
{
30
  struct iface_patt_node *pn;
31

  
32
  WALK_LIST(pn, this_ipatt->ipn_list)
33
    if (!pn->pattern || pn->pxlen)
34
      cf_error("Interface name/mask expected, not IP prefix");
35
}
36

  
37

  
27 38
static inline void
28 39
reset_passwords(void)
29 40
{
......
272 283
 | iface_patt_list ',' iface_patt_node
273 284
 ;
274 285

  
286
/* For name/mask-only iface patterns */
287
iface_patt_list_nopx: iface_patt_list { iface_patt_check(); }
288

  
275 289
iface_patt_init: {
276 290
   /* Generic this_ipatt init */
277 291
   this_ipatt = cfg_allocz(sizeof(struct iface_patt));
proto/bfd/config.Y
89 89
 | '{' bfd_iface_opts '}'
90 90
 ;
91 91

  
92
bfd_iface: bfd_iface_start iface_patt_list bfd_iface_opt_list
92
bfd_iface: bfd_iface_start iface_patt_list_nopx bfd_iface_opt_list
93 93
{ add_tail(&BFD_CFG->patt_list, NODE this_ipatt); };
94 94

  
95 95
bfd_multihop: bfd_iface_start bfd_iface_opt_list
proto/ospf/config.Y
386 386
 | INSTANCE expr { set_instance_id($2); }
387 387
 ;
388 388

  
389
ospf_iface_patt_list:
390
   iface_patt_list { if (OSPF_VERSION == 3) iface_patt_check(); } ospf_instance_id
391
 ; 
392

  
389 393
ospf_iface_opts:
390 394
   /* empty */
391 395
 | ospf_iface_opts ospf_iface_item ';'
......
397 401
 ;
398 402

  
399 403
ospf_iface:
400
  ospf_iface_start iface_patt_list ospf_instance_id ospf_iface_opt_list { ospf_iface_finish(); }
404
  ospf_iface_start ospf_iface_patt_list ospf_iface_opt_list { ospf_iface_finish(); }
401 405
 ;
402 406

  
403 407
opttext:
proto/radv/config.Y
138 138
 ;
139 139

  
140 140
radv_iface:
141
  radv_iface_start iface_patt_list radv_iface_opt_list radv_iface_finish;
141
  radv_iface_start iface_patt_list_nopx radv_iface_opt_list radv_iface_finish;
142 142

  
143 143

  
144 144
radv_prefix_start: prefix
proto/rip/config.Y
110 110
   }
111 111
 ;
112 112

  
113
rip_iface:
113
rip_iface:	/* TODO: switch to iface_patt_list_nopx */
114 114
   rip_iface_init iface_patt_list rip_iface_opt_list
115 115
 ;
116 116

  

Also available in: Unified diff