Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-16 Thread Daniel P. Berrange
On Tue, Apr 15, 2014 at 12:05:46PM -0400, Stefan Berger wrote: > On 04/15/2014 10:30 AM, Daniel P. Berrange wrote: > >On Tue, Apr 15, 2014 at 10:06:22AM -0400, Stefan Berger wrote: > >>On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: > >>>+bool virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefP

Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-15 Thread Stefan Berger
On 04/15/2014 10:30 AM, Daniel P. Berrange wrote: On Tue, Apr 15, 2014 at 10:06:22AM -0400, Stefan Berger wrote: On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: +bool virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule) +{ +if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_NONE &

Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-15 Thread Daniel P. Berrange
On Tue, Apr 15, 2014 at 10:06:22AM -0400, Stefan Berger wrote: > On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: > >+bool virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule) > >+{ > >+if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_NONE && > >+rule->prtclType <= VIR_NWFILT

Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-15 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: +bool virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule) +{ +if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_NONE && +rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_IPV6) +return true; +return false; +} I get

Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: Add virNWFilterRuleIsProtocol{Ethernet,IPv4,IPv6} helper methods to avoid having to write a giant switch statements with many cases. Signed-off-by: Daniel P. Berrange ACK -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.c

[libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-08 Thread Daniel P. Berrange
Add virNWFilterRuleIsProtocol{Ethernet,IPv4,IPv6} helper methods to avoid having to write a giant switch statements with many cases. Signed-off-by: Daniel P. Berrange --- src/conf/nwfilter_conf.c | 27 ++ src/conf/nwfilter_conf.h | 14 src/l