test_ofp_pktinfilter: simplify

stop inheriting RyuApp class to make the implementation of
other tests (tests.cmd.test_manager) easiler.
this module is for packet_in_filter decorator and does not
start ryu app anyway.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests: add a test case for ofproto_protocol

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto_protocol: fix UnboundLocalError

fix the following crash.
from Yuichi Ito.  minor editorialization by me.

> Traceback (most recent call last):
>   File "/usr/local/bin/ryu-manager", line 9, in <module>
>     load_entry_point('ryu==3.6', 'console_scripts', 'ryu-manager')()
>   File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 73, in main
>     services.extend(app_mgr.instantiate_apps(**contexts))
>   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 368, in instantiate_apps
>     self._instantiate(app_name, cls, *args, **kwargs)                         >   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 350, in _instantiate
>     ofproto_protocol.set_app_supported_versions(cls.OFP_VERSIONS)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_protocol.py", line 40, in set_app_supported_versions
>     _versions &= set(vers)
> UnboundLocalError: local variable '_versions' referenced before assignment

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ProtocolDesc: provide supported_ofp_version for ofp_handler

Reported-by: watanabe.fumitaka
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test_ofp_pktinfilter: replace a hack with ProtocolDesc

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test_parser_v12: replace a hack with ProtocolDesc

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test_ofctl_v1_3: replace a hack with ProtocolDesc

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: fix wrong instruction(write metadata) value of test files

The value of instruction(write metadata) of the test file is wrong.
In the table-miss test of of13/match/02_METADATA* test files,
 metadata=255 or 240(mask=0xf0) is specified as match.
In order to make it table-miss, it needed to write metadata except 255.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: fix wrong match(ipv6_exthdr) value of test file

The value of match(ipv6_exthdr) of the
 of13/match/39_IPV6_EXTHDR.json test file is wrong.
The correct value matching to a ipv6(ext_hdrs=[hop_opts,auth])
 is ipv6_exthdr=001000100=68.
This patch corrects it.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of12: fix InstructionWriteMetadata json decoder

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: remove unnecessary debug code

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: correct error message

When test tool receives a malformed packet(length value is unusual,
 for example), detecting differences between expected and received is
 a failure.  In this case, 'Internal error.' is not suitable as a log
 message and should notify tool receives a malformed packet.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: correct the comparison method to treat instructions as the set

according to OF spec, the instruction is treated as the set.  this
means that the order of instructions which flow_stat message returns
is inconstant.  this patch corrects the comparison method of
instructions by sorting in a particular order before comparison.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: FIX: return the transaction id when flow entries were deleted

OfTester._test_initialize() expects the transaction id as a return
value of TargetSw.del_test_flow() for checking the error.  but this
method at current version does not return the transaction id.

this patch gets del_test_flow() to return the transaction id.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_v1_3: let action group can be converted to string

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Reviewed-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
run_tests.sh: add of-config-cli to PYLINT_INCLUDE

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config_cli: remove a unused import

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
pbb: add a comment

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto_v1_3_parser: add a comment about extensions support

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
neutron-ofswitch-agent: neutron agent for ofswitch ML2 mechanism driver

Like ryu-manager, this agent serves Ryu applications and acts an OpenFlow
controller to control switches.  The neutron agent logic, which we will
push to the neutron repo, is implemented as a Ryu application.

Implements: OpenStack blueprint ryu-ml2-driver
https://blueprints.launchpad.net/neutron/+spec/ryu-ml2-driver
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>