Note that now ryu uses /etc/ryu/ryu.conf. The previous install path
(/usr/etc/ryu/ryu.conf) doesn't fit to FHS.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu uses NOX's code based on twisted for web service. It's much
cleaner to use webob since Ryu doesn't use twisted framework. Let's
give up the NOX compatibility (incomplete) and go with the cleaner
code.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
It's a really bad idea to close a connection with a switch when
getting OFPT_ERROR_MSG. For example, ryu should continue to run about
'Request was not understood' type error because ryu doesn't know what
request types the switch supports.
Let applications catch OFPT_ERROR_MSG and do whatever they want. The
core should not do anything.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We use OFPT_* names for class names. So 'OFPGetConfigReply' looks more
appropriate for OFPT_GET_CONFIG_REPLY.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
unittest crashes on commit e5e4b8442:
ERROR: testInit (ryu.tests.unit.sample.test_simple_switch.TestSimpleSwitch)
Traceback (most recent call last):
File "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/tests/unit/sample/test_simple_switch.py", line 20, in testInit
ss = SimpleSwitch()
File "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/app/simple_switch.py", line 44, in __init__
self.mac2port = kwargs['mac2port']
KeyError: 'mac2port'
The simple_switch unittest doesn't test anything anyway so let's
remove it for now.
This also fixes a pip8 error of simple_switch.py that the commit
e5e4b8442 added.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Traceback (most recent call last):
File "bin/ryu-manager", line 71, in <module>
main()
File "bin/ryu-manager", line 53, in main
app_mgr.instantiate_apps(**contexts)
File "/Users/fujita/git/ryu/ryu/base/app_manager.py", line 102, in instantiate_apps
app = cls(*args, **kwargs)
File "/Users/fujita/git/ryu/ryu/app/simple_switch.py", line 44, in __init__
self.mac2port = kwargs['mac2port']
KeyError: 'mac2port'
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The ryu-manager creates structures which applications share.
Currently it is hard-coded in ryu-managers. Concretely network.Network and
dpset.DPSet. It is difficult to maintain the code appropriately by hand.
When the application is changed or new application comes in, ryu-manager
also must be updated.
So introduce the notion of application context so that application manager
can determine what structures applications want to share and create them.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enabls a vendor to register vendor's specific parser to handle
Switch to Controller Vendor messages.
An object that vendor's parser returns is placed at msg.data.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We use NXTRequest for Switch-to-Controller messages so let's rename it
to an appropriate name.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
NXT_ROLE_REQUEST/REPLY use the same on-wire format (NX_ROLE_PACK_STR).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
OFPStatsReply needs to handle variable-length bodys so having two
parsers (parser_stats_body_array and parser_stats_body) doesn't make
sense. Just kill parser_stats_body_array().
cls_stats_body_cls_size is also pointless since OFPStatsReply needs to
handle variable-length bodys. OFPStatsReply class needs to know if a
stats class is array or not. So register_stats_type takes
'body_single_struct' instead of body_cls_size. We need to change this
scheme if we need to handle VendorStats in the same way (both array
and single struct). But currently we don't even have any VendorStats
implementation so let's invent something more complicated when it
becomes necessary.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
OFPStatsReply parser_stats_body_array needs body classes to have
length field.
We could set length as class-wide constants for classes having a fixed
length however we have two classes that need a variable length so
let's set the length in the same way for all the stats classes.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- __str__ method: needs to pass a tuple to msg_str_attr
- parser method: rate shouldn't be a tuple.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>