oneaccess.gramar
changeset 43 597596f302ef
parent 42 89e94dd37556
equal deleted inserted replaced
42:89e94dd37556 43:597596f302ef
   113 
   113 
   114 rest_of_line:	word(s)
   114 rest_of_line:	word(s)
   115 		| eol
   115 		| eol
   116 
   116 
   117 # generic attribute/value pair, handles no ... and single-param switches
   117 # generic attribute/value pair, handles no ... and single-param switches
   118 avpair: identifier word
   118 avpair: 	identifier word
   119 		{
   119 		{
   120 		if ($item[1] eq 'no') {
   120 		if ($item[1] eq 'no') {
   121 			$arg{ctx}->{$item[2]} = 0;
   121 			$arg{ctx}->{$item[2]} = 0;
   122 		} else {
   122 		} else {
   123 			$arg{ctx}->{$item[1]} = $item[2];
   123 			$arg{ctx}->{$item[1]} = $item[2];
   192 ip:		/\d+\.\d+\.\d+\.\d+/
   192 ip:		/\d+\.\d+\.\d+\.\d+/
   193 		{ $item[1] }
   193 		{ $item[1] }
   194 
   194 
   195 s_interface_l:  "1" s_interface_content[ctx => $arg{ctx}] eol
   195 s_interface_l:  "1" s_interface_content[ctx => $arg{ctx}] eol
   196 		| s_isdn[ctx => $arg{ctx}]
   196 		| s_isdn[ctx => $arg{ctx}]
       
   197 		| s_vrrp[ctx => $arg{ctx}]
   197 		| l_section
   198 		| l_section
   198 
   199 
   199 s_interface_content: l_description[ctx => $arg{ctx}]
   200 s_interface_content: l_description[ctx => $arg{ctx}]
   200 		| /(no)?/ "shutdown"
   201 		| /(no)?/ "shutdown"
   201 		{ $arg{ctx}->{shutdown} = ($item[1] eq 'no') ? 0 : 1 }
   202 		{ $arg{ctx}->{shutdown} = ($item[1] eq 'no') ? 0 : 1 }
   225 
   226 
   226 s_isdn:		"1" "isdn" eol s_isdn_l[ctx => ctx_rel($arg{ctx}, 'isdn')](s) "1" "exit" eol
   227 s_isdn:		"1" "isdn" eol s_isdn_l[ctx => ctx_rel($arg{ctx}, 'isdn')](s) "1" "exit" eol
   227 
   228 
   228 s_isdn_l:	"2" avpair[ctx => $arg{ctx}] eol
   229 s_isdn_l:	"2" avpair[ctx => $arg{ctx}] eol
   229 
   230 
       
   231 s_vrrp:		"1" "vrrp" num eol s_vrrp_l[ctx => ctx_rel($arg{ctx}, 'vrrp', $item{num})](s) "1" "exit" eol
       
   232 
       
   233 s_vrrp_l:	"2" avpair[ctx => $arg{ctx}] eol
       
   234 		| "2" "tracking-interface" iface_type iface_num eol
       
   235 		{
       
   236 		$arg{ctx}->{$item[2]} = {
       
   237 			type => $item{iface_type},
       
   238 			num => $item{iface_num}
       
   239 		}
       
   240 		}
       
   241 		| "2" "address" ip ip eol
       
   242 		{
       
   243 		$arg{ctx}->{$item[2]} = {
       
   244 			ip => $item[3],
       
   245 			mask => $item[4]
       
   246 		}
       
   247 		}
       
   248 
       
   249 
       
   250 
   230 # vrf
   251 # vrf
   231 l_vrf:		"0" "ip" "vrf" keyword eol
   252 l_vrf:		"0" "ip" "vrf" keyword eol
   232 		{ $::res->{"ip-vrf"} = $item{keyword} }
   253 		{ $::res->{"ip-vrf"} = $item{keyword} }
   233 
   254 
   234 via_iface:	iface_type iface_num
   255 via_iface:	iface_type iface_num