pyloxi: fix of_wc_bmap_t for OF 1.2+
This field changed semantics, so the LOXI type probably should change too.
diff --git a/py_gen/templates/_pretty_print.py b/py_gen/templates/_pretty_print.py
index 5709227..86cb237 100644
--- a/py_gen/templates/_pretty_print.py
+++ b/py_gen/templates/_pretty_print.py
@@ -48,7 +48,7 @@
q.text(util.pretty_mac(self.${m.name}))
:: elif m.oftype.base == 'uint32_t' and m.name.startswith("ipv4"):
q.text(util.pretty_ipv4(self.${m.name}))
-:: elif m.oftype.base == 'of_wc_bmap_t':
+:: elif m.oftype.base == 'of_wc_bmap_t' and version in [1,2]:
q.text(util.pretty_wildcards(self.${m.name}))
:: elif m.oftype.base == 'of_port_no_t':
q.text(util.pretty_port(self.${m.name}))
diff --git a/py_gen/templates/util.py b/py_gen/templates/util.py
index f2f7a96..397c184 100644
--- a/py_gen/templates/util.py
+++ b/py_gen/templates/util.py
@@ -52,6 +52,7 @@
set_flags.append("%#x" % v)
return '|'.join(set_flags) or '0'
+:: if version in [1,2]:
def pretty_wildcards(v):
if v == const.OFPFW_ALL:
return 'OFPFW_ALL'
@@ -60,6 +61,7 @@
'OFPFW_NW_SRC_MASK', 'OFPFW_NW_DST_MASK', 'OFPFW_DL_VLAN_PCP',
'OFPFW_NW_TOS']
return pretty_flags(v, flag_names)
+:: #endif
def pretty_port(v):
named_ports = [(k,v2) for (k,v2) in const.__dict__.iteritems() if k.startswith('OFPP_')]