405 Commits

Author SHA1 Message Date
Isaku Yamahata
b2f725c6df contrib/ovs: TypeError: bad operand type for unary -: 'NoneType'
This fixes the following exception:
When Stream.__scs_connecting doesn't change self.state, Stream.connect()
returns None as implicit return value. Thus, the following exception is raised.

conf_switch_set_handler 00003247b5e63145 ovsdb_addr tcp:172.17.60.198:6634
_ovsdb_update 00003247b5e63145 tcp:172.17.60.198:6634 172.17.60.198
_add_tunnel_ports <ryu.app.tunnel_port_updater.TunnelDP object at 0x14a5950> set([])
172.17.60.198 - - [2012-11-21 15:01:00] "PUT /v1.0/conf/switches/00003247b5e63145/ovsdb_addr HTTP/1.1" 201 120 0.267351
remote tcp:172.17.60.198:6634
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/app/tunnel_port_updater.py", line 289, in _serve_loop
    self._init()
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/app/tunnel_port_updater.py", line 125, in _init
    self.ovs_bridge.init()
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/bridge.py", line 103, in init
    self.br_name = self._get_bridge_name()
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/bridge.py", line 111, in _get_bridge_name
    self.run_command([command])
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/bridge.py", line 99, in run_command
    self.vsctl.run_command(commands, self.timeout, self.exception)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/vsctl.py", line 1006, in run_command
    self._run_command(commands)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/vsctl.py", line 999, in _run_command
    self._do_main(commands)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/vsctl.py", line 918, in _do_main
    self._init_schema_helper()
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/vsctl.py", line 805, in _init_schema_helper
    vswitch_idl.OVSREC_DB_NAME)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/lib/ovs/vsctl.py", line 793, in _rpc_get_schema_json
    error, reply = rpc.transact_block(request)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/contrib/ovs/jsonrpc.py", line 306, in transact_block
    error = self.send(request)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/contrib/ovs/jsonrpc.py", line 240, in send
    self.run()
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/contrib/ovs/jsonrpc.py", line 200, in run
    retval = self.stream.send(self.output)
  File "/home/yamahata/openvswitch/sp-lab/scarab/gre-tunnel/ryu-2/bin/ryu/contrib/ovs/stream.py", line 213, in send
    return -retval
TypeError: bad operand type for unary -: 'NoneType'
<Greenlet at 0x133fd10: <bound method TunnelDP._serve_loop of <ryu.app.tunnel_port_updater.TunnelDP object at 0x14a5950>>> failed with TypeError

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-22 18:25:17 +09:00
Sriram Natarajan
00ddd8906d of1.2: fix some error constant typos
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-21 13:23:21 +09:00
OHMURA Kei
91b4f9f5fa packet lib: add arp constants
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-20 07:41:59 +09:00
OHMURA Kei
c1dfc53488 add TLS support
This patch supports TLS connection to encrypt OF channel.

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-16 08:30:00 +09:00
HIYAMA Manabu
6afa1c35ec of1.2: Fix MTVlanVid() parser and serializer
- The OFPVID_PRESENT bit indicate the presence of a valid VLAN_ID.
- Reflect to unittests.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-06 20:16:33 +09:00
FUJITA Tomonori
6e14f983bc don't use select.POLL* constants
MacOS doesn't have POLL* constants (poll isn't supported by all OSes,
I guess).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-05 21:10:06 +09:00
OHMURA Kei
5ccf13809c ofctl_v1_0: update get_flow_stats() to dump actions
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-05 14:51:52 +09:00
Isaku Yamahata
d347dce3c4 wsgi/routes: add regex pattern for each REST component
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-03 15:57:05 +09:00
Isaku Yamahata
4b90f751ca contrib/ovs/dirs: replace @variables@ which is replaced by configure
Normally dirs.py is created from dirs.py.template by configure script.
Create it manually for our own copy.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2012-11-03 15:02:57 +09:00
Isaku Yamahata
8aefef51bd import ovs python binding library
From changeset 8087f5ff825cae3a699e5a60ca6dd0deb10fc8e5
dirs.py.template needs to be adopted for Ryu environment.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2012-11-03 15:02:57 +09:00
Isaku Yamahata
0ae9c29687 prepare contrib directory which holds third party library
- create ryu/contrib directory
- adjust module load path for third party library and prioritize our own copy
  than system's
- teach ryu-manager ryu/contrib
- run_tests.sh: exclude contrib dir for pep8
  third party files will be included under ryu/contrib.
  Third party files aren't suitable to our pep8 check because they aren't under
  our control.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2012-11-03 15:02:57 +09:00
HIYAMA Manabu
6eeddaa2a4 of1.2: Fix OFPActionExperimenter parser
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-01 17:18:55 +09:00
HIYAMA Manabu
4f7b30dad2 packet lib: remove unnecessary ICMP debug message
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-11-01 13:11:25 +09:00
FUJITA Tomonori
552d77ee17 Ryu 1.4
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v1.4
2012-10-31 10:36:31 +09:00
OHMURA Kei
56516378e0 ryu/app/ofctl_rest: implements ofctl_rest app
This patch implements REST API for accessing state. This module helps
your debugging and retrieving various statistics. It also supports
flow entry pusher to allow users to manually insert flows into switch.

- get all switch DPIDs connected to the controller
 $ curl http://<controller_ip>:8080/stats/switches

- get the desc stats
 $ curl http://<controller_ip>:8080/stats/desc/<dpid>

- get flows stats
 $ curl http://<controller_ip>:8080/stats/flow/<dpid>

- get ports stats
 $ curl http://<controller_ip>:8080/stats/port/<dpid>

- add a flow entry
 $ curl -d '{"dpid": "1", "cookie":"0", "priority":"32768", \
   "actions":[{"port":2, "type":"OUTPUT"}], "match":{"in_port":1}}' \
   http://<controller_ip>:8080/stats/flowentry

- delete all flows of the switch
 $ curl -X DELETE \
   http://<controller_ip>:8080/stats/flowentry/clear/<dpid>

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-30 11:40:39 +09:00
OHMURA Kei
3e74c789e9 ryu/lib/ofctl_v1_0: introduce OF interface
This patch provides the raw OF interface. We can talk with a switch
by using the OF interface via some protocols such as REST.

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-30 11:39:52 +09:00
HIYAMA Manabu
51b3b9a2bd test: add unittests for packet library
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-23 13:33:43 +09:00
FUJITA Tomonori
3027becda1 silence unhandled event message
Users misunderstand that this harmful message is critical. Let's
silence it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-17 03:54:28 +09:00
HIYAMA Manabu
21f29c6f41 test: add unittests for packet library
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-12 02:29:23 +09:00
HIYAMA Manabu
c92d8be079 packet lib: fix udp header length
Fix the f5d2157 commit.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-12 02:28:57 +09:00
HIYAMA Manabu
c42673def1 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>
2012-10-12 02:28:32 +09:00
Isaku Yamahata
398d9a4ba3 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>
2012-10-12 02:28:11 +09:00
FUJITA Tomonori
f5d21573a5 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>
2012-10-11 03:34:10 +09:00
FUJITA Tomonori
ef8284dfd1 doc: update packet library
Use Packet class iterator feature

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-06 13:16:18 +09:00
FUJITA Tomonori
fd692d330d 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>
2012-10-06 13:16:17 +09:00
FUJITA Tomonori
5a0eea61fa 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>
2012-10-06 13:16:15 +09:00
FUJITA Tomonori
5fd538ee7f packet lib: make Packet class iterator
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-06 13:16:13 +09:00
OHMURA Kei
9c30012955 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>
2012-10-05 23:37:18 +09:00
FUJITA Tomonori
9314fa4c64 packet lib: add mpls
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-05 19:00:32 +09:00
HIYAMA Manabu
7ad45aa1c1 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>
2012-10-05 18:57:59 +09:00
OHMURA Kei
12e9445c87 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>
2012-10-04 10:59:24 +09:00
Isaku Yamahata
b624e6369b 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>
2012-10-03 05:24:06 +09:00
Isaku Yamahata
05a9c4d8f3 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>
2012-10-03 05:23:22 +09:00
Isaku Yamahata
0c3dd305c6 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>
2012-10-03 05:22:18 +09:00
FUJITA Tomonori
94965a3b5b 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>
2012-10-02 11:32:23 +09:00
FUJITA Tomonori
5483d98824 Ryu 1.3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v1.3
2012-09-30 21:58:41 +09:00
HIYAMA Manabu
fc264cc971 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>
2012-09-30 21:48:05 +09:00
HIYAMA Manabu
19c205b897 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>
2012-09-26 13:11:16 +09:00
HIYAMA Manabu
79e7d09cf0 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>
2012-09-26 13:11:10 +09:00
HIYAMA Manabu
bb05f39c3a 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>
2012-09-26 13:06:03 +09:00
YAMADA Hideki
09c70176ab packet lib: tcp option support
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-18 10:31:33 +09:00
FUJITA Tomonori
3cd6423a3f doc: fix typo in openstack.rst
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:48 +09:00
FUJITA Tomonori
83e53c5065 doc: rearrange top page
Rearrange the top page in the following way:

- Getting Started
- Cloud Integration (OpenStack only for now)
- Developing Your App

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:47 +09:00
FUJITA Tomonori
e1e85442ff doc: use README as getting_started
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:45 +09:00
FUJITA Tomonori
9b3246a630 doc: rename getting_started.rst -> parameters.rst
The 'getting_started' content overlaps with README. It also includes
more advanced information than 'getting_started'. This is preparation
for making README 'getting_started'.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:44 +09:00
FUJITA Tomonori
8b7950dc36 doc: rearrange openstack docs
The following docs are about OpenStack:

using_with_openstack.rst
step_by_step.rst
how_l2_segregation_work.rst

So let's create 'OpenStack' section in the index and put three under
the section.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-14 16:31:25 +09:00
FUJITA Tomonori
5e8d29832d doc: packet library
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-14 16:30:43 +09:00
Yoshihiro Kaneko
8f28a48a2a app/simple_isolation: update handler registration
This patch only removes unnecessary methods that didn't accord with
the library changed at ae0253a36c8787b645d33eb109636ca009d65f96.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-12 12:37:59 +09:00
Hiyama Manabu
d26cbddf26 packet lib: fix ipv4 flags bitshift
Fixed flags bitshift.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-10 14:31:36 +09:00
FUJITA Tomonori
ae0253a36c simplify handler registration core
- we don't need register_cls() any more.
- register_instance() isn't called with dispatchers argument.
- set_ev_cls is always called with dispatchers argument.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-05 09:23:37 +09:00