This patch adds the header_only parameter to nxm_entry's pack method.
Signed-off-by: Saul St. John <[email protected]>
---
pox/openflow/nicira.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pox/openflow/nicira.py b/pox/openflow/nicira.py
index 35499a3..9a70b0c 100644
--- a/pox/openflow/nicira.py
+++ b/pox/openflow/nicira.py
@@ -507,7 +507,7 @@ class nx_reg_load (of.ofp_action_vendor_base):
o = self.dst()
o._force_mask = False
- dst = o.pack(omittable=False)[:4]
+ dst = o.pack(omittable=False, header_only=True)[:4]
p = struct.pack('!HH4sQ', self.subtype, ofs_nbits, dst, self.value)
return p
@@ -880,7 +880,7 @@ class nxm_entry (object):
if self.is_reg != other.is_reg: return False
return True
- def pack (self, omittable = False):
+ def pack (self, omittable = False, header_only = False):
h = self._nxm_type << 9
mask = self._mask
@@ -908,6 +908,7 @@ class nxm_entry (object):
assert value is not None
assert len(value) == self._nxm_length, "value is wrong length"
+ if header_only: return r
r += value
if mask is not None:
assert 0 == sum(ord(v)&(0xff&~ord(m)) for v,m in zip(value,mask)), \
--
1.7.10.4