How about symbolic value for 7, 8, 9 and 0x3f?

On Wed, Jul 10, 2013 at 12:52:37PM +0900, YAMAMOTO Takashi wrote:
> 
> Signed-off-by: YAMAMOTO Takashi <[email protected]>
> ---
>  ryu/ofproto/ofproto_v1_3_parser.py |  4 ++--
>  ryu/ofproto/oxm_fields.py          | 12 ++++++++++--
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/ryu/ofproto/ofproto_v1_3_parser.py 
> b/ryu/ofproto/ofproto_v1_3_parser.py
> index 2a4e472..734749f 100644
> --- a/ryu/ofproto/ofproto_v1_3_parser.py
> +++ b/ryu/ofproto/ofproto_v1_3_parser.py
> @@ -418,12 +418,12 @@ class OFPMatch(StringifyMixin):
>                  assert len(value) == len(mask)
>                  pack_str = "!I%ds%ds" % (len(value), len(mask))
>                  msg_pack_into(pack_str, buf, field_offset,
> -                              ofproto_v1_3.oxm_tlv_header_w(n, len(value)),
> +                              (n << 9) | (1 << 8) | (len(value) * 2),
>                                value, mask)
>              else:
>                  pack_str = "!I%ds" % (len(value),)
>                  msg_pack_into(pack_str, buf, field_offset,
> -                              ofproto_v1_3.oxm_tlv_header(n, len(value)),
> +                              (n << 9) | (0 << 8) | len(value),
>                                value)
>              field_offset += struct.calcsize(pack_str)
>  
> diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
> index e44962c..2637645 100644
> --- a/ryu/ofproto/oxm_fields.py
> +++ b/ryu/ofproto/oxm_fields.py
> @@ -67,10 +67,15 @@ class IPv6Addr(TypeDescr):
>      from_user = addrconv.ipv6.text_to_bin
>  
>  
> +OFPXMC_OPENFLOW_BASIC = 0x8000
> +
> +
>  class D(object):
> +    _class = OFPXMC_OPENFLOW_BASIC
> +
>      def __init__(self, name, num, type_):
>          self.name = name
> -        self.num = num
> +        self.num = num | (self._class << 7)
>          self.type = type_
>  
>  
> @@ -129,7 +134,10 @@ def generate_constants(modname):
>  
>      for i in oxm_types:
>          uk = string.upper(i.name)
> -        ofpxmt = i.num
> +        oxm_class = i.num >> 7
> +        if oxm_class != OFPXMC_OPENFLOW_BASIC:
> +            continue
> +        ofpxmt = i.num & 0x3f
>          td = i.type
>          add_attr('OFPXMT_OFB_' + uk, ofpxmt)
>          add_attr('OXM_OF_' + uk, mod.oxm_tlv_header(ofpxmt, td.size))
> -- 
> 1.8.1.5
> 
> 
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

-- 
yamahata

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to