py_gen: support embedding of_bsn_vport_q_in_q_t
Obviously oftype.py should figure this out automatically. Maybe when we create
a better representation of types than C strings this will be easier.
diff --git a/py_gen/oftype.py b/py_gen/oftype.py
index 679d9d6..2a8fdd0 100644
--- a/py_gen/oftype.py
+++ b/py_gen/oftype.py
@@ -73,6 +73,8 @@
v = 'common.port_desc()'
elif self.base == 'of_meter_features_t':
v = 'common.meter_features()'
+ elif self.base == 'of_bsn_vport_q_in_q_t':
+ v = 'common.bsn_vport_q_in_q()'
else:
v = "None"
@@ -95,7 +97,7 @@
return 'struct.pack("!6B", *%s)' % expr_expr
elif self.base == 'of_ipv6_t':
return 'struct.pack("!16s", %s)' % expr_expr
- elif self.base in ['of_match_t', 'of_port_desc_t', 'of_meter_features_t']:
+ elif self.base in ['of_match_t', 'of_port_desc_t', 'of_meter_features_t', 'of_bsn_vport_q_in_q_t']:
return '%s.pack()' % expr_expr
elif self.base == 'of_port_name_t':
return self._gen_string_pack_expr(16, expr_expr)
@@ -156,6 +158,8 @@
return self._gen_string_unpack_expr(reader_expr, 256)
elif self.base == 'of_meter_features_t':
return 'common.meter_features.unpack(%s)' % (reader_expr)
+ elif self.base == 'of_bsn_vport_q_in_q_t':
+ return 'common.bsn_vport_q_in_q.unpack(%s)' % (reader_expr)
elif self.base == 'list(of_instruction_t)':
return 'instruction.unpack_list(%s)' % (reader_expr)
elif self.base.startswith('list('):