<br><tt><font size=2>Daniel Veillard <veillard@redhat.com> wrote
on 10/06/2010 12:00:04 PM:<br>
<br>
> Re: [libvirt] [patch 4/5] nwfilter: Extend schema to accept state
attribute</font></tt>
<br><tt><font size=2>> <br>
> On Fri, Oct 01, 2010 at 08:28:53PM -0400, Stefan Berger wrote:<br>
> > Extend the nwfilter.rng schema to accept state attributes.<br>
> > <br>
> > Signed-off-by: Stefan Berger <stefanb@us.ibm.com><br>
> [...]<br>
> > +<br>
> > +  <define name='stateflags-type'><br>
> > +    <data type="string"><br>
> > +      <param name="pattern">((NEW|ESTABLISHED|RELATED|INVALID)(,<br>
> (NEW|ESTABLISHED|RELATED|INVALID))*|NONE)</param><br>
> > +    </data><br>
> > +  </define><br>
> >  </grammar><br>
> <br>
> Hum, we really want to accept something like<br>
>    NEW,NEW,NEW,NEW<br>
> ?<br>
> I understand that we may want to add RELATED to another state, but
that<br>
> regexp could probably be refined, isn't it ?</font></tt>
<br>
<br><tt><font size=2>The only solution that I could come up with is to
explicitly enumerate all possible</font></tt>
<br><tt><font size=2>combinations of the above 4 words (15 combinations).
This solution would then also</font></tt>
<br><tt><font size=2>force the user to provide them in a particular order:</font></tt>
<br>
<br><tt><font size=2>(A)|(B)|(C)|(D)|(A,B)|(A,C)|(A,D)|(B,C)|(B,D)|(C,D)|(A,B,C)|(A,B,D)|(A,C,D)|(B,C,D)|(A,B,C,D)</font></tt>
<br>
<br><tt><font size=2>When not forcing the user into a sequence we'd need
something like this here:</font></tt>
<br>
<br><tt><font size=2>(A)|(B)|(C)|(D)|(A,B)|(A,C)|(A,D)|(B,C)|(B,D)|(C,D)|(A,B,C)|(A,B,D)|(A,C,D)|(B,C,D)|(A,B,C,D)|</font></tt>
<br><tt><font size=2>               
(B,A)|(C,A),(D,A),(C,B),(D,B),(D,C),(A,C,B)|(A,D,B)|(A,D,C)|(B,D,C)|(A,B,D,C)|</font></tt>
<br><tt><font size=2>               
...</font></tt>
<br>
<br><tt><font size=2>I think the proposed solution is not as 'strict' as
it should be but compared to the other two</font></tt>
<br><tt><font size=2>solutions I think it is 'ok' -- unless there is a
fundamentally different way of writing this</font></tt>
<br><tt><font size=2>type of regex.</font></tt>
<br>
<br><tt><font size=2>Regards,</font></tt>
<br><tt><font size=2>   Stefan</font></tt>
<br>