test: add more of1.2 integration tests

- some tests need attached port to switch.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: ipv4 option data support

also make checksum handling consistent with the other code.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: fix vlan pcp bitshift

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix zero padding

- zfill() is a func of the string to be putting in a '0'.
  bytearray().zfill(n) -> bytearray(n)

- unify notation of zero with other code.
  '\0' -> '\x00'

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu 1.3

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Removed leading '/' from data_files

This was preventing from creating a package on Windows machines where
there is no /etc/ folder.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.0: fix/add PortMod message

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
utils: a helper function to convert byte array into hex string

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofp_handler: print msg.data in hex format, not raw string

Printing raw string causes terminal in unexpected mode.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add icmp.py

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test: fix unittests for of parser

- use bytearray(n) instead of str().zfill(n)
- test data are more strictly.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add mpls

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: fix icmp echo serialize

Fix the merge breakage.

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: make Packet class iterator

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: set protocol_name in each protocol

With this, it's easy to know the protocol name.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: kill find_protocol in Packet class

- Now easy to know the protocol name and iterate protocols.

- find_protocol doesn't handle the case the same protocols are stacked.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
doc: update packet library

Use Packet class iterator feature

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add unparsed data to Packet.protocols

Easy to access to the data that the library can't parse.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tools/pip-requires: add routes which is used by wsgi.py module

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: fix ipv4 assertion of option field

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>