diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-06-25 06:59:52 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-06-26 09:38:27 +0900 |
commit | 3b3dcae1151305a92c8621bc601ddbff07d7738c (patch) | |
tree | 68a326c4ec9678a05d5359e05e0a5755fa0b9ec1 | |
parent | 1512e1ef496cde84184e2d0ee7f088b5ce89815c (diff) |
of1.2: add OXM_OF_IPV6_ND_TARGET
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_2_parser.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py index 8a8df91c..2edd12f2 100644 --- a/ryu/ofproto/ofproto_v1_2_parser.py +++ b/ryu/ofproto/ofproto_v1_2_parser.py @@ -942,6 +942,7 @@ class Flow(object): self.ipv6_flabel = 0 self.icmpv6_type = 0 self.icmpv6_code = 0 + self.ipv6_nd_target = [] self.mpls_lable = 0 self.mpls_tc = 0 @@ -1125,6 +1126,10 @@ class OFPMatch(object): self.fields.append( OFPMatchField.make(ofproto_v1_2.OXM_OF_ICMPV6_CODE)) + if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_IPV6_ND_TARGET): + self.fields.append( + OFPMatchField.make(ofproto_v1_2.OXM_OF_IPV6_ND_TARGET)) + if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_MPLS_LABEL): self.fields.append( OFPMatchField.make(ofproto_v1_2.OXM_OF_MPLS_LABEL)) @@ -1338,6 +1343,10 @@ class OFPMatch(object): self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_ICMPV6_CODE) self.flow.icmpv6_code = icmpv6_code + def set_ipv6_nd_target(self, target): + self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IPV6_ND_TARGET) + self.flow.ipv6_nd_target = target + def set_mpls_label(self, mpls_label): self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_MPLS_LABEL) self.flow.mpls_label = mpls_label @@ -1866,6 +1875,19 @@ class MTICMPV6Code(OFPMatchField): return MTICMPV6Code(header) +@OFPMatchField.register_field_header([ofproto_v1_2.OXM_OF_IPV6_ND_TARGET]) +class MTIPv6NdTarget(OFPMatchField): + def __init__(self, header): + super(MTIPv6NdTarget, self).__init__(header, '!4I') + + def serialize(self, buf, offset, match): + self.putv6(buf, offset, match.flow.ipv6_nd_target, []) + + @classmethod + def parser(cls, header, buf, offset): + return MTIPv6NdTarget(header) + + @OFPMatchField.register_field_header([ofproto_v1_2.OXM_OF_MPLS_TC]) class MTMplsTc(OFPMatchField): def __init__(self, header): |