Changed pack string of IPv6 address from former '!4I' to '!16s'. Might need an IPv6Addr class or something to convert between human readable address and binary representation.
Signed-off-by: Can Zhang <[email protected]> --- ryu/ofproto/nx_match.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py index 715129c..90e3b37 100644 --- a/ryu/ofproto/nx_match.py +++ b/ryu/ofproto/nx_match.py @@ -57,6 +57,7 @@ MF_PACK_STRING_BE32 = '!I' MF_PACK_STRING_BE16 = '!H' MF_PACK_STRING_8 = '!B' MF_PACK_STRING_MAC = '!6s' +MF_PACK_STRING_IPV6_ADDR = '!16s' _MF_FIELDS = {} @@ -453,7 +454,7 @@ class MFField(object): def _putv6(self, buf, offset, value): ofproto_parser.msg_pack_into(self.pack_str, buf, offset, - *value) + value) return self.n_bytes def putv6(self, buf, offset, value, mask): @@ -725,10 +726,18 @@ class MFArpSha(MFField): @_register_make @_set_nxm_headers([ofproto_v1_0.NXM_NX_IPV6_SRC, ofproto_v1_0.NXM_NX_IPV6_SRC_W]) [email protected]_field_header([ofproto_v1_0.NXM_NX_IPV6_SRC, + ofproto_v1_0.NXM_NX_IPV6_SRC_W]) class MFIPV6Src(MFField): + pack_str = MF_PACK_STRING_IPV6_ADDR + + def __init__(self, header, value, mask = None): + super(MFIPV6Src, self).__init__(header, MFIPV6Src.pack_str) + self.value = value + @classmethod def make(cls, header): - return cls(header, '!4I') + return cls(header, MFIPV6Src.pack_str) def put(self, buf, offset, rule): return self.putv6(buf, offset, @@ -739,10 +748,18 @@ class MFIPV6Src(MFField): @_register_make @_set_nxm_headers([ofproto_v1_0.NXM_NX_IPV6_DST, ofproto_v1_0.NXM_NX_IPV6_DST_W]) [email protected]_field_header([ofproto_v1_0.NXM_NX_IPV6_DST, + ofproto_v1_0.NXM_NX_IPV6_DST_W]) class MFIPV6Dst(MFField): + pack_str = MF_PACK_STRING_IPV6_ADDR + + def __init__(self, header, value, mask = None): + super(MFIPV6Dst, self).__init__(header, MFIPV6Dst.pack_str) + self.value = value + @classmethod def make(cls, header): - return cls(header, '!4I') + return cls(header, MFIPV6Dst.pack_str) def put(self, buf, offset, rule): return self.putv6(buf, offset, -- 1.7.11.1 ------------------------------------------------------------------------------ Own the Future-Intel(R) Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
