lib/packet: make protocol_name property instead of attributes

Because it is read-only and to prevent accidental over-write.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/packet: make packet_base.parser abstract method

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/packet: teach packet library to truncate padding octet

The patch teaches packet library to truncate padding octets.
Change packet_base.parser() to return (header, next_type, rest_of_packet)
The protocol class that knows its payload length should rest_of_packet
where padding octets at the last of packet is truncated.

As bonus,
- fix ipv6 parser as ipv6 header doesn't have options.
  It seems copy-and-paste from ipv4
- improve ipv4, tcp a bit

Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Shaun Crampton <Shaun.Crampton@metaswitch.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
openstack copyright notice

restore openstack copyright notice for the code taken from them.

> commit f2c6dfe1066aeecb5fdf2fb1cd5ce6476565fd24
> Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Date:   Fri Nov 30 15:54:12 2012 +0900
>
>     set setup.py install_requires properly
>
>     Let's enable pip to solve the dependency.
>
>     The code is taken from OpenStack.
>
>     Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
StringifyMixin: json support

factor out guts of StringifyMixin into a separate module.
add methods to convert to/from json.loads/dumps-compatible dictionary.
this is mainly for json representation of of-wire (OFPxxx) classes.
of-wire json: adapt OF1.0

From: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
of-wire json: adapt OF1.0 nicira extention

this is probably incomplete but better than nothing.
of-wire json: adapt OF1.2
ofproto_v1_2_parser: omit mask attribute from str() when appropriate

normalize str() outputs so that tests like str(msg1) == str(msg2)
more likely succeed.
of-wire json: adapt OF1.3
ofproto_v1_3_parser: omit mask attribute from str() when appropriate

normalize str() outputs so that tests like str(msg1) == str(msg2)
more likely succeed.
test_parser_v12: abuse this to test to_jsondict and from_jsondict
add a test for ryu.lib.stringify
of-wire json test: expected results
of-wire json test: a program to generate test data for unit tests
of-wire json test: change the of_protocol upstream

for now, use my fork of of_protocol, which contains necessary
fixes for our purpose.

this commit is separated from the rest of mkdata so that
it can be easily reverted when the upstream took the necessary
changes.
of-wire json test: generated data for unit test
of-wire json test: unit test