[PATCH] FilterEntry: Set HdrProtocolID8021 property

src/Virt_FilterEntry.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) # HG changeset patch # User Eduardo Lima (Etrunko) <eblima@br.ibm.com> # Date 1317929569 10800 # Node ID 8384b32b9a79999bcf3c414d94bc18789b6d9318 # Parent e6c6f9ccb51303f67fce26e74de9ab746d10a04b FilterEntry: Set HdrProtocolID8021 property Also remove a couple of duplicate (CMPIValue *) casts. Signed-off-by: Eduardo Lima (Etrunko) <eblima@br.ibm.com> diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c --- a/src/Virt_FilterEntry.c +++ b/src/Virt_FilterEntry.c @@ -27,6 +27,8 @@ #include <arpa/inet.h> +#include <stdlib.h> + #include "acl_parsing.h" #include "misc_util.h" #include "xmlgen.h" @@ -247,7 +249,7 @@ array = octets_to_cmpi(broker, bytes, size); if (array != NULL) - CMSetProperty(inst, "HdrDestMACAddr8021", (CMPIValue *) + CMSetProperty(inst, "HdrDestMACAddr8021", (CMPIValue *)&array, CMPI_uint8A); memset(bytes, 0, sizeof(bytes)); @@ -256,8 +258,16 @@ array = octets_to_cmpi(broker, bytes, size); if (array != NULL) - CMSetProperty(inst, "HdrDestMACMask8021", (CMPIValue *) + CMSetProperty(inst, "HdrDestMACMask8021", (CMPIValue *)&array, CMPI_uint8A); + + if (rule->var.mac.protocol_id != NULL) { + unsigned long n = strtoul(rule->var.mac.protocol_id, + NULL, 16); + CMSetProperty(inst, "HdrProtocolID8021", + (CMPIValue *)&n, CMPI_uint16); + } + } static void fill_rule_data(struct acl_rule *rule,

+1 & pushed. On 10/06/2011 03:48 PM, Eduardo Lima (Etrunko) wrote:
src/Virt_FilterEntry.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-)
# HG changeset patch # User Eduardo Lima (Etrunko)<eblima@br.ibm.com> # Date 1317929569 10800 # Node ID 8384b32b9a79999bcf3c414d94bc18789b6d9318 # Parent e6c6f9ccb51303f67fce26e74de9ab746d10a04b FilterEntry: Set HdrProtocolID8021 property
Also remove a couple of duplicate (CMPIValue *) casts.
Signed-off-by: Eduardo Lima (Etrunko)<eblima@br.ibm.com>
diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c --- a/src/Virt_FilterEntry.c +++ b/src/Virt_FilterEntry.c @@ -27,6 +27,8 @@
#include<arpa/inet.h>
+#include<stdlib.h> + #include "acl_parsing.h" #include "misc_util.h" #include "xmlgen.h" @@ -247,7 +249,7 @@
array = octets_to_cmpi(broker, bytes, size); if (array != NULL) - CMSetProperty(inst, "HdrDestMACAddr8021", (CMPIValue *) + CMSetProperty(inst, "HdrDestMACAddr8021", (CMPIValue *)&array, CMPI_uint8A);
memset(bytes, 0, sizeof(bytes)); @@ -256,8 +258,16 @@
array = octets_to_cmpi(broker, bytes, size); if (array != NULL) - CMSetProperty(inst, "HdrDestMACMask8021", (CMPIValue *) + CMSetProperty(inst, "HdrDestMACMask8021", (CMPIValue *)&array, CMPI_uint8A); + + if (rule->var.mac.protocol_id != NULL) { + unsigned long n = strtoul(rule->var.mac.protocol_id, + NULL, 16); + CMSetProperty(inst, "HdrProtocolID8021", + (CMPIValue *)&n, CMPI_uint16); + } + }
static void fill_rule_data(struct acl_rule *rule,
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent@linux.vnet.ibm.com
participants (2)
-
Chip Vincent
-
Eduardo Lima (Etrunko)