<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="PL" style="font-size:11.0pt">Hello Bird users,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="PL" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am trying to filter routing table entries based on as-path regex ( I try to write regex: 32934 (3|5|7) )<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">bird> show route all where bgp_path ~ [= 32934 [3,5,7] =]<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt">syntax error, unexpected '[' -> I get this error<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt">bird><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">According to documentation I should be able to use sets inside [= =]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">bgpmask</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black">BGP masks are patterns used for BGP path matching (using </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">path ~ [= 2 3 5 * =]</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> syntax).
The masks resemble wildcard patterns as used by UNIX shells. Autonomous system numbers match themselves, </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">*</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> matches
any (even empty) sequence of arbitrary AS numbers and </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">?</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> matches one arbitrary AS number. For example,
if </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">bgp_path</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> is 4 3 2 1, then: </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">bgp_path
~ [= * 4 3 * =]</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> is true, but </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">bgp_path ~ [= * 4 5 * =]</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"> is
false. BGP mask expressions can also contain integer expressions enclosed in parenthesis and integer variables, for example </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">[= * 4 (1+2) a =]</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black">.
You can also use ranges (e.g. </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">[= * 3..5 2 100..200 * =]</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black">) and
<b>sets (e.g. </b></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:black">[= 1 2 [3, 5, 7] * =]</span></b><b><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black">).</span></b><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I tried some other options mentioned in documentation and all works, only this one with sets doesn’t work:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">bird> show route all where bgp_path ~ [= 32934 (4+1) =]
<b>-> works<o:p></o:p></b></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">bird> show route all where bgp_path ~ [= 32934 1..5 =]
<b>-> works</b><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Is it possible to use sets, or I faced bug?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dariusz<o:p></o:p></span></p>
</div>
</body>
</html>