Compare commits

..

1862 Commits

Author SHA1 Message Date
Josh Bailey
d6cda4f427
Merge pull request #170 from anarkiwi/readme
Add project status.
2022-06-09 16:09:40 -07:00
Josh Bailey
8499b4e59e Add project status. 2022-06-09 22:35:47 +00:00
Josh Bailey
537f35f4b2
Merge pull request #151 from crezov/master
fix NXActionRegLoad action_to_str
2021-09-10 10:17:24 +12:00
Josh Bailey
e67d259bba
Merge branch 'master' into master 2021-09-09 20:44:25 +12:00
Josh Bailey
ef58b40b4b
Merge pull request #152 from jbemmel/tunnel_endpoint_ip_and_mac_mobility_params
Patch to add 2 parameters for controlling specific EVPN route update fields
2021-09-09 20:44:12 +12:00
Josh Bailey
442d9f8197
Merge branch 'master' into tunnel_endpoint_ip_and_mac_mobility_params 2021-09-09 19:31:33 +12:00
Josh Bailey
0307a4e666
Merge pull request #153 from jbemmel/patch-1
Fix bug where path.source is set to VRF_TABLE (in vrf.py)
2021-09-09 19:31:20 +12:00
Josh Bailey
eead1ac358
Merge branch 'master' into patch-1 2021-09-09 18:25:59 +12:00
Josh Bailey
2e703468b0
Merge pull request #155 from jbemmel/patch-2
Fix major bug in child thread cleanup logic
2021-09-09 18:25:46 +12:00
J vanBemmel
ac849e3d4f
Fix major bug in child thread cleanup logic
Without this fix, one cannot restart BGP Speaker instances
2021-09-05 20:09:16 -05:00
J vanBemmel
df421911cb
Fix bug where path.source is set to VRF_TABLE (in vrf.py) 2021-09-04 16:41:26 -05:00
Jeroen van Bemmel
a09cae5a85 Use constants imported from API base 2021-09-03 22:56:15 -05:00
Jeroen van Bemmel
5722c7c856 Patch to add 2 parameters for controlling specific fields in EVPN route advertisements:
tunnel_endpoint_ip: To allow for VTEP IPs other than the implicit local router ID
mac_mobility: To insert an extended community with a sequence number for managing MAC Mobility
2021-09-03 22:48:01 -05:00
guojiaoniu
a44ace4987 fix NXActionRegLoad action_to_str 2021-08-31 22:50:33 +08:00
Josh Bailey
65663d4f9f
Merge pull request #97 from NvanAdrichem/point-to-multipoint
Enabled point-to-multipoint links in topology discovery.
2021-08-19 08:44:28 +12:00
Josh Bailey
f3d8c366db
Merge branch 'master' into point-to-multipoint 2021-08-18 12:53:50 +12:00
Josh Bailey
1a17208833
Merge pull request #150 from anarkiwi/ev
Eventlet 0.31.1
2021-08-03 14:52:58 +12:00
Josh Bailey
824ee13113 Eventlet 0.31.1 2021-07-26 10:55:04 +12:00
Josh Bailey
08efd69c0b
Merge pull request #144 from anarkiwi/pytype3
add ofproto 1.3 coverage, check key-error and attribute-error.
2021-06-10 12:12:35 +12:00
Josh Bailey
98d4913d32 add ofproto 1.3 coverage, check key-error and attribute-error. 2021-06-07 03:50:02 +00:00
Josh Bailey
34f33491ff
Merge pull request #142 from anarkiwi/pytype2
Enable bare minimum pytype + GHA (no ryu code changes).
2021-06-03 16:23:41 +12:00
Josh Bailey
8b41507c2c Enable bare minimum pytype + GHA (no ryu code changes). Exclusions/ignored errors can be incrementally removed, to manage diff size and risk. 2021-06-03 03:40:49 +00:00
Josh Bailey
f24e2b9bf1
Merge pull request #141 from anarkiwi/ev2
Upgrade eventlet.
2021-06-01 08:32:35 +12:00
Josh Bailey
dfe583bd83 Upgrade eventlet. 2021-06-01 08:02:07 +12:00
Josh Bailey
2eae52100b
Merge pull request #140 from anarkiwi/trpc
upgrade tinyrpc to 1.0.4.
2021-05-26 12:28:30 +12:00
Josh Bailey
bff06a2b05 upgrade tinyrpc to 1.0.4. 2021-05-26 00:02:52 +00:00
Josh Bailey
d1d1dc9427
Merge pull request #133 from anarkiwi/pippin
pin pip to 20.3.4.
2021-02-23 09:53:51 +13:00
Josh Bailey
a004f57c1f pin pip to 20.3.4. 2021-02-22 10:56:47 +13:00
Josh Bailey
1eaa77d334
Merge pull request #131 from anarkiwi/ev
eventlet 0.30.1
2021-02-10 14:19:46 +13:00
Josh Bailey
62e1ec6998 0.30.1 2021-02-10 10:33:28 +13:00
Josh Bailey
3c86fc00e4
Merge pull request #102 from SantiagoMunoz/master
doc: Consider null buffer_id in first example
2021-02-01 13:00:51 +13:00
Josh Bailey
42957ee824
Merge branch 'master' into master 2021-02-01 12:51:28 +13:00
Josh Bailey
91542b29b7
Merge pull request #86 from MrCocoaCat/patch-1
Update bridge.py
2021-02-01 10:33:04 +13:00
Josh Bailey
f26a60b1e1
Merge branch 'master' into patch-1 2021-02-01 10:24:09 +13:00
Josh Bailey
a5b4af99d4
Merge pull request #76 from ben51/master
Adding support for RFC8227 withdraw label
2021-02-01 10:13:31 +13:00
Josh Bailey
688fc4bf06
Merge branch 'master' into master 2021-02-01 10:04:47 +13:00
Josh Bailey
e69191a067
Merge pull request #83 from ben51/adj_rib_out_draft
Add support for Adj-RIB-Out (draft-ietf-grow-bmp-adj-rib-out-03)
2021-02-01 10:04:25 +13:00
Josh Bailey
fe1ca30fd4
Merge branch 'master' into adj_rib_out_draft 2021-02-01 09:54:35 +13:00
Josh Bailey
5b1343d7bc
Merge pull request #79 from DiegoRossiMafioletti/patch-1
Update nx_actions.py, fixing a typo on example
2021-02-01 09:47:47 +13:00
Josh Bailey
0e29dbe9ef
Merge branch 'master' into patch-1 2021-02-01 09:38:30 +13:00
Josh Bailey
1d9881145e
Merge pull request #72 from tahoe/patch-1
Just some English correction
2021-02-01 09:37:42 +13:00
Josh Bailey
58b287bc90
Merge branch 'master' into master 2021-02-01 09:14:32 +13:00
Josh Bailey
f3316fa85a
Merge branch 'master' into patch-1 2021-02-01 09:13:50 +13:00
Josh Bailey
bd1d5de383
Merge pull request #128 from cglewis/eventlet
revert #100, use latest eventlet
2021-01-21 09:16:07 +13:00
cglewis
045eca0592 Merge branch 'master' of https://github.com/faucetsdn/ryu into eventlet 2021-01-20 11:55:58 -08:00
Josh Bailey
dc7aa0abef
Merge pull request #122 from musicinmybrain/msgpack-1.0
Support msgpack 1.0.0 and later.
2021-01-21 08:52:24 +13:00
Josh Bailey
1310c2eda4
Merge pull request #121 from LKaemmerling/add-python-3.9-support
Add Support for Python 3.9
2021-01-21 08:51:27 +13:00
cglewis
ea4112f393 revert #100, use latest eventlet 2021-01-20 10:40:50 -08:00
Lukas Kämmerling
afa2f83559 Add Support for Python 3.9 2021-01-20 10:49:29 +01:00
Josh Bailey
d2f06b7f46
Merge pull request #127 from cglewis/renovate
add renovate
2021-01-20 15:21:17 +13:00
cglewis
8740dd97e4 add renovate 2021-01-19 17:59:31 -08:00
Benjamin Beasley
aa10cac1db Add msgpack 1.0 support; use version testing to preserve compatibility with older versions 2021-01-19 10:59:45 -05:00
Benjamin Beasley
8990ed47ed Enforce new msgpack format (use_bin_type=True) in ryu.services.protocols.bgp.net_ctrl.RpcSession; this option is already used in ryu.lib.rpc.MessageEncoder 2021-01-19 10:59:45 -05:00
Benjamin Beasley
0a1e1e81cf Bump minimum msgpack verson to 0.4.0, since ryu/lib/rpc.py uses the use_bin_type option to msgpack.Packer 2021-01-19 10:59:45 -05:00
Josh Bailey
476d12100a
Merge pull request #126 from cglewis/remove-travis
remove travis, move to github actions
2021-01-19 10:26:41 +13:00
cglewis
0e6ddebe75 remove travis, move to github actions 2021-01-18 13:06:05 -08:00
Josh Bailey
846e5ec026
Merge pull request #124 from cglewis/tests
fix docker tests and print output for python3
2021-01-19 08:43:30 +13:00
Josh Bailey
03d205c4dd
Merge pull request #125 from cglewis/gha-tests
add github actions for tox tests
2021-01-19 08:43:12 +13:00
cglewis
7fc22c00e1 add github actions for tox tests 2021-01-18 09:59:58 -08:00
cglewis
8533f7ef3f fix docker tests and print output for python3 2021-01-17 16:50:38 -08:00
Brad Cowie
a394673993
Merge pull request #106 from michaelharo/syntaxwarning
Resolve a syntax warning
2020-09-25 09:51:41 +12:00
Brad Cowie
27e5f64eda
Merge pull request #105 from michaelharo/nd_option_mtu
Add support for the MTU ND option.
2020-09-25 09:50:25 +12:00
Michael Haro
830b49798f Resolve a syntax warning 2020-07-20 07:43:35 -07:00
Michael Haro
ca597a5e09 Add support for the MTU ND option. 2020-07-20 07:20:34 -07:00
shinkasbe
0e0f66e119
doc: Fix typo on example 2020-06-16 10:14:42 +01:00
Santiago Rodriguez
20c0ececeb doc: Consider null buffer_id in first example
If the switch does not buffer the packet (like when using mininet), the example does not work.
For such cases, include the packet contents in  OFPPacketOut
2020-06-14 16:13:22 +01:00
Brad Cowie
861587c8ed
Merge pull request #100 from gizmoguy/py3.7-tls
Workaround eventlet Python3.7 SSLContext wrap issue
2020-06-12 16:27:57 +12:00
Brad Cowie
8a62f25371
Merge pull request #101 from gizmoguy/stickler
Add .stickler.yml.
2020-06-12 15:47:53 +12:00
Brad Cowie
f1b46fdebe Add .stickler.yml. 2020-06-12 15:18:59 +12:00
Brad Cowie
7559befd58 Allow user to set cipher list. 2020-06-12 14:53:37 +12:00
Brad Cowie
ddb32f678a Add workaround for Python3.7+ eventlet bug. 2020-06-12 13:58:25 +12:00
Artem Abramov
906b3a3ea5 Bugfix now multiple switches can connect with TLS
This fixes a bug in RYU StreamServer where SSLContext was modified for
each connection. Now the SSLContext of the server socket is modified
only once in __init__
2020-06-12 13:58:25 +12:00
Brad Cowie
32b6560bfb
Merge pull request #99 from gizmoguy/test-tidy
Tidy up travis test environment
2020-06-12 13:30:12 +12:00
Brad Cowie
15382e4972 Don't need to keep our requirements in sync with OpenStack. 2020-06-12 11:23:03 +12:00
Brad Cowie
dea688e5a6 Upgrade to ubuntu bionic. 2020-06-12 11:03:00 +12:00
Brad Cowie
9b002e0eec Update python versions for tox test environments. 2020-06-12 11:03:00 +12:00
Brad Cowie
7344c15b01 pylint 2020-06-12 11:03:00 +12:00
Brad Cowie
03affce4c9
Merge pull request #98 from gizmoguy/msgpack
We don't support msgpack 1.0.0 yet.
2020-06-12 11:01:55 +12:00
Brad Cowie
171bf3a6e1
Merge pull request #96 from gizmoguy/deprecate-py2
Deprecate older python versions
2020-06-12 11:01:21 +12:00
Brad Cowie
885db99eeb We don't support msgpack 1.0.0 yet. 2020-06-11 16:52:55 +12:00
Niels van Adrichem
f2d72cc34b Enabled point-to-multipoint links in topology discovery. 2020-06-09 16:51:32 +02:00
Brad Cowie
b6bf01a5c9 Remove workaround for issue with older python versions. 2020-06-08 14:34:42 +12:00
Brad Cowie
3395daccfe Deprecate using Ryu with older python versions. 2020-06-08 14:34:31 +12:00
Brad Cowie
f4bed28fa0
Merge pull request #92 from gizmoguy/fix-api-docs
Add .readthedocs.yml.
2020-05-23 11:16:58 +12:00
Brad Cowie
814c8a757a Add .readthedocs.yml. 2020-05-23 11:12:24 +12:00
Brad Cowie
73de59b27b
Merge pull request #88 from gizmoguy/update-urls
Update URLs.
2020-05-12 16:35:41 +12:00
Brad Cowie
7dad6e1e4b
Merge pull request #90 from gizmoguy/contributing
Update how to contribute to Ryu.
2020-05-12 16:35:21 +12:00
Brad Cowie
10a9f79c6a Update how to contribute to Ryu. 2020-05-12 16:32:54 +12:00
Brad Cowie
5fd42fff66 Update URLs. 2020-05-12 14:04:33 +12:00
Scott
c343376849 updated jsonrpc.Session call to have correct arguments for latest version of ovs
Signed-off-by: Scott <sdyear@gmail.com>
2020-04-22 15:49:06 +09:00
Grant Curell
be289978c7 Fix two bugs in simple switch 13 examples
- dpid with leading 0s would be truncated to less than 16 characters
- Response object incorrectly used body type when it should use text
2020-04-01 10:13:07 -05:00
MrCocoaCat
c565ec6f77
Update bridge.py
Sometimes you don't know 'datapath_id', you need to initialize the class with 'br_name'
2020-03-20 18:34:30 +08:00
Adrian Freund
e3ebed7943 Restrict tinyrpc to version 0.9.4 as newer versions break python2 support 2019-11-27 13:18:39 +01:00
FUJITA Tomonori
c776e4cb68 Ryu 4.34
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-01 19:42:10 +09:00
Benjamin Villain via Ryu-devel
0866cb7d48 Add support for revised RFC8227 withdraw labels
This commit fixes a parsing error when a BGP update contains a "withdraw label"
equal to 0x000000 instead of 0x8000000 as stated in RFC 3107. This commits
treats both labels as "withdraw label"

Signed-off-by: Benjamin Villain <villainb@amazon.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2019-09-25 15:59:38 +09:00
Benjamin Villain via Ryu-devel
4e0fc9e72d Add support for Adj-RIB-Out (draft-ietf-grow-bmp-adj-rib-out-03)
Signed-off-by: Benjamin Villain <villainb@amazon.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2019-09-25 15:59:31 +09:00
Benjamin Villain
d1b1b471e7 Add support for Adj-RIB-Out (draft-ietf-grow-bmp-adj-rib-out-03) 2019-09-20 14:30:09 +10:00
FUJITA Tomonori
29b8d7d28b drop Python 3.4 CI test
Python 3.4 is officially dead.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-08-01 16:27:36 +09:00
FUJITA Tomonori
bc111ac10d Ryu 4.33
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-08-01 16:09:20 +09:00
FUJITA Tomonori
a295810f77 fix style errors
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2019-07-18 20:59:43 +09:00
Ozgur Yurekten
550e890671 nx_action_encap and nx_action_decap classes are defined
Signed-off-by: Ozgur Yurekten <ozgur.yurekten@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2019-07-18 20:43:09 +09:00
FUJITA Tomonori
6456711a34 Ryu 4.32
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-05-02 18:55:39 +09:00
Diego Rossi Mafioletti
faffcb80d4
Update nx_actions.py, fixing a typo on example
Change parser.NXActionResubmit to parser.NXActionResubmitTable, according to right OpenFlow action.
2019-04-11 07:09:42 -03:00
Atzm Watanabe
6f906e72c9 app/ofctl: fix possible deadlock
When datapath reconnects/disconnects, waiting requests on old
datapath should be canceled.  Otherwise, threads that sent
requests may fall into deadlock because replies possibly never
come.

Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-09 20:27:31 +09:00
FUJITA Tomonori
050bfbc711 Ryu 4.31
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-01 21:41:06 +09:00
IWAMOTO Toshihiro
01a09a0e02 Choose the highest TLS version
Please note that this is a stop-gap measure.  Also add a basic SSL
server test.

Co-authored-by: alex <atoptsoglou@suse.com>
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-03-28 11:41:01 +09:00
FUJITA Tomonori
56e8fb3f57 Ryu 4.30
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-03 19:37:16 +09:00
Bill Allen
1b38505909 Grammatical improvements to some of the documentation.
Signed-off-by: Bill Allen <photo.allen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-10-20 07:24:35 +09:00
FUJITA Tomonori
d074e15a48 Ryu 4.29
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-10-03 14:21:56 +09:00
Benjamin Villain
62b4c07464 Adding support for RFC8227 withdraw label
According to RFC8227, many vendors don't properly implement RFC3107
related to withdraw label. Indeed, it happens that a speaker sends
a label of 0x000000 in place of 0x800000 to signal a route withdrawal.
As a result, the parser fails to parse the message since it doesn't stop
at the withdraw label and tries to parse more label than there is.

This commit fixes this by considering both 0x800000 and 0x000000 as withdraw
labels.
2018-09-28 14:25:00 +10:00
Atzm Watanabe
e3aa55872b app/ofctl: fix possible deadlock when the datapath disconnects
Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
2018-09-26 15:34:16 +09:00
FUJITA Tomonori
0031cff9a3 Ryu 4.28
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-09-01 21:54:08 +09:00
Slawek Kaplonski
d7d526ad21 Fix convertion of ipv4 to string on i386 and arch
On architectures like i386 or arm convertion of IPv4 to string
was failing in some cases.
It was like that because some integer values were converted to
long which is not the case on x86_64.
It was like that for example with value "2871386400" which is
used in ryu.tests.unit.ofproto.test_parser_v10:TestOFPMatch unit
test.
Because of that this test was failing when running on architectures
where integer range was too small to handle this value.

Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
Reviewed-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-14 06:17:01 -07:00
IWASE Yusuke
8312ab23b3 mrtlib: Define JSON representation types
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-11 20:05:04 +09:00
IWASE Yusuke
bc5bf0dbb6 test_mrtlib: Test cases for ADD_PATH
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-11 20:04:57 +09:00
IWASE Yusuke
807185470e mrtlib: Support RFC8050
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-11 20:04:50 +09:00
IWASE Yusuke
ccedf4cfb3 mrtlib: Missing subclass for SUBTYPE_RIB_*_MULTICAST
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-11 20:04:30 +09:00
FUJITA Tomonori
a2bcf0a7e6 Ryu 4.27
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-02 20:04:48 +09:00
IWAMOTO Toshihiro
840a348845 Declare support of recent python3 versions
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-01 16:00:12 +09:00
IWAMOTO Toshihiro
19662c5688 Test more python versions on travis CI
It seems tests weren't correctly run because of interactions between
travis CI env and tox venv.  Also, run the scenario test on more
recent python3, as python3.4 is going away.
The test uses a lot of memory and fails with pypy, so it's disabled for now.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-01 16:00:11 +09:00
IWAMOTO Toshihiro
6e9fbad22e Bump oslo.config to 2.5.0
Ryu is using item_type since commit f77529036, so oslo.config minimum
version needs to be updated.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-01 16:00:10 +09:00
Slawek Kaplonski
49b5e5c30a Fix UT when running in python 3.7 env
Due to change [1] in python 3.7 one of ryu's unit tests
was failing with this version of interpreter. It was like that
because of missing __qualname__ attribute in functools.partial
object.
This patch fixes it by adding such attribute if it's not
set already.

[1] https://github.com/python/cpython/pull/4496

Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
Acked-By: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-31 07:19:53 +09:00
IWAMOTO Toshihiro
b39ff68f82 lib/ovs/bridge: Return multiple controllers
OVSBridge may have more than one controller. Let get_controller()
return a list of controllers in such cases.

NOTE: this introduces incompatibility if multiple controllers are
configured for a bridge.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-21 14:50:44 +09:00
IWASE Yusuke
e848eaa57e BGPSpeaker: Enable to specify remote port for neighbor
Currently, the remote port of neighbor is the hard-coded value 179.

This patch enables to specify the remote port of neighbor in
"BGPSpeaker.neighbor_add()" API.

Suggested-by: Suresh Kumar <knetsolutions2@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-07-15 16:23:47 +09:00
IWAMOTO Toshihiro
d96e6a60ab switch.tester: Fix name shadowing
tester.py imported all the classes from the packet library at the top level
namespace. This commit adds CLSNAME_ALIASES dict so that those classes
with the same names can be imported as different names.
This fixes an issue reported by ted.nozaki in ryu-devel:
https://sourceforge.net/p/ryu/mailman/message/36312622/

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-15 15:55:24 +09:00
IWAMOTO Toshihiro
2c6a053f8d gui_topology: Avoid wildcard URL matching
GUIServerController eats up the entire URL space and sometimes causes
problems. See the following thread in ryu-devel for example:

https://sourceforge.net/p/ryu/mailman/message/36312411/

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-15 15:53:40 +09:00
FUJITA Tomonori
b9909d0686 Ryu 4.26
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-01 20:10:13 +09:00
IWAMOTO Toshihiro
704dcc786a nx_actions: Fix NXActionSetTunnel docstring
set_tunnel and set_field:xxx->tun_id are different actions.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:05:11 +09:00
IWAMOTO Toshihiro
4bc29b2c5f Fix pycodestyle W605 warnings
W605 invalid escape sequence, which was recently added in pycodestyle,
would be a syntax error in future python3 versions.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:05:08 +09:00
IWASE Yusuke
b1ec9ed457 BGPSpeaker: Fix BGP state string conversion
The constants BGP_FSM_* are str type values and not callable.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:04:53 +09:00
IWASE Yusuke
56aff9adf3 pycodestyle: Ignore W504
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:04:46 +09:00
IWASE Yusuke
db7338b8db BGPSpeaker: Advertise local routes to RR clients
The current implementation misses the mandatory attributes when sending
locally generated routes to its Route Reflector (RR) clients, then the
clients will reject the received routes.

This patch fixes to add or update attributes to for sending locally
generated routes its RR clients.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:04:30 +09:00
IWAMOTO Toshihiro
a6bda030d3 pip: Blacklist eventlet 0.23.0
This is to sync with OpenStack requirements.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 11:10:25 +09:00
IWAMOTO Toshihiro
482aabcb1e lldp: Remove remaining SystemCapabilities.subtype from tests
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 10:42:59 +09:00
Marcin Chron
99fc573a9c lldp: fixed SystemCapabilities TLV
This patch removes 'Subtype' byte from SystemCapabilities TLV.
There was an inconsistency in offical IEEE document which was corrected
in 802.1AB-2009/Cor 1-2013.

Signed-off-by: Marcin Chron <marcin_miko1@o2.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 10:42:26 +09:00
FUJITA Tomonori
c29c9019ac Ryu 4.25
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-01 20:43:17 +09:00
Joe Mader
cda5bc7825 allow versions of eventlet > 0.21.0 2018-05-13 09:40:00 -06:00
FUJITA Tomonori
1c008060fa Ryu 4.24
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-04-01 15:15:49 +09:00
IWAMOTO Toshihiro
b8ebdbe961 ofproto: add Nicira extension ct_clear action
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-28 18:02:06 +09:00
IWASE Yusuke
4e10ba4438 ofproto: Encode data field on OFPErrorMsg
Currently, when Ryu failed to negotiate the OpenFlow version with a
switch, Ryu will send the OFPT_ERROR message with an error reason on its
data field.
But on Python 3, error reason string is a str type value and required to
be encoded into a bytes type value, otherwise causes an exception when
sending the message.

This patch fixes to encode the given str value into a bytes type value
in OFPErrorMsg.__init__() and solves this problem.

Signed-off-by: William Fisher <william.w.fisher@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 22:11:39 +09:00
IWASE Yusuke
3003d475d2 ofp_handler: Close socket when HELLO failed
With this patch, when failed to negotiate the OpenFlow version with a
switch, Ryu will close the socket connecting to the switch after sending
a OFPT_ERROR message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 22:11:38 +09:00
IWASE Yusuke
afbc80352c controller: Wait for switch to disconnect connection
If a sender closes a socket immediately after sending some data, a
receiver can fail to receive full data from the sender.

This patch fixes to shutdown a socket with "SHUT_WR" (disallows further
sends only) and enables "Datapath" to wait for a switch to disconnect
the connection.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 22:11:32 +09:00
IWASE Yusuke
7a40d5c2f3 controller: Option to close socket after sending Message
Currently, Ryu does not provide the way to close a socket connecting to
a switch after sending all enqueued messages, but provides only the way
to close the socket immediately regardless of enqueued messages.

This patch adds a new option "close_socket" into "Datapath.send_msg()"
method and this option enables to close the socket after sending the
given message. This patch is convenient to close the socket after
sending OFPT_ERROR message to the switch.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 22:11:25 +09:00
IWASE Yusuke
976914f5e6 controller: Improve pylint result
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 22:11:19 +09:00
IWASE Yusuke
fe06d87f65 test_requirements: Avoid using pip as library
Because importing "pip" in Python scripts is not supported usage of
"pip", this patch fixes to use "pkg_resources" + "urllib" instead.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 15:55:20 +09:00
IWASE Yusuke
a27c56a054 utils: Remove "parse_requirements" function
This patch removes unused function "parse_requirements" in order to
avoid using "pip" as a Python library.

Note: Officially "from pip import req as pip_req" is not supported usage
of "pip".

Reported-by: Katsaounis Molyvas Stamatios <mokats@intracom-telecom.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-26 15:55:18 +09:00
Thomas Bechtold
e6773539b5 Switch to msgpack in pip-requires
msgpack-python got renamed to msgpack[1] so use the new name.

[1] https://pypi.python.org/pypi/msgpack/0.5.1

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
Acked-By: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-20 22:36:04 +09:00
IWASE Yusuke
a0f90115cc nicira_ext: Support DEC_NSH_TTL action
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-20 22:32:51 +09:00
IWASE Yusuke
684b665290 nicira_ext: Support Network Service Header match
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-20 22:32:50 +09:00
IWASE Yusuke
0841f3f253 doc: Fix unexpected indent in ofctl.api doc
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-05 20:28:17 +09:00
FUJITA Tomonori
8a48b62c90 Ryu 4.23
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-02 10:29:20 +09:00
IWASE Yusuke
09d2811569 doc: Document for ryu.lib.ovs
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-10 18:45:58 +09:00
IWASE Yusuke
bd384997ac lib/ovs: Fix a typo of "--may-exist" option
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-10 18:45:58 +09:00
FUJITA Tomonori
fb224e23b9 Ryu 4.22
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-01 20:56:39 +09:00
IWASE Yusuke
fa172559c5 bgp/application: Add note for BGPSpeaker API reference
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:47 +09:00
IWASE Yusuke
7d0b080e73 BGPSpeaker: Move docstring from __init__ to class
By the default, Sphinx does not include __init__() method for the
"autoclass" directive, and currently the description for the arguments
of BGPSpeaker is not generated.

This patch moves the docstring of __init__() to the class's docstring
and enables to generate the docs for the arguments of __init__().

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:45 +09:00
IWASE Yusuke
80312a4d64 BGPSpeaker: Enable to notify adj-RIB-in changed
This patch introduces a new argument "adj_rib_in_change_handler" into
BGPSpeaker and enables to notify adj-RIB-in changed to watchers.

Also this patch enables to "bgp.application.RyuBGPSpeaker" to notify a
new event EventAdjRibInChanged to other Ryu applications.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:41 +09:00
Dennis
d0cd93c1a0
Just some English correction
Just some clarification in a sentence.
2018-01-18 10:33:22 -08:00
IWASE Yusuke
e81ec3fb01 ofctl: Enable to get all datapath objects
Also, updates the API document of ryu.app.ofctl.api.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:53 +09:00
IWASE Yusuke
37c73db7b1 confroller/dpset: Add usage example of instantiation
This patch adds the example to explain how to register dpset.DPSet
service and how to get DPSet instance from user application in order to
call the API of DPSet.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:52 +09:00
IWASE Yusuke
81cdd4f0d7 test_rpc: Adopt to msgpack-python>=0.50
msgpack-python version 0.50 or later supports bytearray objects, this
patch fixes to adopt to this change.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:14 +09:00
IWASE Yusuke
c3b484c787 doc: Usage for ryu/services/protocols/bgp/application.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:13 +09:00
FUJITA Tomonori
8287e3513a Ryu 4.21
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-02 13:49:50 +09:00
IWASE Yusuke
6e3eccb453 *: Apply autopep8
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:47 +09:00
IWASE Yusuke
83650576e4 travis: Introduce autopep8 test
This patch add a new test using "autopep8" to keep codes reformatted
easily by using Python tool.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:46 +09:00
IWASE Yusuke
d64db265b3 *: Adopt to pycodestyle's checks
This patch adopts to the following pycodestyle's checks;
  E275: missing whitespace after keyword
  E305: expected 2 blank lines after end of function or class

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:42 +09:00
IWASE Yusuke
bdf3549563 pycodestyle: Replace pep8
pep8 has been renamed to pycodestyle and will be removed in a future
release.

This patch replaces pep8 by pycodestyle and adding some settings for
pycodestyle.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:41 +09:00
IWASE Yusuke
870dcab678 ofproto_v1_5_parser: oxm_ids with name str in OFPActionCopyField
Currently, oxm_ids argument of OFPActionCopyField should be a list of
OFPOxmId instances, but this patch enables to specify with the OXM field
name as the str type value which is corresponding to the keywords of
OFPMatch.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:33 +09:00
IWASE Yusuke
4602651b2c ofproto_v1_5_parser: Missing trailing pads of OFPActionCopyField
OpenFlow Spec 1.5 says OFPActionCopyField has the trailing paddings to
make the action a whole multiple of 8 bytes in length.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:33 +09:00
IWASE Yusuke
aa9f3f483c ofproto_v1_5_parser: Fix length calculation of OFPOxmId
Currently, the oxm_length field is always composed with zero value
because OpenFlow Spec does not still clarify whether its value should be
doubled if the hasmask bit is set.

This patch fixes to compose the oxm_length value with the payload length
because Open vSwitch strictly checks the oxm_length which contained in
the OFPAT_COPY_FIELD action (introduced at OpenFlow 1.5), and this
causes the OFPT_ERROR messages then flows will not be installed.

Note: This patch does not backport this fix to ofproto_v1_3_parser.py
and ofproto_v1_4_parser.py because those modules are tested based on the
implementation of "linc/of_protocol" which supposes the oxm_length is
always zero. Also OFPOxmId should be rarely serialized at the controller
side when using OpenFlow 1.3 or 1.4.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:31 +09:00
Felician Nemeth
385b628d70 ovsdb: Fix small bug
Signed-off-by: Felicián Németh <nemethf@tmit.bme.hu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 23:42:31 +09:00
IWAMOTO Toshihiro
1493f51daa packet_data_generator3: Generate OF13 Ext-230 bundle packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:10 +09:00
IWAMOTO Toshihiro
381216075f packet_data_generator3: Support ovs-2.8
From ovs 2.8, ovs-ofctl tries to collect port descriptions, which
isn't handled by the fake server in gen.py.  Pass the --no-names
option to work around this.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:09 +09:00
IWAMOTO Toshihiro
9fa0b58199 ofproto_v1_3: Add bundle extension
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:05 +09:00
IWAMOTO Toshihiro
98ea9024ed ofproto: Correct OFPBundle{Ctrl, Add}Msg docstrings
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:34:16 +09:00
IWASE Yusuke
bf83292364 rest_vtep: Add some descriptions for troubleshooting
This patch adds some notes about the settings when using the Mininet
VMs for the environment on which rest_vtep.py running.

Reported-by: Varun Amrutiya <h20170244@pilani.bits-pilani.ac.in>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:34:00 +09:00
IWASE Yusuke
7e6f3f00ed topology: Enable to detect migrations of hosts
Currently, the topology library does not update the position of a host
which was detected before even if the host migrated to another port.

This patch enables to detect the migrations of the hosts when the host
is detected on another port.

Reported-by: Mahmoud Elzoghbi <mahmoud.said.elzoghbi@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:33:41 +09:00
FUJITA Tomonori
63f81837fd Ryu 4.20
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-02 09:50:31 +09:00
morland
7f6d8730ab fix bug in the example of flow_stats_reply
Signed-off-by: morland <mqy_bs@hotmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 11:30:13 +09:00
Thomas Boros
9aa56ef3bd app: added simple switch with openflow 1.5 support
Signed-off-by: Thomas Boros <tomas.boros92@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 10:48:26 +09:00
IWASE Yusuke
4d26387910 ofproto_v1_5_parser: Change default of command_bucket_id
Currently, Ryu will send the OFPGroupMod message with
"command_bucket_id=0" by the default if using the OpenFlow version 1.5.
OTOH, Open vSwitch expects "command_bucket_id=OFPG_BUCKET_ALL" if
"command" is other than OFPGC_INSERT_BUCKET or OFPGC_REMOVE_BUCKET,
otherwise OVS will rejects the OFPGroupMod message.

This patch changes the default value of "command_bucket_id" to
OFPG_BUCKET_ALL as OVS expects.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 10:33:23 +09:00
Jerico Moeyersons
3b946c0192 app: Fix simple_switch for multi switch env
Currently, the matches of flows in the learning switch examples are based
on the destination and the in_port. In a multi-OF-switch environment this
could cause issues when doing calls from a host on a first switch to
multiple hosts on another switch, namely that new destinations aren't
added as a flow because the source is already known on the second switch
(when doing multiple calls to different hosts on another switch).
This patch fixes this issue by adding the eth_src to the match field.

Reported-by: Jerico Moeyersons <jerico09@hotmail.com>
2017-11-28 10:28:12 +09:00
Charlie Lewis
ed2c6eca22 doc: fix typo 2017-11-18 12:26:49 +09:00
IWASE Yusuke
6ec8802a00 test_icmpv6: Catch proper Exception
In some test cases in test_icmpv6.py, @raises() decorator does not catch
the correct Exception, because "pack" function cannot be resolved and it
need to be specified as "struct.pack".

This patch fixes to this unresolved references and make it more strictly
matching of Exception class (e.g., AssertionError).

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-16 09:15:47 +09:00
IWASE Yusuke
f3d752178c packet/icmp: Avoid TypeError when calculating length
Currently, ICMPv4 packet instance without its payload, it will raise
TypeError when calculating packet length, because the default value of
"data" field (payload data) is None and len() can not be applied against
None type object.

This patch changes the default value of "data" to the empty binary
value and confirms the value type of "data" field before serialization.
Also, this patch applies the same improvements to ICMPv6 packet library.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-16 09:15:28 +09:00
Satoshi Fujimoto
2599aef3bf *: Reject Binary Represented IP Addresses
As a default, netaddr.valid_ipv4() uses the "aton" rule for its validation,
so valid_ipv4('2') and valid_ipv4('1.2.3') returns True.
It may cause unexpected behaviors.

This commit replaces netaddr.valid_ipv4() to ryu.lib.ip.valid_ipv4(),
which is wrapper of netaddr.valid_ipv4(), and use "pton" rule in the method.
So, address representation like '2' or '1.2.3' will be rejected.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-16 09:15:12 +09:00
Satoshi Fujimoto
8185637767 serivice/bgp: Fix ssh connection problem in Python 2.7
Currently, 'is_connected' attribute in SshServer is refered
before it is created, in Python 2.7.
This raises an Exception and the SSH operation won't work
anymore after this happens.
This commit ensures that 'is_connected' is created before
it is refered.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-05 21:10:03 +09:00
IWASE Yusuke
5bde6ae440 flags: Inject __class__ attribute to LooseVersion
Currently, ryu-manager uses distutils.version.LooseVersion for
"--zapi-frr-version" to parse the given version sting.
With custom type class for oslo_config.cfg.Opt, oslo_config might access
__class__ attribute for equal comparison.
But in case on Python 2, LooseVersion does not have __class__ attribute
and it causes AttributeError. (This error is not always reproduced)

This patch injects required attribute into LooseVersion and avoids this
problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-02 11:18:03 +09:00
IWASE Yusuke
eda4940eb8 library_ovsdb_manager: Descriptions for OVS configs
To connect OVSDB Manager library to OVS, some additional configurations
on OVS is required, but currently no description about these
configurations.

This patch adds descriptions for OVS configurations and includes some
improvements of sample application.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-02 09:20:55 +09:00
Satoshi Fujimoto
92730dc7e9 app/ofctl: Enable to send single BarrierRequest
Currently, with ryu.app.ofctl.api.send_msg(),
a BarrierRequest will send with every messages.
So, using send_msg() with a BarrierRequest will
cause duplex transmission of BarrierRequests.

This commit enables to send a single BarrierRequest
if send_msg() is used with a BarrierRequest
by avoiding sending an additional BarrierRequest.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:22:37 +09:00
IWASE Yusuke
66bdeaa7b5 packet/zebra: Support FRRouting version 3.0
This patch enables to support Zebra messages of FRRouting version 3.0
and introduces a flag to switch FRRouting version.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:22:09 +09:00
IWAMOTO Toshihiro
6e51b2a41d of14: Implement OFPBundleCtrlMsg parser
Copied from of15 implementation.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:44 +09:00
IWASE Yusuke
98d97b992e rest_qos: Avoid None when deleting OVSDB addr
Currently, rest_qos.py will raise AttributeError when deleting OVSDB
server address because rest_qos.py will try to split the given address
string but the address is None when deleting.

This patch checks if the given address is None or not before the string
manipulation and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:11 +09:00
IWASE Yusuke
253ce73b7f lib/ovs/vsctl: Function for validate OVSDB address
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:09 +09:00
FUJITA Tomonori
51a1130f6c Ryu 4.19
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 21:48:39 +09:00
IWASE Yusuke
e1e85052f5 BGPSpeaker: Enable to specify local listen addresses
Currently, BGPSpeaker will listen the incoming connection with the
unspecified IP addresses ('0.0.0.0' and '::').

This patch enables to specify the local listen address list for starting
BGPSpeaker instance.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:21:23 +09:00
IWASE Yusuke
6329444165 bgp/application: Enhance arguments handling for BGPSpeaker
Currently, when new arguments are introduced into BGPSpeaker,
ryu.application.RyuBGPSpeaker need modifications to support the
introduced arguments.

This patch enables to pass arguments to BGPSpeaker without some
modifications on RyuBGPSpeaker.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:21:21 +09:00
IWASE Yusuke
7ef14a83a2 test_controller: Test cases for _split_addr()
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:41 +09:00
IWASE Yusuke
09d5b2533c controller: APIs to register switch address dynamically
This patch introduces APIs to register/unregister switch address after
Ryu (ofp_handler) starting.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:39 +09:00
IWASE Yusuke
f775290360 controller: Support proactive connection
This patch enables to initiate OpenFlow connection from controller side
by using "--ofp-switch-address-list" and "--ofp-switch-connect-interval"
options.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:38 +09:00
FUJITA Tomonori
6e69e9b8a6 Ryu 4.18
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-03 13:38:51 +09:00
IWASE Yusuke
3c22bf4144 zclient/zserver: Support FRRouting messages format
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:32 +09:00
IWASE Yusuke
bf9b8ac588 test_zebra: Enhance test cases
Note: The binary representation is not extracted from the real packets
and based on the implemetation, so might be required to be fixup with
the real packets.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:31 +09:00
IWASE Yusuke
aedd3920b3 packet/zebra: Support MPLS Labels messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_MPLS_LABELS_ADD
 - FRR_ZEBRA_MPLS_LABELS_DELETE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:29 +09:00
IWASE Yusuke
e423a1f0bc packet/zebra: Support Interface Router Advertisement messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_INTERFACE_ENABLE_RADV
 - FRR_ZEBRA_INTERFACE_DISABLE_RADV

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:22 +09:00
IWASE Yusuke
6b48da6729 packet/zebra: Support VRF related messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_VRF_ADD
 - FRR_ZEBRA_VRF_DELETE
 - FRR_ZEBRA_INTERFACE_VRF_UPDATE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:16 +09:00
IWASE Yusuke
7baed0a100 packet/zebra: Support BFD Destination messages
This patch implements the following messages on FRRouting:
 - ZEBRA_INTERFACE_BFD_DEST_UPDATE
 - ZEBRA_BFD_DEST_REGISTER
 - ZEBRA_BFD_DEST_DEREGISTER
 - ZEBRA_BFD_DEST_UPDATE
 - ZEBRA_BFD_DEST_REPLAY

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:13 +09:00
IWASE Yusuke
7804cbb6f4 packet/zebra: Support Neighbor Connected Address messages
This patch implements the following messages on FRRouting:
 - ZEBRA_INTERFACE_NBR_ADDRESS_ADD
 - ZEBRA_INTERFACE_NBR_ADDRESS_DELETE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:07 +09:00
IWASE Yusuke
7091523f8f test_zebra: Add pcap for API version 4 on FRR v2.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:00 +09:00
IWASE Yusuke
90f0434c18 packet/zebra: Support some FRRouting messages format
Note: This patch does not support all messages defined in FRRouting,
and some of message are left on TODO.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:53 +09:00
IWASE Yusuke
0716d2cba1 packet/zebra: Constants for supporting FRRouting format
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:45 +09:00
IWASE Yusuke
a5f24fe3e3 packet/zebra: Support asymmetric structure of ZEBRA_*_IMPORT_LOOKUP
The ZEBRA_IPV4_IMPORT_LOOKUP/ZEBRA_IPV6_IMPORT_LOOKUP has asymmetric
structures at when sent to Zebra daemon and when sent from Zebra daemon.
Especially, "prefix_len" field is inserted before "prefix" filed when
sent to Zebra daemon.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:40 +09:00
IWASE Yusuke
b66c597fb6 packet/zebra: Parse messages based on Zebra API version
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:32 +09:00
IWASE Yusuke
c860675a5f packet/zebra: Missing bw_cls_num in InterfaceLinkParams
This patch fixes to parse the missing field of the number of unreserved
bandwidth classes in Interface Link Parameters structure.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:26 +09:00
IWASE Yusuke
8e851711a7 packet/zebra: Constants for Link Parameters Status
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:14 +09:00
IWASE Yusuke
18fa853352 packet/zebra: Constants for Interface Address Flags
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:12 +09:00
IWASE Yusuke
a104e11c0d packet/zebra: Return "ZebraMessage" for message from Zebra
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:10 +09:00
IWASE Yusuke
96891addf5 packet/zebra: Fix unresolved reference for _serialize_nexthops
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:02 +09:00
Thomas Bechtold
0673a8868e Only import pip if needed
In some systems pip is not installed and the parse_requirements() function
is not needed. So only import pip if needed. Otherwise this fails with:

  from ryu.base import app_manager
  File "/usr/lib/python2.7/site-packages/ryu/base/app_manager.py", line 34, in <module>
  from ryu import utils
  File "/usr/lib/python2.7/site-packages/ryu/utils.py", line 23, in <module>
  from pip import req as pip_req
  ImportError: No module named pip

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-05 15:54:07 +09:00
FUJITA Tomonori
1782f54f3c Ryu 4.17
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-04 21:52:10 +09:00
mgrex97
0c0656f95a topology/switches: Fix delete port can't immediately remove link.
If remove port data from self.port_state first,
self.get_port method can't get the port data,
this problem will cause link can't immediately be removed.
This patch remove port data after get_port and link delete.

Signed-off-by: Yu Ren <j6y4u4xup6@gmail.com>
Signed-off-by: mgrex97 <j6y4u4xup6@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:51:15 +09:00
IWASE Yusuke
80fedbfeaf BGPSpeaker/net_ctrl: Close activity for each session
Currently, a thread for processing outgoing message will be remained in
"RpcSession" activity even if RPC session is closed by the remote peer,
and garbages on memory will grow.

This patch fixes to close "RpcSession" activity when RPC session
closing.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:50:36 +09:00
Satoshi Fujimoto
98a838e487 packet/bmp: Correctly parse peer address with IPv4
Currently, Ryu expects that the IPv4 peer address format is
"4 bytes with IPv4 address, followed by 12 bytes padding".
However RFC 7854 says the format is
"12 bytes padding, followed by 4 bytes with IPv4 address".

This patch fixes it to correctly parse/serialize peer address.

Reported-by: Henk Smit <hhwsmit@xs4all.nl>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:53 +09:00
IWASE Yusuke
f85ae78465 rest_qos: Avoid discarding Queues info for each request
Currently, rest_qos discards the Queues info stored on its dictionary
for each "Set queue" request.
So rest_qos always reply only last Queue setting.

This patch fixes to avoid discarding the Queues info and enable to reply
all configured Queues settings.

Note: In order to store all Queues settings, "port name" field for each
Queue will be inserted on the reply of "Get queue configuration" API.
 - Before:
    [
      {
        "command_result": {
          "result": "success",
          "details": {
            "0": {
              "config": {
                "max-rate": "500000"
              }
            },
            "1": {
              "config": {
                "min-rate": "800000"
              }
            }
          }
        },
        "switch_id": "0000000000000001"
      }
    ]
 - After:
    [
      {
        "command_result": {
          "result": "success",
          "details": {
            "s1-eth1": {    # <-- Inserted
              "0": {
                "config": {
                  "max-rate": "500000"
                }
              },
              "1": {
                "config": {
                  "min-rate": "800000"
                }
              }
            }
          }
        },
        "switch_id": "0000000000000001"
      }
    ]

Reported-by: Fahmy Sherif Alaa Salaheldin <sherif.fahmy@epfl.ch>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:36 +09:00
Dingyuan Hu
bc7451dc7c services/ovsdb: Listen on IPv6 Address
This patch enables Ryu to listen ovsdb connections on IPv6 Address.
Note that you need to make a config file like belows:
    [ovsdb]
    address=::

Signed-off-by: Dingyuan Hu <hdyvip@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:12 +09:00
Satoshi Fujimoto
7f537c4185 packet/icmpv6: Assert length in options are valid
About the 'length' field in ICMPv6 options,
RFC4861 says that "The value 0 is invalid".
This patch adds assertions to raise a exception
for such invalid ICMPv6 packets.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Reported-by: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-04 21:11:49 +09:00
Satoshi Fujimoto
ee9a197dd6 packet/icmpv6: Fix parsing undefined nd_option fails
The length of nd_option is units of 8 octets.
Currently, for nd_options which is undefined in the ICMPv6 packet library,
the parser assumes that the length is [8 * length - 2].
It causes fails while parsing these options.

This patch fixes it to parse such options correctly.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Reported-by: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-04 21:11:09 +09:00
IWASE Yusuke
44cd14ac81 ofp_event: Timestamp when OpenFlow event was generated
This patch introduces "timestamp" attribute for OpenFlow event classes
which shows when that event was generated by Datapath instance and nearly
equivalent to when Ryu finished receiving the message contained in that
event instance.

Suggested-by: Matthew Hayes <matthew_john_hayes@hotmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-04 21:07:28 +09:00
FUJITA Tomonori
6d950481f6 Ryu 4.16
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-02 10:39:13 +09:00
IWASE Yusuke
800c136a9b doc: Fix unexpected indent in ryu/lib/packet/bgp.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-30 22:07:08 +09:00
IWASE Yusuke
cb40f779d1 doc: Deprecated option html_use_smartypants
"html_use_smartypants" in conf.py is deprecated in Sphinx 1.6.
This patch fixes to use "smart_quotes" in docutils.conf instead.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-30 22:07:06 +09:00
IWAMOTO Toshihiro
ec04ff9f46 ofproto: Avoid emitting illegal instruction sets
The OpenFlow spec forbids multiple occurences of a same instruction
type within a mod_flow message, so make sure
ofp_instruction_from_jsondict doesn't emit such an instruction set.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-21 21:54:25 +09:00
Travis Gockel
5e176f9e7c doc: Minor grammar changes in ryu_app_api 2017-07-21 21:47:47 +09:00
IWASE Yusuke
214cd8c305 unit/ofproto: Adopt to rename of OFPErrorExperimenterMsg
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-21 21:38:42 +09:00
IWASE Yusuke
5099034d0c ofproto: Handle OFPErrorExperimenterMsg
Currently, OFPErrorExperimenterMsg is not registered into OpenFlow
message events dict as "EventOFPErrorExperimenterMsg", and could not be
converted to events by ofp_event module.

This patch obsolete OFPErrorExperimenterMsg class and fixes to use
EventOFPErrorMsg to handle the experimenter error messages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-21 21:38:42 +09:00
IWASE Yusuke
b964275b53 bgp_sample_conf: absolute_import to suppress warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-21 21:38:42 +09:00
Satoshi Fujimoto
60651d8a1c service/ovsdb: get socket from RemoteOvsdb
This patch adds "socket" field to RemoteOvsdb
to get sockets which connects to switches.

e.g.)
    @set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
    def handle_new_ovsdb_connection(self, ev):
        print(ev.client.socket.getsockname()[0])

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-02 20:21:14 +09:00
FUJITA Tomonori
cd67c52471 Ryu 4.15
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-02 20:08:32 +09:00
FUJITA Tomonori
a991fed7e4 Revert "tests: Separate test files from Ryu module"
This reverts commit a67ed2858417b9d795460f05126c01fb0cd344f9.

The commit breaks OpenStack neutron dynamic routing.
2017-06-30 14:23:03 +09:00
IWASE Yusuke
a67ed28584 tests: Separate test files from Ryu module
To prevent redundant files (e.g., pcap files, json files for tests,
packet data generator) to be installed, this patch separates test
directory from Ryu module.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-26 15:17:44 +09:00
Satoshi Fujimoto
d8ae9491da service/ovsdb: Use dict.items() instead of six.iteritems()
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 12:08:18 +09:00
Satoshi Fujimoto
ea23ebdadf doc/ovsdb_manager: Update Sample Code
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 12:08:18 +09:00
Satoshi Fujimoto
10b9273928 service/ovsdb: Use Python 2/3 compatible code
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 12:08:18 +09:00
Satoshi Fujimoto
27b8d44bb1 service/ovsdb: Avoid to use dict as default argument
Using mutable values as default arguments will cause unexpected behavior.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 12:08:18 +09:00
Satoshi Fujimoto
cf667e4097 service/ovsdb: Add properties to EventNewOVSDBConnection
Currently, EventNewOVSDBConnection only has system_id.
This patch let the class has RemoteOvsdb to get more
informations through it.

e.g.)
    @set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
    def handle_new_ovsdb_connection(self, ev):
        system_id = ev.system_id
        remote_addr = ev.client.address

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 12:08:18 +09:00
IWASE Yusuke
2edfb20884 test_vsctl: Strip unexpected double quote
This patch removes unexpected double quote around IP address in
OVSDB_SWITCH_ADDR.
e.g.)
 NG: tcp:"172.17.0.2":6640
 OK: tcp:172.17.0.2:6640

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-23 11:36:18 +09:00
IWASE Yusuke
d9d0588689 pip: OpenStack updated requirements of eventlet again
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:08:35 +09:00
IWASE Yusuke
388a97ef6d manager: Introduce user flags option
This patch introduces "--user-flags" option which enable to add user
original CLI or config file options for their own Ryu applications.

Usage Example)
  $ cat user_flags.py
  from ryu import cfg

  CONF = cfg.CONF
  CONF.register_cli_opts([
      cfg.StrOpt(
          'user-cli-opt', default=None,
          help='user original CLI option'),
  ])

  $ ryu-manager --user-flags user_flags.py user_app.py

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:08:33 +09:00
IWASE Yusuke
0f1430edfd CONTRIBUTING: Update info of Python ver/lib and links
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:07:57 +09:00
IWASE Yusuke
b4786a3fe3 CONTRIBUTING: Update procedure for running tests
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:07:54 +09:00
IWASE Yusuke
ef212fe87e CONTRIBUTING: Update procedure for submitting patches
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:07:49 +09:00
IWASE Yusuke
cec1254a35 README: Dependencies for installing optional requirements
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-22 16:07:41 +09:00
IWASE Yusuke
03c67d368d service/ovsdb: Default of controller_info in set_controller
Currently, api.set_controller in OVSDB service raises AttributeError if
controller_info is None and controller is not found in current table.

This patch sets the empty dict as the default value and fixes this
problem.

Reported-by: 胡鼎原 <hdyvip@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-04 13:56:28 +09:00
FUJITA Tomonori
574e417d9d Ryu 4.14
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-02 13:58:40 +09:00
胡鼎原
8fa14c87ec doc: fix error in ovsdb_manager.rst code
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 22:11:02 +09:00
胡鼎原
51a86c4d56 fix dhcp6.py bug using python3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 22:10:46 +09:00
IWASE Yusuke
bfcd65744c pip: OpenStack avoids newer eventlet
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 17:00:45 +09:00
IWAMOTO Toshihiro
430bc97638 ofctl: Add some tests for ofp_instruction_from_str
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 16:13:19 +09:00
IWAMOTO Toshihiro
a52c62a120 ofctl: Add ovs-ofctl style action string parser
This commit adds a new method called ofp_instruction_from_str,
which takes an ovs-ofctl style action string and returns a list of
JSON dictionaries. Currently only a few action strings are understood.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 16:13:18 +09:00
IWAMOTO Toshihiro
a5dca1a1e3 nicira_ext: Define some CT constants
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-30 16:13:17 +09:00
Satoshi Fujimoto
7794ff714c BGPSpeaker/SSH: Support to show L2VPN Flow Spec routes
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:48:19 +09:00
Satoshi Fujimoto
0168c28935 BGPSpeaker: Support IPv6 Flow Spec update messages
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:48:14 +09:00
Satoshi Fujimoto
0b9bc03e6c BGPSpeaker/info_base: Add tables for L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:48:09 +09:00
Satoshi Fujimoto
12b809f5f7 utils/test_bgp: Add unit tests for L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:48:05 +09:00
Satoshi Fujimoto
e82d26b1b5 test_table_manager: Add unit tests for L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:48:01 +09:00
Satoshi Fujimoto
2bcb040dcb test_bgpspeaker: Add unit tests for L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:57 +09:00
Satoshi Fujimoto
d37a311829 packet/bgp: Support L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:52 +09:00
Satoshi Fujimoto
b327981534 packet/bgp: Properly calculate length for FlowSpec
RFC 5575 says the 'len' field in numeric or bitmask operators
represents that the length of the value field is [1 << 'len'].
But, in serializing FlowSpec messages, the packet library uses
the `len` field as the length of the value field itself.
This patch fixes it to serialize FlowSpec messages properly.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:48 +09:00
Satoshi Fujimoto
9a4e8968ed test_bgp: Add test cases for L2VPN Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:42 +09:00
Satoshi Fujimoto
434b2adacd BGPSpeaker/SSH: Support to show IPv6 Flow Spec routes
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:36 +09:00
Satoshi Fujimoto
7e6c648ba1 BGPSpeaker: Support IPv6 Flow Spec update messages
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:47:07 +09:00
Satoshi Fujimoto
4d9d444df1 BGPSpeaker/info_base: Add tables for IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:59 +09:00
Satoshi Fujimoto
8597ef851b utils/test_bgp: Add unit tests for IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:54 +09:00
Satoshi Fujimoto
f8654b67c7 test_table_manager: Add unit tests for IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:48 +09:00
Satoshi Fujimoto
c53605385e test_bgpspeaker: Add unit tests for IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:42 +09:00
Satoshi Fujimoto
bb38fb2f30 packet/bgp: Support IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:37 +09:00
Satoshi Fujimoto
64b9dfcdd6 test_bgp: Add test cases for IPv6 Flow Spec
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-12 09:46:31 +09:00
IWAMOTO Toshihiro
607f4d8276 ofproto: Allow CIDR notation for ipv[46]_{src, dst}
This hack allows CIDR notations for OFPMatch. For example:
    ofpp.OFPMatch(ipv4_src="198.51.100.0/24")

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-11 12:32:18 +09:00
Brad Cowie
a197d87375 utils.import_module: Prefer filepath than Python module
Currently, ryu.utils.import_module() prefers the Python module path
than the user specified file path, and if the user app name is the
same with the Python module, this function returns the Python module
instead of the user app.

This patch fixes to try to load "file" before finding the loaded
Python module, and fixes this problem.

Note: With this patch, import_module() will reload (override) a module
if the specified module file name is the same.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Brad Cowie <brad@gizmoguy.net.nz>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:48:18 +09:00
Shinpei Muraoka
077eef801e library_packet_ref: Separate ref into each protocol
To keep readablity if include all class into library reference, this
patch separates library_packet_ref.rst into each protocol.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
Shinpei Muraoka
99e7cc4074 lib/packet: Use literal block for diagram in pydoc
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
5969a89ee4 packet/bgp: Omit description of default value
Omit description of default value The default value is described in the
aut generated API doc of class.
So the default value should not be hardcoded in pydoc.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
c6d9bfc384 packet/lldp: Add description for each class
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
4c7d523e22 packet/arp: Update description for arguments
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
Shinpei Muraoka
352c007535 BGPSpeaker/info_base/base: Unify documentation format
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
Shinpei Muraoka
74c6f5b21c BGPSpeaker: Unify documentation format
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
3c0dd6ee7a BGPSpeaker: Improve EVPN Redundancy Mode validation
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
Satoshi Fujimoto
09fa78182f bgp: Enable to configure default local preference
This patch enables to configure the default local preference.
If not specified, the value will be 100 as a default.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
2354bd7df3 packet/zebra: Support IP_ROUTE message from Zebra
Zebra IPv4/IPv6 route message have asymmetric structure, in other words,
the message structure from Zebra to the protocol daemons and that from
the protocol daemons to Zebra have the different structures.

This patch introduces _ZebraMessageFromZebra in order to distinguish
which daemon sent the message and fixes _ZebraIPRoute to decode IPv4/IPv6
route message from Zebra.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:20:16 +09:00
IWASE Yusuke
6d35bb8d01 lib/hub: Workaround for issue of eventlet
This patch adopts the workaround which is discussing on the eventlet
team at the following:
 https://github.com/eventlet/eventlet/issues/401
This workaround is suggested by Raymond Burkholder.

Suggested-by: Raymond Burkholder <ray@oneunified.net>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-05-09 10:17:08 +09:00
FUJITA Tomonori
5a1da545bf Ryu 4.13
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-04-04 18:01:09 +09:00
surlyjake
468f471f87 nicira_ext: Constants for IP fragment matching
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 13:03:02 +09:00
Satoshi Fujimoto
e1741b7d77 bgp/info_base: Refactor has_nexthop() method
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 11:01:12 +09:00
Satoshi Fujimoto
399a03feb1 bgp/peer: Fix invalid NEXT_HOP in UPDATE message
Currently, when BGPSpeaker advertises IPv4/6 unicast routes
via an iBGP connection, if the Nexthop in the route is omitted,
BGP Speaker advertises the Nexthop with the unspecified address.
This route can be evaluated as invalid by the receiving router.
This patch fixes it by making BGPSpeaker to advertising
the Nexthop with the host's own ip address if the local route
in the RIB has the Nexthop with the unspecified address.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 11:01:11 +09:00
Satoshi Fujimoto
b7dcd40837 ofctl_v1_5: Fix lack of arguments for modify role API
ofctl_v1_5 can't send role request messages,
because of lack of arguments.
This patch fixes it by adding the argument for short_id.
ofctl_v1_5 sets None to short_id.
It means ofctl_v1_5 uses the default value of short_id.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 11:00:44 +09:00
Satoshi Fujimoto
6dfda4a227 ofctl_rest: Add get role API
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 11:00:43 +09:00
Satoshi Fujimoto
d0f25d639b ofctl: Fix type of fields of DescStat
With Python3 and OpenFlow v1.0/v1.2/v1.3, Ryu can't dump
the description statistics reply message into JSON,
because the message has byte type values.
This patch fixes it by using to_jsondict().

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 11:00:17 +09:00
Shinpei Muraoka
ab902d2b5e utils/test_bgp: Add unit tests for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:55 +09:00
Shinpei Muraoka
9fa4e6b42d core_managers/test_table_manager: Add unit tests for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:45 +09:00
Shinpei Muraoka
4230897783 test_bgpspeaker: Add unit tests for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:37 +09:00
Shinpei Muraoka
06a61123be library_packet_ref: Add description of action for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:28 +09:00
Shinpei Muraoka
b3a83ef185 BGPSpeaker: Support Flow Specification update messages
This patch enables BGPSpeaker to store FlowSpec routes into
the global table and VRF tables and to provide the API
for advertising routes.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:21 +09:00
Shinpei Muraoka
a486539400 BGPSpeaker/SSH: Supports display of Flow Specification RIB
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:16 +09:00
Shinpei Muraoka
880bd4ab85 BGPSpeaker/info_base: Add tables for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:10 +09:00
Shinpei Muraoka
765a723fe6 packet/bgp: Implement the utility of Flow Specification for BGPSpeaker
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 10:00:03 +09:00
Shinpei Muraoka
f12485e6de packet/bgp: Fix subtype for Traffic Filtering Actions of Flow Specification
This patch sets the constant value
so that you can omit argument "subtype" for
Traffic Filtering Action of Flow Specification.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:58 +09:00
Shinpei Muraoka
fd16c43a31 packet/bgp: Unify variable names for Flow Specification
Currently, FLOW_SPEC and FLOWSPEC constants are mixed,
so this patch will unify to FLOWSPEC.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:57 +09:00
Shinpei Muraoka
271961ecb1 packet/bgp: Add the address converter for Flow Specification
Argument "addr" of "_FlowSpecPrefixBase" must be
specified in the network address.
If argument "addr" specified in the host address,
this patch converts the given address into the network address.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:52 +09:00
Shinpei Muraoka
66a5bddaf0 packet/bgp: Fix data structure for VPNv4 Flow Specification
The Route Distinguisher did not include in data structure
for VPNv4 Flow Specification.
This patch adds the Route Distinguisher to data structure
for VPNv4 Flow Specification.
For details, refer to Chapter 8 of RFC 5575.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:48 +09:00
Shinpei Muraoka
16c3640673 library_packet_ref:Add bgp reference for Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:42 +09:00
Shinpei Muraoka
4cbdbb767b test_bgp: Add test cases for user interface of Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:34 +09:00
Shinpei Muraoka
4838463ab3 packet/bgp: Implement user interface of Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-28 09:55:29 +09:00
FUJITA Tomonori
35e12d858c Ryu 4.12
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-02 15:38:47 +09:00
IWASE Yusuke
9420884db4 hub.StreamServer: Ommit validation for IPv4 address
To support the case that user specifies the host address like
'localhost', this patch removes the validation of the given address
as IPv4 address family and fixes to try listening as IPv4 by default.
Then, the validation will be handled in "eventlet.listen()".
This behavior is the same as that of before supporting the unix domain
socket.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-28 22:37:40 +09:00
IWASE Yusuke
a134362526 wsgi: Change default wsgi listen host to "0.0.0.0"
With netaddr.valid_ipv4/6, empty host is not allowed and will fail
to validate.
This patch changes to the default wsgi listen host to "0.0.0.0"
and enable to validate it by using netaddr.

Note: The default behavior is NOT changed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-24 22:20:54 +09:00
IWASE Yusuke
7baa456696 zebra: Add sample application for Zebra server service
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:23:33 +09:00
IWASE Yusuke
8914385148 zebra: Implement Server APIs for Zebra protocol service
This patch implements APIs for performing as Zebra daemon of Quagga
and enables to integrate with other Quagga daemons.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:23:24 +09:00
IWASE Yusuke
1b486a0634 zebra: Implement database for Zebra protocol service
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:23:19 +09:00
IWASE Yusuke
dc57ff5b47 tools/optional-requires: SQLAlchemy for Zebra service
This patch adds a new optional requirements, SQLAlchemy, for Zebra
protocol service database.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:51 +09:00
IWASE Yusuke
d90589c2cc lib/netdevice: Constants defined in netdevice(7)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:48 +09:00
IWASE Yusuke
793dc13e01 controller: Change default OPF listen host to "0.0.0.0"
With netaddr.valid_ipv4/6, empty host is not allowed and will fail
to validate.
This patch changes to the default openflow listen host to "0.0.0.0"
and enable to validate it by using netaddr.

Note: The default behavior is NOT changed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:46 +09:00
IWASE Yusuke
9efde1d2f5 hub: Enable StreamServer to listen Unix domain socket
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:38 +09:00
IWASE Yusuke
fd3bfb55de zebra: Add sample application for Zebra client service
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:30 +09:00
IWASE Yusuke
e5a0974508 Implement Zebra protocol client service
This patch implements APIs for performing as a protocol daemon of Quagga
such as "ripd", "ospfd", "bgpd", for example.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 12:22:29 +09:00
IWASE Yusuke
c1f810b9b1 bgp/utils/bgp: Use lib/ip for Python 3 compatibility
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 11:38:01 +09:00
IWASE Yusuke
fd96d24314 BGPSpeaker: Use isinstance(*, bool) for boolean check
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 11:37:57 +09:00
IWASE Yusuke
ef3eefb2ad BGPSpeaker: Support Route Reflector features [RFC4456]
This patch implements the features for acting as a Route Reflector
which defined in RFC4456.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-22 11:37:52 +09:00
IWASE Yusuke
e06ec47232 packet/zebra: Enable to specify "prefix" arg in str
Currently, "prefix" argument should be an instance of IPv4Prefix or
IPv6Prefix in some Zebra message body classes.
But for the convenience, this patch enables to specify "prefix" in
the str type representation.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-17 20:14:02 +09:00
IWASE Yusuke
88aaba68bb lib/ip: Add wrapper for netaddr.valid_ipv4/6
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-17 20:14:00 +09:00
Albert Siersema
15a12a7a6a allow_local_as_in_count : allow local ASN in AS patch, e.g. "rd auto/route-target both auto"
Cisco/Juniper/Cumulus and undoubtedly more vendors offer a
simplification of the EVPN configuration by not having to
specify individual RD/RT's, e.g. in Cisco NX-OS syntax:

evpn
    vni 10311 l2
      rd auto
      route-target import auto
      route-target export auto

This simplifies/unifies the configuration.
All leaf switches/ryu instances share the same ASN (e.g. 65511).
Spine switches in the same layer can share an ASN as well (e.g. 65510).

To facilitate the above, the local ASN has to be accepted in the AS path.
To this end, Cisco includes an 'allowas-in' configuration statement.
See:
http://www.cisco.com/c/en/us/products/collateral/switches/nexus-9000-series-switches/guide-c07-734107.html
search for "MP-eBGP Design with VTEP Leaf Nodes in the Same BGP
Autonomous System"

This patch offers the possibility to specify the number of accepted
occurrences
of the local ASN in incoming AS paths. The default value is 0, which basically
is the same as the code before this patch: local ASN in the path
indicates a loop.
Non-zero values allow the local ASN to appear the specified number of times in
the AS path. A maximum value of 3 should satisfy most deployments.

Signed-off-by: Albert Siersema <albert@mediacaster.nl>
2017-02-11 14:59:51 +09:00
IWASE Yusuke
e13f46b256 BGPSpeaker: Advertise VNI on EVPN Multicast Ethernet-Tag
For the interoperability with other MP BGP EVPN VXLAN implementations
(e.g., Cisco NX-OS), this patch enables to advertise the VNI with the
PMSI Tunnel attribute on the Inclusive Multicast Ethernet Tag Route
messages.

Suggested-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:41:08 +09:00
IWASE Yusuke
6e78aa3b94 BGPSpeaker: Allow empty IP Address in EVPN advertisement
For the EVPN MAC/IP Advertisement Route, IP Address field might be
omitted in case of the L2VPN MAC advertisement (e.g., Cisco NX-OS).
This patch allows to specify the empty IP Address to advertise.

This patch is suggested by Albert Siersema for the interoperability
with other MP BGP EVPN VXLAN implementations.

Suggested-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:41:07 +09:00
IWASE Yusuke
b0c9da18a0 RyuBGPSpeaker: Enable to notify BGP events
This patch enables RyuBGPSpeaker, which is a base Ryu application for
creating user BGP applications, to notify the BGP events corresponding
to 'best_path_change_handler', 'peer_down_handler' and 'peer_up_handler'
of bgpspeaker.BGPSpeaker.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
IWASE Yusuke
d2a97b16aa ofctl_v1_*: Use utility functions of ofctl_utils
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
IWASE Yusuke
dffb3d3cf6 ofctl_v1_*: Use str_to_int instead of builtin int
This patch fixes lib/ofctl_v1_* to use the utility function str_to_int()
instead of the builtin function int().
With this change, lib/ofctl_v1_* can convert the user input values into
integer even if non-decimal string values (e.g. hexadecimal "0x80").

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
Shinpei Muraoka
83bf7fae1d test_bgp: Add test cases for Flow Specification
This patch adds the test cases for
Flow Specification NLRI in MP_REAACH NLRI and
Traffic Filtering Actions in EXTENDED_COMMUNITIES.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
Shinpei Muraoka
79741fdc88 packet/bgp: Support Flow Specification
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
Shinpei Muraoka
838708a32a pakcket/bgp: pylint
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
IWASE Yusuke
c4218ccde3 BGPSpeaker: Support to advertise Type 1, 2 Route Target
Currently, BGPSpeaker supports only type 0 (Two-Octet AS-Specific) Route
Target (or Route Distinguisher).
This patch enables to advertise Type 1 (IPv4-Address-Specific) and Type
2 (Four-Octet AS-Specific) Route Targets.

Reported-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-11 14:21:04 +09:00
FUJITA Tomonori
6c92a75aa8 Ryu 4.11
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-02-04 15:00:43 +09:00
IWASE Yusuke
37391bb5bd utils: Re-implement parse_requirements
This patch re-implements utils.parse_requirements() without retrieving
code from OpenStack.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 22:26:29 +09:00
fumihiko kakuma
e9099345d2 docker_base.py: fix an ip option of "docker network connect"
ip address with subnet is ignored in ip option of "docker network connect"
This patch specifies a correct ip format for option.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 22:24:15 +09:00
IWASE Yusuke
17e2e51924 library_packet_ref: Add doc for Zebra packet library
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 22:23:24 +09:00
IWASE Yusuke
8ed4e24fb1 test_zebra: Unit tests for Zebra packet library
The pcap files for Zebra protocol were generated by:
  v2: Quagga 0.99.24.1 (Ubuntu 14.04 LST packaged version)
  v3: Quagga 1.1.0 (from Git source)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 22:23:23 +09:00
IWASE Yusuke
0662e9024d packet/zebra: Add Zebra protocol parser
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 22:23:22 +09:00
IWASE Yusuke
1513ac9f95 bgp_scenario_test: Clean previous builds before installing
On Python3 Docker image, "python setup.py install" might fail in case
that the current directory contains the symlink to Docker host file
system and the link target is not visible from container.
e.g.)
  .tox/py34/include/python3.4m -> /usr/include/python3.4m

This patch fixes to remove .tox directory on Docker container and also
clean the previous builds before installing.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-23 21:59:31 +09:00
Yury Kulazhenkov
9ccec7bb5a sync ryu.services.protocols.ovsdb.client.Idl code with ovs lib
The ovs library has changed its implementation of the idl.Idl class. The
CTOR in ryu.services.protocols.ovsdb.client.Idl updated to be compatible
with the current version.

Patch fix the problem:
    if table.cond_changed:
AttributeError: 'TableSchema' object has no attribute 'cond_changed'

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-16 16:28:22 +09:00
Olivier DESNOE
6d4b094dc3 packet lib: adding DHCPv6 support
Signed-off-by: Olivier DESNOE <olivier.desnoe@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-14 22:48:23 +09:00
Shinpei Muraoka
2197fd55d1 doc: library_packet_ref: Add reference of openflow
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-14 22:11:10 +09:00
Shinpei Muraoka
ca1a2a2781 test_openflow: Add unit tests for OpenFlow packet library
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-14 22:11:09 +09:00
Shinpei Muraoka
82b113afb6 packet lib: Add packet library of OpenFlow
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-14 22:11:06 +09:00
FUJITA Tomonori
ca5afabce9 Ryu 4.10
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-06 05:52:53 +09:00
Shinpei Muraoka
25a15406f6 library_packet_ref: Update dhcp reference method
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-06 05:27:09 +09:00
Shinpei Muraoka
c893ba04f7 test_dhcp: Extend unit test for fragmented options
Also, this patch removes the test case for __init__()
with "hlen" is zero,
because "hlen" should be recalculated at serialization.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-06 05:27:08 +09:00
Shinpei Muraoka
d908aff00c packet/dhcp: Revert b'str' conversion
This patch partially reverts 75e8c58916524243e6796e73c371981e14fff6ee
and 536a42d8c1c0be48e78d5f29b6fd55a38012d953.  dhcp.boot_file is ascii.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-06 05:27:07 +09:00
Shinpei Muraoka
a4d4291d10 packet/dhcp: Support fragmented options
Currently, if you set fragmented option data
for the packet library of dhcp, Traceback occurs.
This patch fixes to analyze up to options not corrupting data.
The remaining corrupting data will be appended
at the end of option list.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-01-06 05:26:59 +09:00
IWASE Yusuke
42c71ad0e6 BGPSpeaker/net_ctrl: Support multiple RPC sessions
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:50 +09:00
IWASE Yusuke
8555dda0f2 BGPSpeaker/base: Stop child activity by name
This patch enables Activity base to stop the child activity by name.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:49 +09:00
IWASE Yusuke
27b253d06e BGPSpeaker/net_ctrl: Move _send_*_response() function
This patch moves _send_*_response() function into RpcSession class
to use socket wrapper methods for maintaining the connection state
safely.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:43 +09:00
IWASE Yusuke
f1edc9fbd0 BGPSpeaker/net_ctrl: Close RPC session when disconnected
This patch fixes net_ctrl to check whether socket is connected and
to close RPC session when disconnected by RPC peer.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:38 +09:00
IWASE Yusuke
fcea0dc2af BGPSpeaker/net_ctrl: Pylint and fixes of typos
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:34 +09:00
IWASE Yusuke
7e30cf6b01 rpc_cli: Avoid to use eval()
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:23 +09:00
IWASE Yusuke
98a3b03792 rpc_cli: Close peer connections when exiting prompt
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:22 +09:00
IWASE Yusuke
daea96645a rpc_cli: Enable to execute a single command
This patch enables 'ryu rpc-cli' command to execute a single command
not interactively.

e.g.)
$ ryu rpc-cli --peers=bgp=localhost:50002 \
  --command='request bgp operator.show [{"params": ["rib", "ipv4"]}]'

This feature is convenient to controle BGPSpeaker states via shell
commands, for example.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:58:19 +09:00
IWASE Yusuke
49461e84ec ryu/app: Use Request/Response wrappers in REST Apps
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:14:01 +09:00
IWASE Yusuke
40178c92b2 wsgi: Wrapper classes of Request/Response in WebOb
With WebOB 1.7.0+, "charset" can not be omitted when constructing
Request/Response instance and exception will occur if omitted.
This patch adds wrapper classes of Request/Response for setting
charset="UTF-8" by default.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:13:56 +09:00
Shinpei Muraoka
95702135d4 library_bgp_speaker_ref: Fix unexpected unindent
This patch fixes unexpected unindent that occur when building.
Also, add ESI type to be specified for argument
esi of evpn_prefix_add and evpn_prefix_del.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:06:52 +09:00
IWASE Yusuke
6ebf0f7e4a optional-requires: Specify lxml version for OpenStack
OpenStack added "lxml!=3.7.0" into its requirements file, and this
patch adds the same specification for avoiding VersionConflict
error while installing.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:05:50 +09:00
IWASE Yusuke
73d331312e ryu-client: Remove client for OpenStack plugin/agent
This patch removes remaining of OpenStack Ryu plugin and agent.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:05:35 +09:00
IWASE Yusuke
cf1a2f37c8 doc: Deprecate OpenStack plugin ref
Because the Ryu plugin for OpenStack was deprecated and the description
in "using_with_openstack.rst" is obsoleted, this patch removes the link
to this page from the index and adds the cautions for it.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:05:27 +09:00
Shinpei Muraoka
eb646cee24 test_geneve: Add unit tests for Geneve
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:04:26 +09:00
Shinpei Muraoka
b6c1189cc9 packet lib: Add packet library of Geneve
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:04:20 +09:00
Shinpei Muraoka
6ea6e86e16 test_gre: Add unit tests for NVGRE
This patch adds test case of NVGRE.
Also, fixes unit tests for GRE to the method using packet capture.
For that reason, add packet capture files.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:04:15 +09:00
Shinpei Muraoka
19e415a19d packet/gre: Support NVGRE extension
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:04:13 +09:00
Shinpei Muraoka
d1c275ed6f doc: library_packet_ref: Update references
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:03:38 +09:00
IWASE Yusuke
9b2cb18729 rest_router: Fix ARP THA in reply message
Currently, rest_router sends ARP reply messages composing own MAC
address in Target MAC Address, and both Sender/Target MAC address
are MAC address of rest_router.
So, with this reply messages, Wireshark will report "Duplicate IP
address detected".
This patch fixes this problem.

This problem was reported by China Shenzhen TICOMM Information
Technology Co. Ltd.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-29 22:02:40 +09:00
IWASE Yusuke
cad9c8a940 install_docker_test_pkg: Remove unnecessary pip pacakges
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 13:23:33 +09:00
IWASE Yusuke
6da65f508e tox: Move dependencies installation to .travis.yml
This patch moves dependencies installation in tox.ini to .travis.yml
in order to avoid to install dependencies repeatedly when running
tox tests on locally.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 13:23:32 +09:00
IWASE Yusuke
f152c69ee0 bgp_scenario_test: Switch Python version
With Ubuntu base Docker image, Python 2.7 will always be used on
Scenario test containers if we just install "python-*".

This patch fixes to switch base Docker image and enables to use
the specific Python version.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 10:20:45 +09:00
IWASE Yusuke
c0e06c7ea7 test_requirements: Test cases for checking requirements
This patch adds the test cases for checking whether the requirements
of Ryu has no conflict with that of other projects (e.g., the global
requirements of OpenStack)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 10:04:55 +09:00
IWASE Yusuke
c810965826 tox: Test ryu-manager without additional requirements
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 10:04:49 +09:00
IWASE Yusuke
1453f0f9e2 pip: Add doc requirements for convenience
This patch adds the requirements file for building the Ryu documentation.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:01:34 +09:00
IWASE Yusuke
bc9796b097 library_bgp_speaker_ref: Fix unexpected indentation
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:01:21 +09:00
IWASE Yusuke
f8fa7b68db doc: Add MRT file library reference
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:00:49 +09:00
IWASE Yusuke
d993e430ef test_mrtlib: Add unit tests for MRT paser
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:00:41 +09:00
IWASE Yusuke
b3804a8727 mrtlib: Add parser for MRT format [RFC6396]
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:00:34 +09:00
IWASE Yusuke
a6dc0bc8a7 packet/ospf: Reduce Pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:00:29 +09:00
IWASE Yusuke
5e8b6c69f2 type_desc: Define TypeDisp class for re-usability
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 22:00:22 +09:00
IWASE Yusuke
4a8c7245fa bgp_scenario_test/bgp: Pylint
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 21:40:07 +09:00
IWASE Yusuke
ee6cee3753 bgp_scenario_test/common: Pylint
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 21:40:05 +09:00
fumihiko kakuma
742c2a5e20 Delete an unnecessary function
Currently a scenario test doesn't use stream option of exec_on_ctn and
this function requires extra module(docker-py).
This patch deletes the unnecessary function.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 21:31:42 +09:00
fumihiko kakuma
46409763d4 Get some debug information
Get log for command execution error and ryu bgp app.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 21:31:34 +09:00
Omer Anson
b5d232d560 Add DHCP options constants to DHCP lib
Add DHCP options constants to DHCP lib for the following options:
* Domain name option (15)
* Interface MTU (26)
* Classless route (121)

These constants are used in Dragonflow, which uses ryu's DHCP lib to
construct a DHCP responder.

Signed-Off-By: Omer Anson <oaanson@gmail.com>

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 17:54:05 +09:00
IWASE Yusuke
e0c446a6b4 lib/ofctl_v_*: Enable to filter flow stats by priority
OpenFlow Spec does not allow to filter flow entries by priority,
but when with a large amount of flow entries, filtering by priority
is convenient to get statistics efficiently.

This patch enables lib/ofctl_v_* modules to filter flow stats by
priority.

This patch is suggested by China Shenzhen TICOMM Information
Technology Co. Ltd.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 15:29:37 +09:00
IWASE Yusuke
002cbbe1ec packet/bgp: Fix default of esi for IP Prefix route
"esi" value should be an instance of EvpnEsi subclass and not int
type value, this patch fixes the default value to "None".

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:59:29 +09:00
IWASE Yusuke
88c5be07de BGPSpeaker: ESI to be optional arg in MAC/IP Adv route
The ESI field should not be a route key for BGP processing in EVPN
MAC/IP Advertisement route, this patch confirms "esi" is an optional
argument for this route.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:59:26 +09:00
IWASE Yusuke
9e5f9d9d37 packet/bgp: Support multiple next_hop in BGPPathAttributeMpReachNLRI
In case of the IPv6 address family in MP-BGP, NLRI might has multipule
next_hop addresses (e.g., one is global unicast address and the other
is link local unicast address).

This patch fixes to support multipule next_hop addresses in MP-BGP
NLRIs.
For the backward compatibility, this patch make it to stor the first
next_hop address as next_hop attribute and all next_hop addresses
as next_hop_list.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:57:49 +09:00
IWASE Yusuke
ad5ce12e70 packet/bgp: Unpack mpls_label in BGPPathAttributePmsiTunnel
The decoded mpls_labe should be return as a tuple of (mpls_labe,
is_bos).
This patch fixes to unpack the returned tuple.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:57:43 +09:00
IWASE Yusuke
430424aac0 stringify: Add optional attributes list to be displayed
Currently, propery type attributes are ignored in the str and json
representations.
If we want to include them, it is required to override to_jsondict()
and from_jsondict() methods.

This patch adds the optional attributes list to specify the addtional
attributes included in the str and json representations.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:57:37 +09:00
IWASE Yusuke
197a6c49a6 packet/bgp: Support multiple BGP messages in a packet
This patch fixes to BGPMessage.parser() to return the reference to
its own class and to support multiple BGP messages in a single packet.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:57:34 +09:00
Shinpei Muraoka
17acdbb610 BGPSpeaker: Support Ethernet A-D Route and Ethernet Segment Route
This patch supports Ethernet Auto-discovery Route and
Ethernet Segment Route in BGPSpeaker.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:57:01 +09:00
Shinpei Muraoka
c4a84cb246 packet/bgp: Fix the ESI Label Extended Community to use mpls_label
Currently, ESI Label in BGPEvpnEsiLabelExtendedCommunity
has 3 byte integer set.
This patch fixes to use the mpls_label for ESI Label
of BGPEvpnEsiLabelExtendedCommunity.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-10 14:56:59 +09:00
FUJITA Tomonori
a3c1a8e06b Ryu 4.9
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-05 16:37:18 +09:00
fumihiko kakuma
5c5345e78c scenario test: Fix the wrong retry check in command execution
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-24 15:14:35 +09:00
fumihiko kakuma
580f04d8a9 Enable to run a scenario test with a specific python version
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-24 15:14:34 +09:00
IWASE Yusuke
d4d02dd0f6 rest_firewall: Compare reserved port in str representation
Along with the update of ofctl_rest, the output representation of
the port number in the OUTPUT action has been changed.
e.g.) In case of the OUTPUT action to the OFPP_NORMAL port
  OLD:
    'OUTPUT:4294967290'  # OFPP_NORMAL = 0xfffffffa
  NOW:
    'OUTPUT:NORMAL'

Currently, rest_firewall suposes the OLD format, and it will fail
to compare the port number, then all firewall rules will be shown
with "actions": "DENY".
This patch fixes to compare the port number in the NEW format and
fixes this problem.

Reported-by: Hong Panha <c011361065@edu.teu.ac.jp>
Reported-by: Ruy Takata <ruy.takata@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-18 15:56:45 +09:00
IWASE Yusuke
156b3d2a6e test_vsctl: Use osrg/ryu-book image as Mininet container
This patch fixes test_vsctl.py to use osrg/ryu-book image as
Mininet container and shortens the testing hours.

Also, this patch removes the Dockerfile for building the Mininet
Docker image.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-18 15:56:33 +09:00
IWASE Yusuke
fbda130ebf test_vsctl: Wait for loading OVS kernel module
If the OVS kernel module is loaded at first time, it might take
a few seconds.
This patch add a sleep before sending OVSDB requests.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-18 15:55:01 +09:00
IWASE Yusuke
33ecea2dd6 integrated/bgp: Use Ubuntu:16.04 for base image
Using osrg/ryu Docker image for the base image make it easy to build
the image for the integrated tests, but the installed packages are
remained on the site-packages unless they are explicitly uninstalled.
This problem can cause the miss configured dependency when the
requirment files are updated, for example.

This patch fixes to use Ubuntu:16.04, which is the default for the
base image, and to build the test image on the clean environment.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-18 15:54:53 +09:00
IWASE Yusuke
5c7129563d docker_base: Update base image to Ubuntu:16.04
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-18 15:54:43 +09:00
IWASE Yusuke
8065784ab1 BGPSpeaker: Confirm SSH feature to be optional
paramiko, which python library is used in bgp.operator.ssh, is defined
as the optional requirements.
This patch avoid to import this library in BGPSpeaker by the default.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-15 20:58:18 +09:00
IWASE Yusuke
2b57fadd2c docker_base: Add missing requirements for test-requires
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-15 20:58:16 +09:00
IWASE Yusuke
77f15902c4 README: Use pip to resolve dependencies
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-15 20:58:12 +09:00
IWASE Yusuke
03f77e7279 pip: Separate test-requires
Currently, in addition to "requirements for tests", test-requires
includes "optional requirements".
This makes it unclear to identify which packages are surely required
to use optional features (e.g., OF-Config, NETCONF, BGP speaker) and
causes the redundant installation when building Docker images.

This patch separates test-requires into two files("test requirements"
and "optional requirements").

Also, this patch reverts the version fixation for some packages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-15 20:58:06 +09:00
IWASE Yusuke
1af384fa17 RPC: Specify encoding to msgpack.Packer/Unpacker
Currently, RPC requests using rpc_cli.py will crash on Python 3,
because the decoded string through msgpack-rpc is not str type
when the default encoding is not specified into msgpack.Unpacker.
On Python 2, bytes type is the same as str type, and this problem
does not occur.

The old spec of msgpack had no notation of the encoding, but now,
msgpack defines "UTF-8" as the default encoding and has the explicit
type definitions for String and Binary.
  https://github.com/msgpack/msgpack/blob/master/spec.md

This patch fixes to specify the encoding to msgpack.Packer/Unpacker
and enable to use Binary type when packing for the Python 3
compatibility.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:45 +09:00
IWASE Yusuke
a45c180447 test_rpc: Use numbers.Integral instead of long type
Currently, test_rpc.py uses long type for PyPy interpreter compatibility,
but log type is obsoleted in Python 3.
This patch fixes test_rpc.py to use numbers.Integral and makes its
implemetation more clean.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:39 +09:00
IWASE Yusuke
9f04612459 wsgi: Avoid using inspect.getargspec
Officially, "inspect.getargspec" is obsoleted in Python 3.0,
this patch fixes to avoid using this function.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:34 +09:00
IWASE Yusuke
99ebbcce0e wsgi: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:29 +09:00
IWASE Yusuke
ffa736a835 wsgi: Use six.text_type instead of unicode
This issue is suggested by Marcel Grossmann on GitHub PR #53.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:25 +09:00
IWASE Yusuke
63ce337e1d contrib: Revert module path to ryu.contrib
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:20 +09:00
IWASE Yusuke
2dc7d403bb protocols/bgp/base: Add missing __next__ method
This patch adds the missing __next__ method for Python 3 iterable.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 18:14:15 +09:00
Shinpei Muraoka
444c29fd73 BGPSpeaker: Support to advertise EVPN IP Prefix route
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 13:21:08 +09:00
Shinpei Muraoka
972c31f0e6 packet/bgp: Support for IP Prefix Route encoding
This patch supports on the basis of
the [draft-ietf-bess-evpn-prefix-advertisement-03]

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 13:21:04 +09:00
Shinpei Muraoka
264d32ea2d packet/bgp: Fix the EvpnNLRI to use the ryu.lib.packet.vxlan
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 13:20:59 +09:00
Shinpei Muraoka
e84b21b5ed packet/bgp: Fix the EvpnNLRI to use the ryu.lib.packet.mpls
Also, this patch changes name of is_stack to is_bos.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 13:20:54 +09:00
Shinpei Muraoka
a376adf6b6 packet/bgp: Fix the EvpnNLRI to use the ryu.lib.ip
Also, this patch changes size of ip_len from bit to byte.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:49:14 +09:00
IWASE Yusuke
e760300e93 BGPSpeaker: Enable to set capability for IPv6
This patch enables BGPSpeaker to set the capability for IPv6 unicast
address family.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:15:00 +09:00
IWASE Yusuke
4ed018df09 test_bgp: Add test cases for IPv6 and VPNv6 routes
This patch adds the test cases for IPv6 unicast and VPNv6 unicast
routes in BGP UPDATE messages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:14:53 +09:00
IWASE Yusuke
7e1f64865d test_bgp: Enable to check parsed BGP message
This patch fixes to check if the parsed protocols list contains
the BGP message as expected.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:14:38 +09:00
IWASE Yusuke
73f6105e88 packet/bgp: Refactor MP_REACH_NLRI and MP_UNREACH_NLRI
This patch refactors MP_REACH_NLRI and MP_UNREACH_NLRI path attribute
classes to support IPv6 unicast and Labeled VPNv6 unicast routes.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:14:33 +09:00
IWASE Yusuke
9e92d60427 lib/ip: Add method to convert IPv4/IPv6 to int
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:14:27 +09:00
IWASE Yusuke
48f577d1f8 test_bgp: Uncomment out test case for UPDATE
Now BGP packet library supports 32 bits AS number and Extended
Length flag in path attributes, this patch fixes to uncomment
out the test case for UPDATE message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14 12:14:19 +09:00
IWASE Yusuke
31364ba91d packet/bgp: Enable Extended Length flags if specified
Currently, the Extended Length flag in path attributes is evaluated
only when the length exceeds 1 byte (max 255) field.
This patch enables this flags if explicitly specified.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-11 15:27:52 +09:00
IWASE Yusuke
b9e4345d5d pip: Move tinyrpc to pip-requires
Because the embedded tinyrpc was removed, tinyrpc is required to
be install for running Ryu application.
This patch moves tinyrpc from test-requires to pip-requires.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-11 12:11:50 +09:00
FUJITA Tomonori
6e2fe4edc8 Ryu 4.8
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-07 10:07:47 +09:00
IWASE Yusuke
f0fb62cbf9 contrib/tinyrpc: Remove embedded tinyrpc, use upstream
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-04 09:51:36 +09:00
IWASE Yusuke
7e91a55a56 contrib/ncclient: Remove embedded ncclient, use upstream
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-04 09:51:27 +09:00
IWASE Yusuke
fba95e2afa ut/ovs: Add UT using Docker for ryu.lib.ovs
This patch adds UT cases using Docker for ryu.lib.ovs.
If Docker is not available, these tests will be skipped.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-04 09:32:10 +09:00
Shinpei Muraoka
8d9ce87653 BGPSpeaker: Support to advertise PMSI Tunnel Attribute
This patch adds support to advertise the BGP PMSI Tunnel Attribute
for the Path attributes.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:32:18 +09:00
Shinpei Muraoka
6e22fb4a05 packet/bgp: Add PMSI Tunnel Attribute
This patch adds the support for BGP PMSI Tunnel Attribute [RFC6514].

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:32:11 +09:00
Shinpei Muraoka
5360524b96 packet/vxlan: Add method to convert the format of vni
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:32:05 +09:00
Shinpei Muraoka
a582b0b0dc packet/mpls: Add method to convert the format of label
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:31:59 +09:00
Shinpei Muraoka
ec1749beca lib/ip: Add method to convert the format of Ipv4 or Ipv6
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:31:53 +09:00
fumihiko kakuma
df1434a9bb Enable to run a scnario test for ryu bgp on travis
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:56 +09:00
fumihiko kakuma
76061634a0 Add scripts which install a dependency package
These install packages depended on a scenario test tool.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:54 +09:00
fumihiko kakuma
cd068e53ea Add bgp scenario tests
This adds some scenario tests using a scenario test tool.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:49 +09:00
fumihiko kakuma
0a60252208 Add bgp scenario tests tool
This provides an environment which test a peer between ryu and quagga.
I also consider that these modules are used from openstack or other
projects. So there may be some functions that are not used by test
for ryu.
This has the following functions.

- build docker image and run ryu and quagga on that container.
- configure ryu and quagga.
- have some operations for ryu, quagga and docker.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:10 +09:00
IWASE Yusuke
649d31afbe bgp/application: Re-implement base BGP application
Currently, options for bgp/application.py is not passed to 'ryu-manager',
bgp/application.py does only start RPC server and can not start other
threads including BGP core and SSH server using bgp_sample_conf.py.

This patch enables bgp/application.py to start BGP threads using
the specified configuration file and reconstructs configuration file
format.

With this patch, BGPSpaker application can be started like:
$ ryu-manager --bgp-app-config-file ryu/services/protocols/bgp/bgp_sample_conf.py
              ryu/services/protocols/bgp/application.py

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:41:21 +09:00
IWASE Yusuke
1dfe90d17a flags: Add CLI options for BGP application
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:41:08 +09:00
IWASE Yusuke
bc7f43aba3 BGPSpeaker: Enable to specify settings for SSH CLI
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:41:01 +09:00
IWASE Yusuke
09e57c5993 bgp/operator/ssh: Enable to quit gracefully
Currently, socket.error will be raised when 'quit' command is typed.
This patch enables to quit SSH session without tracebacks.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:40:49 +09:00
IWASE Yusuke
252591aaae bgp/operator/ssh: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:40:43 +09:00
IWASE Yusuke
e635d68bfd BGPSpeaker: Use dictConfig in the standard library
logging.config.dictConfig has been added in Python 2.7, this patch
fixes to use dictConfig in the standard library and removes
bgp/utils/dictconfig.py.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:40:37 +09:00
IWASE Yusuke
a7721fcce4 utils: Backward compatibility for 'imp.load_source'
This patch adds a function for providing the backward compatibility
for 'imp.load_source' in Python 2 and fixes bgp/application.py to
use this wrapper.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:40:28 +09:00
IWAMOTO Toshihiro
6792d6df2a Log OFPErrorMsg.data as ascii when type is OFPET_HELLO_FAILED
OFPErrorMsg.data usually contains the offending OpenFlow message,
but is an ASCII text string if its type is OFPET_HELLO_FAILED.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:23:07 +09:00
IWASE Yusuke
df95d2c660 ovs/vsctl: Fix API for parsing column/key/value set
Currently, VSCtlContext.parse_column_key_value() method fails to
parse "<column>:<key>=<value>" formatted str, which indicates
a "map" type column.
So some implementation to set "map" type column have avoided this
bug with "<column>=<key>=<value>" formatted str (not ":").

This patch fixes this problem and enable to parse the correct format
value.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:53 +09:00
IWASE Yusuke
d7cfe6687b ovs/vsctl: Add missing Controller commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:51 +09:00
IWASE Yusuke
05b3738359 ovs/vsctl: Add missing Port commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:46 +09:00
IWASE Yusuke
2744d0a9e3 ovs/vsctl: Add missing Interface commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:41 +09:00
IWASE Yusuke
3e19c38e9e ovs/vsctl: Add missing Bridge commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:35 +09:00
IWASE Yusuke
934e8dcd1a ovs/vsctl: Sort out commands order
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:28 +09:00
IWASE Yusuke
3aa49895fa ovs/bridge: Add APIs for missing Database commands
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:22 +09:00
IWASE Yusuke
589823beb5 ovs: Add API corresponding to ovs-vsctl remove command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:20 +09:00
IWASE Yusuke
c21ad1237d ovs: Add API corresponding to ovs-vsctl add command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:19 +09:00
IWASE Yusuke
c09c4e87a0 ovs: Add API corresponding to ovs-vsctl list command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:13 +09:00
IWASE Yusuke
d19e7a3213 ovs: Add API corresponding to ovs-vsctl add-bond command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:07 +09:00
IWASE Yusuke
fe83cfd66d ovs/vsctl: Update command list with OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:06 +09:00
IWASE Yusuke
513bf4c48c ovs/vsctl: Avoid applying next() to non-iterator object
In Python 2, the builtin function next() can not be applied to
non-iterator object.
This patch fixes to use the list comprehensions and avoid applying
next() to a list type object.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:01 +09:00
IWASE Yusuke
895ddfca26 ovs/vsctl: Add missing required argument for find_vlan_bridge
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:54 +09:00
IWASE Yusuke
b9aab0af3f ovs: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:46 +09:00
IWASE Yusuke
5748031635 ovs: Revert ovs module path
Because contrib.ovs has been removed, we no longer need to update
the path for loading ovs module.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:38 +09:00
IWASE Yusuke
4d1bfc8585 ovs/vsctl: Fix VSCtlCommand to inherit StringifyMixin
For convenience when printing command results, this patch fixes
VSCtlCommand to inherit StringifyMixin.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:31 +09:00
IWASE Yusuke
a354b456ea ovs/vswitch_idl: Update OVSDB schema with v7.14.0
This patch regenerates OVSDB schema with vswitchd/vswitch.ovsschema
v7.14.0 included in OVS v2.6.0 release.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:09 +09:00
IWASE Yusuke
55dc1158b8 ovs/vsctl: Change log level of redundant messages
Currently, ovs.vsctl outputs the messages (e.g. just "unchanged" or
"success") in the "info" log level for each transaction, but these
messages are not meaningful for users.
This patch changes the log level of these messages to "debug".

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:02 +09:00
IWASE Yusuke
2ebb9218b2 rest_router: Fix conversion of Packet Library to dict
On Python3, rest_router fails to compare the type of protocols in
the Packet Library instances, because the non-parsed packet data
is not str type but bytes type.
This patch fixes to compare the protocols instance type with
packet_base.PacketBase and enable to convert the Packet Library
instances to dict.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:20:12 +09:00
IWASE Yusuke
e80a36317a dpset: Fix iteration error when disconnecting switches
When disconnecting switches, dpset will fail to unregister ports,
because size of values in the port state dictionary might be
changed when doing the iteration.
This patch fixes to copy the values list and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:20:11 +09:00
IWAMOTO Toshihiro
022406507a test_parser: Add an truncate packet test
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:57 +09:00
IWAMOTO Toshihiro
e8809649e6 test_parser: Enable tests for truncated packets
When there are files named "*.truncated%d" in the packet_data directories,
they are treated as special instructions; test method are generated
by truncating wire_msg from corresponding "*.packet" files.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:55 +09:00
IWAMOTO Toshihiro
6aa4adb070 ofproto_v1_3_parser: Raise OFPTruncatedMessage exception on truncated messages
OFPT_ERROR_MSG can return truncated messages.  Some users want to
see them in human-friendly format [1]. Catch exceptions caused
by such truncated messages and reraise as OFPTruncatedMessage
with incomplete ofpmsg in the exception class.

[1] https://bugs.launchpad.net/dragonflow/+bug/1624826

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:52 +09:00
Shinpei Muraoka
b9a9f81ff0 ofproto/nicira_ext: Add missing NXMs in OVS v2.6.0
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:36 +09:00
Michał Rzepka
8d93787a6c ryu/lib/ofctl_v1_3: port name decoding fix
The patch resolves issue experienced when decoding certain values of
name field in OFPMP_PORT_DESCRIPTION body. Non-decodable bytes are
replaced with utf-8 replacement character.

This issue was observed while retrieving OFPMP_PORT_DESC reply from
OpenFlow 1.3 compliant HP switch. One of ofp_struct structures
describing OFPP_LOCAL port has a name field with value 4f 46 50 50 5f 4c
4f 43 41 4c 00 81 ff ff ff ff that translates to OFPP_LOCAL.......
Attempt to decode the value, as in modified line, raises an exception
"UnicodeDecodeError: 'utf8' codec can't decode byte 0x81 in position 11:
invalid start byte". In the submitted patch, non-decodable characters
are replaced with utf-8 REPLACEMENT CHARACTER (U+FFFD), which is
sufficient for the get_port_desc method to work seamlessly. Similar
usages of str.decode method may be found in ofctl_v1_3, ofctl_v1_4,
ofctl_v1_5 and need to be fixed in the future.

Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-08 22:52:36 +09:00
IWASE Yusuke
6522ea1c83 BGPSpeaker: Enhance APIs for operator.show
This patch enhances the APIs of BGPSpeaker class which call
'operator.show' APIs.

Note: This patch renames the argument 'routetype' of neighbor_get()
into 'route_type' for the consistency of APIs.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-08 22:36:47 +09:00
FUJITA Tomonori
7201a6085d Ryu 4.7
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-04 07:56:38 +09:00
IWASE Yusuke
81d5d8f568 BGPSpeaker: Fix to enable to notify peer down
If BGPSpeaker.neighbor_del() is called, an event to notify peer down
via _notify_peer_down() method will be generated.
But when _notify_peer_down() method is called, peer.protocol is
already cleaned up with None, so _notify_peer_down() method will fail
to get the neighbor info (IP address, AS number).

This patch fixes to retrieve the neighbor info from the neighbor
configuration info of Peer class and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-04 07:45:53 +09:00
FUJITA Tomonori
a3ab6c8ab3 use old cryptography version
Looks like that the latest version (1.5.2) doesn't work:

https://s3.amazonaws.com/archive.travis-ci.org/jobs/164527154/log.txt

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-04 07:38:03 +09:00
IWASE Yusuke
35973fcc20 packet: Avoid parsing an empty buffer
For example, the packet library detects the TCP payload type by using
the TCP src/dst port, but in case of the BGP packet, the packet
library will try to parse a TCP ACK packet as a BGP packet, and will
fail to parse.

This patch enables to ignore an empty buffer and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:37:58 +09:00
IWASE Yusuke
51e0abd365 pip-requires: Add ovs>=2.6.0
Now OVS 2.6.0 has been released, which is including
Python 3 compatibility.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:28:52 +09:00
IWASE Yusuke
a443be9433 doc: Add API reference for REST EVPN switch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:28:52 +09:00
IWASE Yusuke
ab92cc8529 app: Add sample application for REST EVPN switch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:28:52 +09:00
Shinpei Muraoka
57056d1a0f app: Integrate aplication of Ryu-book
Henceforth, Ryu-Book includes the source files for application of Ryu.
This patch Integrates the source files for application of Ryu-Book.
Just for information, the source files for application of Ryu-Book
will Integrate as for OpenFlow1.3.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:22:00 +09:00
IWASE Yusuke
b302d725a0 ovs/bridge: Enable to request tunnel port number
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:13:27 +09:00
IWASE Yusuke
b77408d04c ovs/bridge: Add utility method to create VXLAN port
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:13:27 +09:00
IWASE Yusuke
8627c28070 ovs/bridge: Make local_ip to optional field for tunnel
To create GRE tunnel, the local_ip field is not mandatory field.
This patch makes the local_ip field to optional for the convenience.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:13:27 +09:00
IWASE Yusuke
3d815d3455 ovs/vsctl: Catch the default tag type in Port Table
According to ovs-vswitchd.conf.db(5), the tag column is an integer
in range 0 to 4095, but OVS may returns the empty list [] as the
default value.
OTOH, Ryu expects an integer type as the default and fails to get
the port information in the table.

This patch enables to catch the empty list as the default and
fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:13:27 +09:00
Shinpei Muraoka
25a7eb51fe stplib: Fix to store current OFPPort status
Currently, stplib compares the status of OFPPortStatus message with
that of Datapath instance, but this comparison returns always "equal",
so stplib fails to get the correct port status.

This patch fixes to store the current port status and to compare the
new status with the stored status.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 20:46:29 +09:00
Shinpei Muraoka
d23c07054e stplib: Fix to compare MAC address and Bridge ID
cmp() func was introduced for Python 3 compatibility before,
but this implementation is not enough, because a MAC address
can not be compared with a Bridge ID (integer value) by com() func.

This patch fixes to convert the MAC address into an integer value
before comparing with Bridge ID and fixes this problem.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 20:46:28 +09:00
IWASE Yusuke
29d1a97139 BGPSpeaker/api/operator: Simplify registration decorator
Currently, in Python3, api.operator call APIs, which are used by
BGPSpeaker.rib_get() for example, cannot be registered correctly.
So call('operator.show', **kwargs) fails to get the registered
method by the symbol 'operator.show'.

This patch simplifies the registration decorator for api.operator
call APIs and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 20:12:36 +09:00
IWASE Yusuke
4348ae6a1f BGPSpeaker: Fix typos
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 20:12:36 +09:00
Michał Rzepka
cb83c858cd ofproto/ofproto_v1_5_parser: OFPMultipartReply malformed message offset fix
Recently, I discovered major multipart message parser flaw. The issue
was observed while testing Aggregate Flow Statistics message in OpenFlow
1.5 and Open vSwitch. Similar (and potentially also vulnerable) code
snippets are also present in other message parsers (e.g. OFPHello). I'd
like to ask for opinions on proposed solution. If accepted, similar
patches should also be applied for other message parsers.

Brief description (steps to reproduce the issue):
1. REST API is called to retrieve aggregate flow stats:
	curl http://localhost:8080/stats/aggregateflow/8796750139643
2. Open vSwitch replies to Aggregate Stats Request with Aggregate Stats
Reply:
	message buffer: 0x06 0x13 0x00 0x28 0x53 0xfe 0xc4 0xaf 0x00 0x02 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00
	(note that due to incomplete OF 1.5 support in OvS, message is
malformed - ofp_stats struct filled with zeros)
3. Message is processed by Ryu parsers:
	ofproto_parser.msg -> ofproto_v1_5_parser.msg_parser ->
ofproto_v1_5_parser.OFPMultipartReply.parser
4. Here, message body contents are parsed
(ofproto_v1_5_parser.OFPMultipartReply.parser, lines 1858-1861):
     while offset < msg_len:
         b = stats_type_cls.cls_stats_body_cls.parser(msg.buf, offset)
         body.append(b)
         offset += b.length if hasattr(b, 'length') else b.len
5. Due to incorrect message format, zero-filled message part is parsed
as b=OFPAggregateStats(length=0,stats=OFPStats(oxs_fields={})),
resulting in constant offset value, as in each iteration offset += 0.
6. Parser remains trapped in a infinite loop with offset = 16, msg_len =
40. Ryu controller hangs completely.

OFPMultipartReply parser was observed to handle malformed messages
improperly. The patch introduces offset check to fix processing of
malformed messages in ofproto_v1_5_parser.OFPMultipartReply.parser.

Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-28 16:34:59 +09:00
Monthadar Al-Jaberi
513a9d93b2 tests/switch: fix bug in _diff_packets function
This fixes the problem of the payload being always shown when another field
differs between ingress and egress test.

Signed-off-by: Monthadar Al Jaberi <monthadar.al-jaberi@infinera.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-21 21:24:04 +09:00
IWAMOTO Toshihiro
827138298f Add Nicira extension vlan_tci field
This Nicira extension field is VLAN VID+CFI+PCP.
OXM_OF_VLAN_VID and OXM_OF_VLAN_PCP should work fine in theory, but
in OvS it seems vlan_tci must be used to access the CFI bit from
NX_LEARN actions.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-16 19:12:54 +09:00
IWASE Yusuke
e0e30d3d96 BGPSpeaker: Shutdown BGPSpeaker gracefully
Currently, when BGPSpeaker instance calls 'core.stop', CORE_MANAGER
fails to stop its own activities and outputs traceback, because the
dictionaries which maps name to instance are changed during iteration.
This patch makes a list copy of items() to avoid this problem and
enable to shutdown gracefully.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:25:12 +09:00
IWASE Yusuke
5d1d8648ab BGPSpeaker: Enable to get path from EventPrefix
To get more detail information about BGP route by using
best_path_change_handler, this patch adds path member into
EventPrefix and implements property to get existing attributes.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:02:15 +09:00
IWASE Yusuke
57aa646d61 BGPSpeaker/vrf: Handle non MPLS labled NLRI
Currently, VRF Table supposes the incoming NLRI has MPLS labels
field, but some EVPN NLRI don't have MPLS labels field, and
BGPSpeaker fails to import the incoming routes from the neighbours.

This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:02:10 +09:00
IWASE Yusuke
3f104981d2 BGPSpeaker: Add EVPN routes from Global to VRF Table
This patch adds the missing support for importing EVPN Table from
the Global Table to VRF Table when BGPSpeaker recieved a new EVPN
route.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:02:04 +09:00
IWASE Yusuke
7af944dc0e table_manager: Fix conversion of De Morgan's laws
This patch fixes incorrect conversion of De Morgan's laws.
  e.g.) not (A and B) == not A or not B

Original:
    if not (vpn_path.source is None
            and route_dist == vrf_table.vrf_conf.route_dist):

Incorrect:
    if (vpn_path.source is not None and  # !!! Should be "or"
            route_dist != vrf_table.vrf_conf.route_dist):

Correct:
    if (vpn_path.source is not None or
            route_dist != vrf_table.vrf_conf.route_dist):

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:01:36 +09:00
IWASE Yusuke
c09925e1f5 test_bgpspeaker: Add UT for advertising VNI for EVPN
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:01:28 +09:00
IWASE Yusuke
396473593e BGPSpeaker: Extend to advertise VNI for EVPN routes
This patch enables to advertise VNI as MPLS lables field in the
MAC/IP Advertisement Route of EVPN.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:01:20 +09:00
IWASE Yusuke
40fe7ffdc5 BGPSpeaker: Support to advertise Tunnel Encapsulation
This patch adds support to advertise the BGP Tunnel Encapsulation
Attribute for the Ethernet VPN Routes.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:01:08 +09:00
IWASE Yusuke
bd4e8a70b5 packet/bgp: Add BGP Encapsulation Extended Community
This patch adds the support for BGP Encapsulation Extended Community
[RFC5512].

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 10:00:56 +09:00
Monthadar Al-Jaberi
cc24a85aad doc: specify OFP v1.0 for sample application
This is a minimal change to keep the supplied sample code
working with latest software. The sample code is not compatible
with OFP v1.3+, and if there is no requirement on supported version
Ryu will probably accept latest supported OF switch.

Signed-off-by: Monthadar Al Jaberi <monthadar.al-jaberi@infinera.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 09:51:31 +09:00
tungyueh
1970e70a0d add modify role API in ofctl_rest
add description about role API

Signed-off-by: tungyueh <tylin.cs03g@nctu.edu.tw>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 09:37:46 +09:00
Michał Rzepka
03e8028ce6 lib/ofctl_v1_4: correct argument order for OFPFlowMod constructor
Invalid OFPFlowMod flag and importance values were observed when using
app/ofctl_rest. This patch restores the proper order of arguments passed
to OFPFlowMod constructor in mod_flow_entry (ofctl_v1_4.py).

Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-07 09:34:44 +09:00
FUJITA Tomonori
c09cd3dc68 Ryu 4.6
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-09-01 21:17:00 +09:00
Victor Orlikowski
09644f186c Validate OpenFlow message length in header, to prevent controller receive loop DoS
When the controller receive loop currently accepts an OpenFlow
message, it does not validate the message length.  As a result, a
malicious or malfunctioning switch could cause send a message that
would result in the receive loop making no forward progress.

This patch ensures that the message length passed in the OpenFlow
message is validated against the specified minimum, and forced to that
value if it is smaller.

Thanks to Samuel Jero (at Purdue's Dependable and Secure Distributed
Systems Lab) for discovering this issue.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 15:04:25 +09:00
Iwase Yusuke
ba1fb5cf06 PyInstaller: Enable to build stand-alone executables
Usage: After installing Ryu (on virtualenv is better), build a
ryu-manager executable as following:
   $ pip install PyInstaller==3.1.1
   $ cd tools/
   $ pyinstaller ryu-manager.spec
   $ ./dist/ryu-manager

Note: PyInstaller==3.2 may have a bug of str encoding, please use
Pyinstaller==3.1.1 instead.
   https://github.com/pyinstaller/pyinstaller/issues/1976

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 14:25:57 +09:00
Iwase Yusuke
db0f6c1165 handler: Fix for frozen builds
Navigates back the stack to locate the module instead of relying on
inspect to locate the module based on the file name.

This patch is suggested by papostolescu as Pull Request(*1)
on GitHub.
   (*1) https://github.com/osrg/ryu/pull/26

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 14:25:40 +09:00
IWASE Yusuke
37df91f7f4 BGPSpeaker: Suppress RD in EVPN VRF on SSH console
Because the NLRI_CLASS of the VRF EVPN Table is the same as the
NLRI_CLASS of the Global EVPN Table, the str representation can not
be distinguished with 'formatted_nlri_str' format.
So, 'show vrf' commands on the SSH console returns the str outputs
with Route Distinguisher (RD) even if the route on the VRF Table
can be identified without RD value.

This patch implements the str representation properties to output
BGP routes on SSH console.

Current: RD '65001:100' is duplicated
  bgpd> show vrf all
  VPN: ('65001:100', 'evpn')
   *>  65001💯multicast_etag(ethernet_tag_id:300,ip_addr:10.10.1.0) None     0.0.0.0              Only Path                     ?

With this patch:
  bgpd> show vrf all
  VPN: ('65001:100', 'evpn')
   *>  multicast_etag(ethernet_tag_id:300,ip_addr:10.10.1.0) None     0.0.0.0              Only Path                     ?

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:34:19 +09:00
IWASE Yusuke
c2c421bddd doc: Update the API Reference for BGPSpeaker
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:34:12 +09:00
IWASE Yusuke
aa136b26cf test_validation: Add unit tests for validation utilities
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:34:07 +09:00
IWASE Yusuke
d5ed7c27b7 BGPSpeaker: Enable validation for optional arguments
Currently, RegisterWithArgChecks validates only required arguments,
so invalid arguments might be passed through if the arguments are
registered as optionals.
This patch fixes to enable validation for optional arguments.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:59 +09:00
IWASE Yusuke
c8b8a34f3d BGPSpeaker: Raise exception when validation fails
In the validator for the API arguments should raise exception
when the validator detects invalid arguments, otherwise the
decorator for registering API functions, RegisterWithArgChecks,
can pass through the invalid arguments.

This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:55 +09:00
IWASE Yusuke
ba150be4b1 BGPSpeaker: Improve validation utility methods
This patch fixes to reduce Pylint warnings, to use 'netaddr' utilities
and to reduce redundant if statements.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:49 +09:00
IWASE Yusuke
d8b0ea97cc BGPSpeaker: Resolve unused argumet 'multi_exit_disc'
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:44 +09:00
IWASE Yusuke
6d5a3022a1 BGPSpeaker: Reduce Pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:40 +09:00
IWASE Yusuke
55e517eec6 test_table_manager: Add UTs for the Global Table API
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:35 +09:00
IWASE Yusuke
83324ef9d7 table_manager: Rename internal API for consistency
This patch remames the internal (not for users) API for the consistency,
and add missing docstring.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:30 +09:00
IWASE Yusuke
8ea4e674a9 test_table_manager: Add UTs for the VRF Table API
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:26 +09:00
IWASE Yusuke
b8e75e7e7b BGPSpeaker: Support VRF Table for Ethernet VPN
This patch enables BGPSpeaker to store EVPN routes into the VRF
tables and to provide the API for advertising routes.

Usage example:

  speaker = BGPSpeaker(as_number=65001,
                       router_id='172.17.0.1')

  speaker.neighbor_add(address='172.17.0.2', remote_as=65002,
                       enable_evpn=True)

  speaker.vrf_add(route_dist='65001:100',
                  import_rts=['65001:100'],
                  export_rts=['65001:100'],
                  route_family=RF_L2_EVPN)

  speaker.evpn_prefix_add(route_type=EVPN_MAC_IP_ADV_ROUTE,
                          route_dist='65001:100',
                          esi=0,
                          ethernet_tag_id=200,
                          mac_addr='aa:bb:cc:dd:ee:ff',
                          ip_addr='10.0.0.1',
                          next_hop='172.19.0.1')

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:20 +09:00
IWASE Yusuke
59a3049e13 test_bgpspeaker: Add unit test for the API of EVPN
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:15 +09:00
IWASE Yusuke
985e2557b2 BGPSpeaker: Support Ethernet VPN update messages
This patch enables BGPSpeaker to advertise BGP EVPN routes and
store the advertised BGP EVPN routes from the neighbors.

TODO:
 - To support the VRF table for BGP EVPN routes.
   This patch supports the global table only.
 - To implement Multihoming Functions.
   Currently, ONLY Single-Homing is supported.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:10 +09:00
IWASE Yusuke
55e0097545 packet/bgp: Fix to serialize BGPNotification on Python3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:33:03 +09:00
IWASE Yusuke
b999b8a14f BGPSpeaker/info_base: Add comparison methods for Python3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:32:58 +09:00
IWASE Yusuke
aeda7ae4c5 BGPSpeaker: Support Python3 on SSH console
Currently, SSH console of BGPSpeaker fails to recieve commands from
user when it is running on Python3 due to the binary conversion.
This patch fixes this problem and enables to use SSH console on
Python3.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:32:52 +09:00
IWASE Yusuke
c51c46b584 test_bgp: Add unit tests for Ethernet VPN
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:32:48 +09:00
IWASE Yusuke
c4dac34bad packet/bgp: Support MPLS-Based Ethernet VPN (RFC7432)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:32:42 +09:00
IWASE Yusuke
0255390a76 packet/bgp: Enable to parse the entire packet data
This patch fixes the TCP packet parser to return the BGP packet
parser class if the TCP src or dst port is the reserved BGP port
and enable to parse the entire packet data.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:31:22 +09:00
Shinpei Muraoka
d4b8bd609f tests: Add tests for specifying Packet library for OFPPacketOut.data
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:30:57 +09:00
Shinpei Muraoka
7735137e9d lib/packet: Support the Json format data
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:30:49 +09:00
Shinpei Muraoka
cb4c0b87db ofproto: Enable to specify packet library for OFPPacketOut.data
So far if you set the packet library to OFPPacketOut.data, error occurred.
This patch will be able to set the packet library in OFPPacketOut.data.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-25 13:30:45 +09:00
IWASE Yusuke
59ea6a5231 lib: Reduce Pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-19 17:49:01 +09:00
IWASE Yusuke
6154450494 stringify: Fix to utilise six.moves.builtins
To improve Pylint results, this patch fixes to utilise six.moves.builtins
instead of using __builtin__ on Python2 or builtins on Python3.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-19 17:49:00 +09:00
IWASE Yusuke
016ec1c644 ofctl_nicira_ext: Fix not enough arguments for format string
Currently, the assignment for 'table_id' is missing in the arguments
of str representation.
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-19 17:48:53 +09:00
IWASE Yusuke
8c5071e2db ofctl_nicira_ext: Resolve not initialized values
Currently, 'dst_start_end' and 'src_start_end' in NXActionLearn
are not initialized before assignment to convert into string
representation.
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-19 17:48:46 +09:00
FUJITA Tomonori
fbafa4b950 Ryu 4.5
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-02 11:07:47 +09:00
Victor Orlikowski
12d6584bee Ensure that send() and send_msg() in controller return status to calling applications
When a Datapath disconnects, an application may not know about it
until it attempts to send a message to that Datapath.

Ryu's core will detect the failure to send, and will close the
Datapath object - but has no way of letting the application know that
it did so.

With this patch, send_msg() returns True or False, depending on
whether the message that the application was trying to send was able
to be enqueued to send via a given Datapath object.

If the Datapath.send_msg() returns False, the calling application can
thereby determine that the Datapath is no longer valid, and should
clean up any references it has to it.

Existing applications may choose to ignore the return value, and
nothing breaks.

I have patched one utility method that uses send_msg(), since it was
not marked as deprecated.  All utility methods marked as deprecated, I
have not altered.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-02 11:02:31 +09:00
Victor Orlikowski
9ee265ab45 Clean up stale Datapath objects in the ofctl_service application
A quick patch to clean up stale Datapath objects in the ofctl_service application.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-02 11:01:52 +09:00
Shinpei Muraoka
d0992e24ae packet lib: Add packet library of GRE
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-29 05:55:32 +09:00
Shinpei Muraoka
4ca81f9624 ofproto/nx_actions: Update argument of NXActionCT
Since zone_src in NXActionCT was not possible to specify string,
update zone_src of NXActionCT for the uniformity.
Therefore, you will be able to specify string of OXM/NXM fields for zone_src.

If you want to set the immediate value for zone,
zone_src set the None or empty character string.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 19:46:04 +09:00
Shinpei Muraoka
64ba9f1cdc ofproto/nx_actions: Revert API of NXAction
This patch will revert the API of NXAction for the following report.
https://bugs.launchpad.net/dragonflow/+bug/1599367
revert commit id: 3c3896fd77f274ce953dcb78795aa5cc4fde6c65

This patch reverts recently introduced start and end arguments.
Add the utility method for ofs_nbits.
NXActionRegLoad now takes ofs_nbits argument instead of ofs
and nbits even with this revert.

Additionally, update test cases and documents.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 19:46:03 +09:00
IWASE Yusuke
882262d861 manager: Except KeyboardInterrupt to suppress traceback
Currently, ryu-manager emits traceback messages when killed via
KeyboardInterrupt.
This patch traps the KeyboardInterrupt, and outputs an appropriate
log message instead.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: Alan Fordyce <alan_fordyce@keysight.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:50:35 +09:00
IWASE Yusuke
3c0bd5b024 stplib: Handle the port state not changed events
According to OpenFlow Spec 1.3.5, OFPT_PORT_STATUS messages with
the reason value OFPPR_MODIFY should be sent the BOTH port state
and config have changed.
On the other hand, OVS does not send OFPT_PORT_STATUS messages
when the port config has changed and only sends when the port
state has changed.
But, other switch implementation, e.g. Lagopus, sends messages
when the both port state and config have changed.
Therefore, simple_switch_stp_13.py will overproduce the topology
recalculation events and will fail to recalculate the topology.

This patch checks the port state in OFPT_PORT_STATUS messages
and ignores the message if the port state is not changed.

Reported-by: Hong Panha <c011361065@edu.teu.ac.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:31:27 +09:00
IWASE Yusuke
f52bb7007e stplib: Adopt to Python3
In Python3, cmp() method is no longer supported and numerical
operations evaluates value type more strictly.
So, stplib get some errors in its calculating process.

This patch fixes these problems and enable to use stplib on
Python3 interpreter.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:31:21 +09:00
IWASE Yusuke
a909fa3044 rest_qos: Fix to handle the case without QoS action
Currently, rest_qos.py might fail to parse the actions field in
the QoS rules when the actions field does not have any actions
for the QoS (SET_FIELD, METER, SET_QUEUE).

This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:30:47 +09:00
Michael Haro
c631c46163 packet: support relayed DHCP packet
https://tools.ietf.org/html/draft-ietf-dhc-implementation-02#section-4.7.2

states that DHCP relays should use source port 67 and dest port 67.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:25:49 +09:00
Jonas Grunert
99d641c7d4 Fix: LLDP.OrganizationallySpecific not ignoring info field
LLDP.OrganizationallySpecificTLV did not set info field and produced
malformed LLDP packets

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-14 17:34:15 +09:00
Shinpei Muraoka
b09b39c11d test_parser: Add test data for some NXAction
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:47 +09:00
Shinpei Muraoka
0288ae2cfa ofproto/nx_actions: Support some NXAction
Actions to be added are as following.
 - NXActionSample2
 - NXActionOutputTrunc

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:41 +09:00
Shinpei Muraoka
eed14371b8 ofproto/nx_actions: Add comment for Ryu documents
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:36 +09:00
Shinpei Muraoka
8b8162ca1f test_parser: Add test data for missing NXAction
Note: The following actions are not implemented yet,
because ovs-ofctl command is not supported.
 - NXActionRegLoad2
 - NXActionOutputReg2

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:30 +09:00
Shinpei Muraoka
89f6945b7e ofproto/nx_actions: Support missing NXAction
Actions to be added are as following.
 - NXActionDecTtlCntIds
 - NXActionStackPush
 - NXActionStackPop
 - NXActionSample
 - NXActionOutputReg2
 - NXActionRegLoad2
 - NXActionController2

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:26 +09:00
Shinpei Muraoka
6daa1eedc5 ofproto/nx_actions: Update arguments to be compatible with ovs-ofctl
This patch, update the methods that are to be specified in the NXM or OXM.
Update the oxm_types specified in the bit format to the string.
Update the following NXAction.

 - NXActionOutputReg
 - NXActionMultipath
 - NXActionBundle
 - NXActionBundleLoad

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:20 +09:00
Shinpei Muraoka
8e30b1f444 test_parser: Add test data for NXAction used only in OpenFlow1.0
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:13 +09:00
Shinpei Muraoka
3b1a314bd0 ofproto/nx_actions: Add NXAction used only in OpenFlow1.0
There is NXAction to be used only in OpenFlow1.0.
These actions are supported by default in OpenFlow1.2 or later.
Therefore, it becomes unnecessary as the NXAction.
But, to add the NXAction in order to be able to use in OpenFlow1.0.
Actions to be added are as following.
 - NXActionSetQueue
 - NXActionDecTtl
 - NXActionPushMpls
 - NXActionPopMpls
 - NXActionSetMplsTtl
 - NXActionDecMplsTtl
 - NXActionSetMplsLabel
 - NXActionSetMplsTc

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:05 +09:00
IWASE Yusuke
8cb23e19a7 test_packet: Avoid to use array.array as input binary
In Python 2.7, array.array cannot be converted correctly into binary
type by using six.binary_type().
So packet.Packet() cannot skip data effectively.
This patch remove to use array.array as input binary in test_packet.

Note: array.array can be used as input binary as the same as before,
but in this case, the padding data will be displayed in str or repr
representation in Python 2.7.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:46:30 +09:00
IWASE Yusuke
3736ab76a5 packet: Fix minimum ethernet frame length
In the Ethernet frame Spec (Both DIX EthernetII and IEEE 802.3),
the frame size must be at least 64 bytes long (not including the preamble).

  64 bytes = 14 bytes (Header) + 46 bytes (Payload) + 4 bytes (FCS)

This patch appends padding if the payload is less than 46 bytes long.

Reported-by: Kawai, Hiroaki <kawai@iij.ad.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:46:27 +09:00
IWASE Yusuke
81d3d5647c test_peer: Unit test for peer.py of BGPSpeaker
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:46:13 +09:00
IWASE Yusuke
55d955f484 BGPSpeaker: Support Four-Octet AS number
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:45:43 +09:00
IWASE Yusuke
2039347560 packet/bgp: Support Four-Octet AGGREGATOR Path Attribute
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:45:36 +09:00
IWASE Yusuke
a6c5f27cbe BGPSpeaker: Fix capability check when MP-BGP not supported
Currently, BGPSpeaker skips sending the Update messages with an
IPv4/IPv6 prefix when the peer does not support MP-BGP.
This patch fixes capability check in order to send IP prefix when
MP-BGP not suppored by the peer.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:45:31 +09:00
Kawai, Hiroaki
04b4bbbe01 fix of13 VLAN_PCP test case
To test VLAN_PCP, VLAN_VID must match.
Table miss test was testing VLAN_VID instead of VLAN_PCP,
because the packet had mismatching VLAN_VID.
Fixes to set only OFPVID_PRESENT bit in the match field.

Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:44:22 +09:00
FUJITA Tomonori
400a98d4a7 Ryu 4.4
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-30 16:21:54 +09:00
Evan Gray
7d15368bf9 topology: ignore cfm packets on packet in
This commit will allow the host_discovery_packet_in_handler to ignore invalid
cfm packets. Ryu will fail to parse cfm packets with an interval of 0 -- We
discovered this when one of our systems sent cfm packets with an interval of 0.

Signed-off-by: Evan Gray <evanscottgray@gmail.com>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 12:23:17 +09:00
Evan Gray
2a2b2b1762 topology: pep8 fixes
Normal pep8 fixes, there were also two instances where I updated a commented
LOG.debug to include exc_info=True so that the traceback will be logged
instead of relying on the error passed in the except.

Signed-off-by: Evan Gray <evanscottgray@gmail.com>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 12:22:58 +09:00
IWASE Yusuke
658c754cbd ofproto: Fix example of OFPSetAsync message
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 12:17:53 +09:00
IWAMOTO Toshihiro
0dc79ddd7e Update the readthedoc URL
The hosting site has changed to use readthedocs.io instead of
readthedocs.org.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 12:14:51 +09:00
Jason Kölker
8b038a492e lib/ofctl_utils: Log the datapath sent to
If a controller has multiple switches connected it is useful to be able
to distinguish which datapath the msg is being sent to.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 11:37:09 +09:00
IWAMOTO Toshihiro
b0ab4f1602 Avoid parallel executions of AppManager.close()
If an AppManager.close call is started and all AppManager.services
are stopped, AppManager.run_apps starts another close() call,
resulting in a KeyError exception in close() (*1).  Prevent that using
a semaphore.

(*1) https://launchpad.net/bugs/1589746
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 11:30:01 +09:00
fumihiko kakuma
d079bf38e7 python3: Use six.add_metaclass for metaclass
__metaclass__ can't be used with python 3 as metaclass syntax has been
changed in python 3.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:54:39 +09:00
fumihiko kakuma
c897ae7d8a python3: Use six.string_types instead of basestring
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:54:37 +09:00
fumihiko kakuma
85023d4fdb python3: Improve Table class in services.protocols.bgp.info_base.base
Remove itervalues() and values() always returns iterator

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:54:36 +09:00
Fumihiko Kakuma
9f4328682f python 3: Replace deprecated logging.warn with logging.warning
logging.warn is deprecated in Python 3 [1].
This patch switches it to the non-deprecated logging.warning.
This is bug-reported by openstack [2].

[1] https://docs.python.org/3/library/logging.html#logging.warning
[2] https://bugs.launchpad.net/magnum/+bug/1508442

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:53:50 +09:00
IWASE Yusuke
f86499373a Python3: Explicit string type encoding
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:27:06 +09:00
IWASE Yusuke
55a88d6805 BGPSpeaker: Remove unused utility modules
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:27:03 +09:00
IWASE Yusuke
c263089e72 BGPSpeaker: Fix unresolved references in Python3
Additionally, this patch enforces the the explicit relative imports

Reviewed-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:26:59 +09:00
IWASE Yusuke
9393af3f06 BGPSpeaker: Support Per-Peer AS
This patch enables to override the AS number of BGPSpeaker instance
by the "local_as" argument of BGPSpeaker.neighbor_add().

e.g.)
  speaker = BGPSpeaker(as_number=65001,  # the default AS number
                       router_id='10.0.0.1',
                       ...)

  speaker.neighbor_add(address='10.0.0.2',
                       remote_as=65101,
                       local_as=65002,  # override AS number
                       ...)

Additionally, this patch fixes a typo and sorts the comments of
BGPSpeaker.neighbor_add() method.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:26:53 +09:00
Shinpei Muraoka
7b562c3700 packet_data_generator3/gen: Add some NXAction packets
This patch adds the following test packet.
 - NXActionController
 - NXActionFinTimeout
 - NXActionNote

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:48 +09:00
Shinpei Muraoka
7ca8690557 ofproto/nicira_ext: Move the variable and method for Nicira Extension
Move variable and method that exist in the ofproto_v1_0.py to the nicira_ext.py.
Move the oxm_types that exists in the nx_match.py to the nicira_ext.py.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:47 +09:00
Shinpei Muraoka
5ebf0fa5c4 tests/test_parser_v10: Update test parameter
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:35 +09:00
Shinpei Muraoka
3c3896fd77 ofproto/nx_actions: Update arguments to be compatible with ovs-ofctl
This patch, update the methods that are to be specified in the NXM or OXM.
Update the value specified in the bit format to the start and end formats.
Update the following NXAction.

 - NXActionRegLoad
 - NXActionOutputReg
 - NXActionMultipath
 - NXActionBundle
 - NXActionBundleLoad
 - NXActionCT

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:33 +09:00
Shinpei Muraoka
ecc3ea296f ofproto/ofproto_v1_0: Delete some NX actions
This patch deletes some NX Actions in ofproto_v1_0_parser
and fixes to use actions in nx_actions.py.
Together, delete Obsolete action in OVS.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:32 +09:00
Shinpei Muraoka
462256198b ofproto/nx_actions: Porting the NX Action definition of ofproto_v1_0_parser
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:30 +09:00
Shinpei Muraoka
5dfdc856bc ofproto/nx_actions: Update serialize and parse
The serialize within each class has been changed to serialize_body.
And serialize_body is executed by the serialize of NXAction.
Also update the data format designated method in serialize_body and perse.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:29 +09:00
Alan Quillin
35a98fca3e Extend OVSDB api
Adds more ovsdb methods for setting key/values to other_config and
external_ids, adds bility to set the controller for a bridge, and adds the
ability to create a new port/interface on a bridge

Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:06:57 +09:00
Yi Tseng
865d6e52d7 Fix RuntimeError of lldp_packet_in_handler
Items should not be removed during iteration

Error message
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py", line 290, in _event_loop
    handler(ev)
  File "/usr/local/lib/python3.4/dist-packages/ryu/topology/switches.py", line 821, in lldp_packet_in_handler
    for host in self.hosts.values():
RuntimeError: dictionary changed size during iteration
```

Signed-off-by: Yi Tseng <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-05 15:24:42 +09:00
FUJITA Tomonori
d090b291be Ryu 4.3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-03 08:01:56 +09:00
Atzm Watanabe
24a041ecca nx_match: add tun_ipv6_{src,dst}
Open vSwitch accepts NXM_NX_TUN_IPV6_SRC(109) and
NXM_NX_TUN_IPV6_DST(110) since v2.5.

Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:43:01 +09:00
IWASE Yusuke
1bcb23e556 packet_data_generator3: Clear xid into zero
Because ovs-ofctl increments the xid field automatically, the xid
of the generated packets is set to be 0x02.
So, we should specify {"xid": 2} in json data, but when Ryu dumping
json data from message instance, "xid" are omitted and this causes
assertion error in test_parser.py

This patch enables to clear the xid filed in the generated packets
and solves this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:40:17 +09:00
IWASE Yusuke
709b3ad28f ofproto: Implement OFPFlowMod parser
Currently, Ryu does not have the parser for Controller-to-Switch
one-way messages, but when testing Actions or Match fields,
OFPFlowMod parser is convenient in order to test them.

This patch implements the parser for OFPFlowMod messages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:40:12 +09:00
IWASE Yusuke
f3e931b03f doc: Add PCAP file library reference
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:40:04 +09:00
IWASE Yusuke
ad481c7de8 test_pcaplib: Add unit tests for pcaplib
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:39:59 +09:00
IWASE Yusuke
6643bae823 pcaplib: Reduce Pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:39:54 +09:00
IWASE Yusuke
35fc29a8d3 test_bgp: Enable to test parser with pcap file
Currently, test_bgp uses packet_data/bgp4/* files which contain only
BGP protocol binary data.
This patch convert packet_data file into pcap file and enable to test
BGP packet library with pcap file.
With pcap file, we can easily check packet data validity by using
Wireshark or other packet sniffer tools.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:39:03 +09:00
IWASE Yusuke
b3b8238e6c packet/bgp: Reduce Pylint warnings
This patch removes the following Pylint warnings:
  - anomalous-backslash-in-string
  - arguments-differ
  - bad-builtin
  - bad-staticmethod-argument
  - superfluous-parens
  - super-init-not-called
  - unidiomatic-typecheck
  - unused-variable
  - wrong-import-order

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:57 +09:00
IWASE Yusuke
171b35f0db bgp: fix typos
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:50 +09:00
IWASE Yusuke
9b57e7bd07 test-requires: Update to use the latest Pylint
Current specified Pylint(==0.25.0) are not enough to support Python 3.
This patch updates test-requires to use the latest one.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:39 +09:00
IWASE Yusuke
4fa85d1e4b test-requires: Add tinyrpc for RPC controller in wsgi
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:27 +09:00
YAMAMOTO Takashi
9e3aaaf2d8 Make ovs optional
Requiring a dev version of ovs here causes version conflict issues
for projects which don't want to use dev versions of libraries. [1]

Make it optional and document it in README instead.

[1] https://bugs.launchpad.net/neutron/+bug/1584858

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-26 23:30:49 +09:00
IWASE Yusuke
a6c3d38789 packet: Add VXLAN parser
IANA has assigned the value 4789 for the VXLAN UDP destination port,
this patch registers dst_port 4789 into UDP packet parser.
Additionally, early adopters might be using UDP dst_port 8472,
we register this number for the backward compatibility.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-23 12:48:08 +09:00
IWAMOTO Toshihiro
7f38397442 packet/bgp: Add missing __hash__ function
This commit fixes up the commit 7d42aecb, which added __eq__ without
adding __hash__ and left some copy-paste error.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 17:49:25 +09:00
IWASE Yusuke
a7e804fdec controller: Add backward compatibility for 6633 port
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:01:23 +09:00
IWASE Yusuke
7d446f3f79 Update default OpenFlow port to 6653
IANA has registered TCP port 6653 for OpenFlow, but 6633 was the
de facto standard for a long while.
So some applications might be using 6633 as the default.
But now, Mininet has adopted port 6653 as the default, we migrate
to port 6653 too.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:01:22 +09:00
IWASE Yusuke
a20b9e1fcd BGP: Make RouteFamily class hashable
In Python 3, the key objects of dict must be hashable,
but RouteFamily class does not have '__hash__' method.
This patch adds this method.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:01:16 +09:00
IWASE Yusuke
13ae023f2d doc: Remove warnings when building doc pages
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:00:51 +09:00
IWASE Yusuke
9d9f28519f doc: Move Ryu App API doc into each source code
To improve maintainability, this patch moves the descriptions of
"Ryu application API" into each source code.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:00:34 +09:00
IWASE Yusuke
68025e66b1 network: Fix unresolved reference
Because ryu/app/rest_nw_id.py has been deleted, the reference for
NW_ID_UNKNOWN can not be resolved now.
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:00:09 +09:00
IWASE Yusuke
3cccf23238 doc: Add description for EventOFPPortStateChange
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 15:59:22 +09:00
IWASE Yusuke
9774eb60af controller: Implement EventOFPPortStateChange
To notify ofp_port state change, this patch implements
ofp_event.EventOFPPortStateChange.
This event performs like EventOFPPortStatus, but ofp_handler will
send this event after updating "ports" dict of datapath instances.

And, this patch suppresses the warning when user app accessing
to datapath.ports for backward compatibility.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 15:59:13 +09:00
Shinpei Muraoka
af2ae13ae3 doc/app/ofctl_rest: Remove unused match field
This patch removed unused match field in Openflow1.2 or later.
The following is removed match filed.
 - dl_dst
 - dl_src
 - dl_type
 - dl_vlan
 - nw_src
 - nw_dst
 - nw_proto
 - tp_src
 - tp_dst

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
3f60665d1f doc/source/conf: Set the False to SmartyPants
This patch will not be converted to quotes and dashes to typographically correct entities.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
d435446ef5 doc/app/ofctl_rest: Add a description for openflow1.5
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
f351cd3977 doc/app/ofctl_rest: Update the optional parameter of the message
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
918edd4eff doc/app/ofctl_rest: Add pbb_uca to match field
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 13:15:24 +09:00
Shinpei Muraoka
a605021ccf doc/app/ofctl_rest: Update the description method of Example
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 13:15:22 +09:00
Shinpei Muraoka
7f1c91114b doc/app/ofctl_rest: Add Openflow version
This patch adds Openflow version to the Match message and Actions message.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 13:15:19 +09:00
Victor J. Orlikowski
89b2bf52d5 Bump version requirement for oslo.config, given usage of min parameter to IntOpt
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 23:03:52 +09:00
IWASE Yusuke
208ad9d11c tox: Integrate Coveralls.io
To check the code coverage of the unit tests on web, this patch
add integration of Coveralls.io (https://coveralls.io/).

Usage:
  1. Sign in to Coveralls.io with your GitHub account.
  2. Add repos at your account page.
  3. Execute tests on Travis-CI.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:33:21 +09:00
IWASE Yusuke
dc6e2b8691 tox: Add Python 3.5
>From Ubuntu 16.04 LTS, the default version of Python 3 has been
upgraded to 3.5.1.
  e.g.)
    $ python3 --version
    Python 3.5.1+

This patch enables to run unit tests on Python 3.5 environment.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:33:17 +09:00
Shinpei Muraoka
ead9ce79a5 test_ofctl: Add test cases for new Actions of of15
This patch adds the test cases for the following actions.
 - Copy Field Action
 - Meter Action

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:26:15 +09:00
Minoru TAKAHASHI
e30eebbc42 test_ofctl_rest: Add unit tests for ofctl_rest
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:26:13 +09:00
Minoru TAKAHASHI
4bec6aca3d test_ofctl: Add test cases for OpenFlow 1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:26:03 +09:00
Minoru TAKAHASHI
255fd1564e ofctl_rest: Support OpenFlow 1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:56 +09:00
Minoru TAKAHASHI
a7b092747f lib/ofctl: Support OpenFlow 1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:50 +09:00
Shinpei Muraoka
1452facb25 ofproto_v1_5_parser: Fix serialized length of OFPActionCopyField
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:43 +09:00
IWASE Yusuke
c9132288eb ofctl_v1_4: Port some improvements from ofctl_v1_3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:41 +09:00
IWASE Yusuke
ea8c3b8fb7 ofctl_v1_4: Rename to get_queue_desc for uniformity
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:32 +09:00
Minoru TAKAHASHI
a67f436b8d ofctl_v1_4: Support request parameters
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:31 +09:00
IWASE Yusuke
9dd3b3ce4a ofctl_utils: Enhance user value conversion
Currently, OFCtlUtil._reserved_num_from_user() fails to convert
an user specified value when it is a numeric string.
This patch enhances this conversion to enable to convert an user
value as follows.

e.g.)
 - Integer: 1 -> 1
 - Numeric string: "1" -> 1
 - Reserved number: "OFPP_ANY" -> 0xffffffff
 - Invalid value: "foobar" -> "foobar" (do not conversion)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:21 +09:00
IWASE Yusuke
c1047818d3 REST Apps: Adopt to Python 3
In Python 3, webob.Request.body is a byte type value and json.loads()
cannot parse it, because json.loads() suppose a str type value.

This patch fixes to use webob.Request.json to parse request body
and avoids this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:25:09 +09:00
IWASE Yusuke
326b46bf6d topology: Adopt to Python 3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:24:53 +09:00
Shinpei Muraoka
4b99579249 ofctl_rest: Enable to omit port_no and queue_id
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:24:14 +09:00
IWASE Yusuke
f60c12cbbe ofctl_rest: Adopt decorator to simplify
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:18:14 +09:00
Shinpei Muraoka
dcb1efb8e5 test_ofctl: Test cases for omitting port_no in get_queue_config
Add test cases of specify the port number for get queues config.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:18:05 +09:00
IWASE Yusuke
e721c181e0 lib/ofctl_v1_[23]: Unify the arguments order
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:17:56 +09:00
IWASE Yusuke
bea97ae66b ofctl_utils: Confirm binary type data in send_experimenter
In Python 3, the data field in OFPExperimenter must be a binary
type value, but when data_type='ascii', ofctl_utils may get it
as a str type value.
This patch confirms the data field is a binary type value.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:17:46 +09:00
Minoru TAKAHASHI
33d1023368 test_import_module: Update test cases
Because Python does not provides features to unimport modules which
ware imported before, this patch separates dummy modules to test
import features of Ryu.
e.g.) If 'aaa' was imported in the previous test case,
      'aaa' affects the subsequent test cases.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:17:25 +09:00
Minoru TAKAHASHI
c66b4b34e5 utils: fix for temporarily storing the value of sys.path
Currentry, the *reference* of sys.path is temporarily stored before
appending a path to the user modules.
However, the *value* of sys.path should be stored because the type
of sys.path is list (mutable object) type.

Reported-by: Xandaros <mz.bremerhaven@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:17:23 +09:00
FUJITA Tomonori
2d05aedf14 Ryu 4.2
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10 07:45:19 +09:00
Alan Quillin
7db022bf71 Enable filtering the OVSDB schema tables/columns
Adds the ability to filter the OVSDB scheme to only include specified
tables from the config as well as filter out (exclude) specific table
columns.  If neither of the values are defined in the config, then the
discovered schema is used unchanged.  The is needed to calm down noise with
unused tables/columns to help with scale problems on hosts with a large
number of bridges and interfaces.

Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Acked-By: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10 05:31:24 +09:00
IWASE Yusuke
dbe6743742 tox: Upgrade PyPy version to 2.6
Recently, Paramiko updates the requirements to 'cryptography>=1.1',
cryptography 1.0 is not compatible with PyPy < 2.6, but PyPy version
of Travis-CI is older than 2.6.
So this causes CI test error.

This patch upgrades PyPy interpreter version to 2.6 in tox environment.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-09 19:01:17 +09:00
Victor J. Orlikowski
f61bb5f938 Eventlet throws a subclass of IOError when an SSL read timeout occurs. Ensure that the read loop continues in this case.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Tested-by: Andy Hill <hillad@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-20 08:48:53 +09:00
Alan Quillin
d1495523eb Added support for the tcp flags nicira extension
Adds support for setting TCP flags using the nicira extensions for
OF1.0 and OF1.2+ Allows using the extensions with OF1.2+ for OVS
versions < 2.4 where the TCP flags OF extension is not yet supported.

Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-18 22:51:01 +09:00
Claudiu Belu
b40422d559 Removes unnecessary Windows requirements
The wmi and pywin32 modules are not used anywhere in this project.
There is no reason to have them.
2016-04-06 22:33:56 +03:00
FUJITA Tomonori
a5e935887d Ryu 4.1
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-02 13:14:52 +09:00
Shinpei Muraoka
c67c8c8192 doc/app/ofctl_rest: Update example of set-field action
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-02 13:12:52 +09:00
Shinpei Muraoka
efb830c081 doc/app/ofctl_rest: Update the code-block language of response data
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-02 13:12:51 +09:00
Shinpei Muraoka
e4d8da6669 doc/app/ofctl_rest: Update the ryu.app.ofctl_rest version from openflow1.3 to openflow1.4
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-02 13:12:46 +09:00
Jason Kölker
93aa0d6d8d lib/ofctl_v1_[234]: Consolidate send_experimenter
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:57 +09:00
Jason Kölker
369df99822 lib/ofctl_v1_[34]: Consolidate common functions
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:53 +09:00
Jason Kölker
110118586f lib/ofctl_v1_3: Support nicira extensions
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:48 +09:00
Jason Kölker
429a6bc546 lib/ofctl_v1_3: Allow caller to disable conversion
Paramaterizes type converions in function to allow calling code to
specify if responses should be converted to user friendly display
(strings) or type perserved.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:44 +09:00
Jason Kölker
cb51b6cdc3 lib/ofctl_*: Consolidate send_stats_requst
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:40 +09:00
Jason Kölker
b69c5b907a lib/ofctl_*: Log the xid of messages being sent
Useful for debugging calling code that waits for or uses reponses.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:35 +09:00
Jason Kölker
3350ee045e unit/lib/test_ofctl: Fix Flake8 [e731]
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:28 +09:00
Jason Kölker
3b7b2819ce ofproto/ofproto_v1_4_parser: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:10 +09:00
Jason Kölker
2825212c31 ofproto/ofproto_v1_3_parser: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:08:06 +09:00
Jason Kölker
740cc3a099 ofproto/ofproto_v1_2_parser: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:51 +09:00
Jason Kölker
a77ab6fddc ofproto/ofproto_v1_0_parser: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:47 +09:00
Jason Kölker
bb3cfefb5d ofproto/nx_actions: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:42 +09:00
Jason Kölker
daa77e73c7 lib/ofctl_v1_4: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:38 +09:00
Jason Kölker
0f79e71fdc lib/ofctl_v1_3: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:34 +09:00
Jason Kölker
e16faaa79c lib/ofctl_v1_2: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:30 +09:00
Jason Kölker
b88adadec4 lib/ofctl_v1_0: Flake8 Fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-30 08:07:23 +09:00
FUJITA Tomonori
b8cb2d22aa pip-requires: force ovs>=2.6.0dev0 for everyone
The version of pip on Ubuntu 14.04 can't handle the version
condition. So force ovs>=2.6.0dev0 for python2.7 users too.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Jason Kölker <jason@koelker.net>
2016-03-30 05:02:38 +09:00
Jason Kölker
00c31a4d73 packet/tcp: Add TCP Control Flags
Add the control flags constants and a helper function to test which
flags are on.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:46 +09:00
Minoru TAKAHASHI
9bc1624932 lib/ofctl_utils: Add a deprecated value
Note:
  The list of 'deprecated_value' are used by '_reserved_num_to_user()' to
  ignore values those are deprecated in OpenFlow Spec.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:40 +09:00
Minoru TAKAHASHI
61306439db lib/ofctl_v1_4: Fix json format of queue_desc_reply
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:35 +09:00
Minoru TAKAHASHI
5246068fe8 lib/ofctl_v1_4: Fix an omission in OFPTFPT_*
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:30 +09:00
Minoru TAKAHASHI
7715934d95 lib/ofctl_v1_4: Fix a small bug in mod_group_entry()
If the specified value of group_type is empty, cause an error.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:25 +09:00
Minoru TAKAHASHI
3484e6e573 lib/ofctl_v1_0: Fix a small bug in get_desc_stats() and get_aggregate_flow_stats()
If there is an empty value in the reply msg, there are cases where those methods cause an error.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-27 22:29:18 +09:00
Jason Kölker
d33c9f0fd9 protocols/ovsdb: Add api for systemd_id lookup
Create an api helper function for correlation of system_id given a
datapath_id.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-24 05:18:03 +09:00
Jason Kölker
9e7a3e2342 protocols/ovsdb: Add bulk read support
At times is it convient to read from all clients at the same time. In
particular when searching for what system_id a port or bridge (datapath)
belongs to.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-24 05:17:58 +09:00
Jason Kölker
b5cf6e1121 protocols/ovsdb: Fix shadow variables
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-24 05:17:53 +09:00
Jason Kölker
2de65ac1ad protocols/ovsdb: Update wrapped Idl()
Upstream ovs added the `Idl.readonly` property after ryu embeded ovs.
Add the property for compatability.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-24 05:17:48 +09:00
Jason Kölker
e190549b76 protocols/ovsdb: Remove patched ovs.vlog
The upstream `ovs.vlog` plays nice with python logging. No need for the
workaround.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-24 05:17:42 +09:00
Shinpei Muraoka
c9a68a429d test_ofctl: Add test cases
This patch adds the following test cases.
 - Specify the port number for get ports stats.
 - Specify the group id for get group stats.
 - Specify the meter id for get meter stats.
 - Specify the meter id for get meter config.
 - Specify the port number and queue id for get queue stats.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:44:13 +09:00
Shinpei Muraoka
a1a5ff08b6 doc/app/ofctl_rest: Add the attribute for message
This patch adds attributes of the following messages.
 - Add the port number for get ports stats.
 - Add the group id for get group stats.
 - Add the meter id for get meter stats.
 - Add the meter id for get meter config.
 - Add the port number and queue id for get queue stats.

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:44:08 +09:00
Shinpei Muraoka
32f5c622b3 ofctl_rest: Support port number and queue id in get_queue_stats()
This patch enables to specify the port number and the queue id to get the queue stats.

Usage)
  $ curl -X GET http://localhost:8080/stats/queue/<dpid>[/<port>[/<queue_id>]]
  Note: Specification of port number and queue id are optional.
        If you want to omitting the port number and setting the queue id,
        please specify the keyword "ALL" to the port number.
        e.g. GET /stats/queue/1/ALL/1

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:44:01 +09:00
Shinpei Muraoka
3e180d8504 ofctl_rest: Support meter id in get_meter_config()
This patch enables to specify the meter id to get the meter config.

Usage)
  $ curl -X GET http://localhost:8080/stats/meterconfig/<dpid>[/<meter_id>]
  Note: Specification of meter id is optional

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:43:56 +09:00
Shinpei Muraoka
c39b9d57f8 ofctl_rest: Support meter id in get_meter_stats()
This patch enables to specify the meter id to get the meter stats.

Usage)
  $ curl -X GET http://localhost:8080/stats/meter/<dpid>[/<meter_id>]
  Note: Specification of meter id is optional

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:43:50 +09:00
Shinpei Muraoka
ba1535b4b3 ofctl_rest: Support group id in get_group_stats()
This patch enables to specify the group id to get the group stats.

Usage)
  $ curl -X GET http://localhost:8080/stats/group/<dpid>[/<group_id>]
  Note: Specification of group id is optional

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:43:45 +09:00
Shinpei Muraoka
294d241830 ofctl_rest: Support port number in get_port_stats()
This patch enables to specify the port number to get the port stats.

Usage)
  $ curl -X GET http://localhost:8080/stats/port/<dpid>[/<port>]
  Note: Specification of port number is optional

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:43:40 +09:00
Jason Kölker
545645eef8 hub: Preserve functions return value
Calling GreenThread.wait() should return the value of the greenthread or
reraise the exception. As it is being wrapped to mimic gevent's .join
behaviour introduce the `raise_error` kwarg to allow callers to specify
the behavior they expect while maintaining backwards compatability.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:30:14 +09:00
Jason Kölker
69744305b9 protocols/ovsdb: Improve non-blocking performance
Prevent `client.discover_schemas` from blocking while calling into the
`ovs` library by emulating `jsonrpc.Connection.transact_block` to not
block and explicitly allow greenlet switching every loop.

Works with both the embeded ryu.contrib.ovs and upstream ovs python
packages.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-23 22:29:07 +09:00
Jason Kölker
8d2604ee67 contrib/ovs: Remove embeded ovs, use upstream
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-21 19:28:32 +09:00
Jason Kölker
0ffbc19e18 protocols/ovsdb: Fix variable name issue
Previous patch referred to the wrong config names

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-17 08:53:15 +09:00
Jason Kölker
2b047bd7d7 protocols/ovsdb: Allow setting backoff settings
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-17 06:11:11 +09:00
Victor J. Orlikowski
a3c8c591d9 Cleanups to controller.py
A set of minor cleanups.
1) Remove the unused import of MAIN_DISPATCHER from ryu.controller.handler.
2) Remove the extraneous "close_requested" variable.
3) Ensure use of equality instead of identity for testing against DEAD_DISPATCHER.
4) Alter the exit condition for the _send_loop.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:56:34 +09:00
Jason Kölker
8ae807ff66 protocols/ovsdb: Allow setting probe interval
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:47 +09:00
Jason Kölker
57c6897210 protocols/ovsdb: Fix shadow loop variables [F402]
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:45 +09:00
Jason Kölker
db02d0f487 protocols/bgp: PEP-8 and Python3 fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:27 +09:00
Jason Kölker
7d42aecb8d packet/bgp: PEP-8 and Python3 fixes
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:24 +09:00
Minoru TAKAHASHI
03e365d6b1 doc/app/ofctl_rest: Update description for action type of experimenter
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:08 +09:00
Minoru TAKAHASHI
020eb2b9bf ofctl_v1_3: Add support for using action experimenter
This patch makes it possible for ofctl_v1_3 to use the action type of experimenter.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:06 +09:00
Minoru TAKAHASHI
801bdacbe3 ofproto_v1_3: Add unit test cases for action experimenter
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:44:03 +09:00
Minoru TAKAHASHI
7316f86034 ofproto_v1_5: Reduce an unnecessary code
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:43:49 +09:00
Minoru TAKAHASHI
2f1500cc37 ofproto_v1_5: Add test case for OFPExperimenter
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-11 23:43:40 +09:00
FUJITA Tomonori
1adae0f4df Ryu 4.0
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-04 05:56:43 +09:00
Victor J. Orlikowski
4a99bb258a Typo fixes
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:07:21 +09:00
Victor J. Orlikowski
1625117fbb of: add echo request support
Add a new feature: an echo request loop, which implements a liveness
check for connected Datapaths. This feature is off by default, but can
be enabled by setting the config file option
maximum_unreplied_echo_requests to a positive integer value.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:06:50 +09:00
Victor J. Orlikowski
ed30a8b253 make socket-timeout config file option
Change socket-timeout from being a CLI option to being a config file
option, since this should not *normally* need to be set on the command
line.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:06:02 +09:00
Victor J. Orlikowski
477f2ddd70 Clean up socket close() handling
Also, temporarily work around a bug in eventlet's Queue.put() by
wrapping the send_q with a semaphore.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:04:53 +09:00
Victor J. Orlikowski
f1f0ca2d16 Wrap handler calls in the event loop in a try/except and log exceptions
In order to prevent an exception from terminating the execution of the
event loop. Wrapper name also added to hub.py for GreenletExit.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:03:38 +09:00
Victor J. Orlikowski
db1c93249b Use a slightly lighter Queue implementation
It does not include an internal counter.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:02:34 +09:00
Victor J. Orlikowski
876e35d430 Protect events queue with a semaphore
Due to a discovered bug in eventlet queue put(). This is a temporary
workaround until eventlet is fixed.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 22:01:49 +09:00
IWASE Yusuke
442aa61b6e .pylintrc: Remove deprecated output format feature
The 'parseable' output format of pylint is deprecated.
This patch updates the option from 'output-format=parseable' into
equivalent output format by using 'msg-template'.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:35 +09:00
IWASE Yusuke
4d8c6d3a7c run_mininet: Specify the controller port
In the latest mininet, the default controller port has been updated
to 6653, but currently the default port of Ryu is 6633.

This patch specifies the controller port by using the constant from
Ryu ofproto module.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:11 +09:00
IWASE Yusuke
f2bb13dbb5 run_mininet: Adopt utility methods of Mininet class
Currently, run_mininet uses low level APIs of mininet.
This patch fixes to use utility methods of Mininet class.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:07 +09:00
IWASE Yusuke
6b10a3b45a run_mininet: Support protocols option of ovs-vsctl
To support user-specified OpenFlow version, this patch adds protocols
option support into run_mininet script.

Usage example)
  $ sudo python run_mininet.py --protocols OpenFlow13

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:02 +09:00
IWASE Yusuke
7b5d6bd24a ofp_handler: Handle empty data field in OFPErrorMsg
OpenFlow Spec defines that the data field should contain at least
64 bytes of the failed request that caused the error message to be
generated, unless otherwise specified.
But, the data field can be empty in some switch implementation,
this patch checks the data field length and skips parsing it if the
field does not contain enough bytes to parse.

Reported-by: Yury Yurochko <y.yurochko@brain4net.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:55 +09:00
Minoru TAKAHASHI
51fcda83b5 lib/ofctl: add test files for ofctl_v14
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:34 +09:00
Minoru TAKAHASHI
31d56d0d32 lib/ofctl: add ofctl_v1_4 library
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:28 +09:00
Minoru TAKAHASHI
c56edd5890 app/ofctl_rest: support OpenFlow1.4
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:24 +09:00
Minoru TAKAHASHI
6b3c4dfd43 ofproto: Fixes invalid async config property types
The following types are presents in Openflow Spec v1.4.0 and 1.4.1.

OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE
OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF

Prefix of async config property type should be 'OFPACPT_' but the above are starting with 'OFPTFPT_'.
Because these types have been fixed in Openflow v1.5.0, this patch fixes the above types in ofproto_v1_4.py as follows.

OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE  <-- treated as deprecated[*1]
OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF <-- treated as deprecated[*1]
OFPACPT_EXPERIMENTER_SLAVE = 0xFFFE
OFPACPT_EXPERIMENTER_MASTER = 0xFFFF

[*1] OFPTFPT_EXPERIMENTER_SLAVE/MASTER are left in ofproto_v1_4.py for backward compatibility.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 13:24:06 +09:00
IWASE Yusuke
ede171c529 simple_switch: Separate simple_switch for beginners
simple_switch_* apps have conflicting two faces of its purpose.
One is the example apps for beginners, the other is the utility
apps for the L2 switching in the user environments.
These are difficult to be compatible.

This patch adds an example app for begginers and separates
from simple_switch_* apps.
This makes it easy to improve the L2 switching function of
simple_switch_* apps.

To simplify example_switch_13, the following features are dropped
from simple_switch_* apps.
 - FlowMod and Packet-Out messages using "buffer_id".
 - Checking the expected "miss_send_length" field.
 - Ignoring the LLDP packets

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 08:42:30 +09:00
FUJITA Tomonori
af5e6b5fb7 drop python2.6 support
The Python core team[*1] stopped supporting python 2.6. Some Python
libraries started following the same path and trying to support 2.6
becomes painful...

For example, most of you already noticed, oslo.config dropped 2.6
support. I tried to work around it with the following commit:

2250171098

But this forces users of decent distributions (e.g Ubuntu 14.04) to
upgrade pip (old pip versions can't understand version conditions).

[*1]
http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 06:54:47 +09:00
Corey Bryant
27409a544e Fix i386 test failures
Signed-off-by: Corey Bryant <corey.bryant@canonical.com>
Reviewed-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 06:51:53 +09:00
IWAMOTO Toshihiro
5552348c7c test_parser: add an NXActionRegLoad test
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 14:47:46 +09:00
IWAMOTO Toshihiro
d4c6e154d5 packet_data_generator3: generate an NXActionRegLoad packet
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 14:47:45 +09:00
IWAMOTO Toshihiro
8830f61caf Implement NXActionRegLoad
The OpenStack Neutron's of_interface code generates flows with
NXActionRegLoad.  It's not required but better to be able to
parse them.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 14:47:44 +09:00
IWASE Yusuke
efc859eebf test_parser: Fix ofp_multipart_type in OFPFlowStatsRequest
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:56 +09:00
IWASE Yusuke
5cb8f8ccc7 ofproto_v1_5_parser: Add missing field in OFPMeterFeaturesStats
"features" field is introduced in OpenFlow 1.5, but this field is
not defined in ofproto_v1_5_parser.py.

This patch adds this missing field.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:53 +09:00
IWASE Yusuke
a1fd26f89a ofproto_v1_5_parser: Fix unresolved structure references
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:48 +09:00
IWASE Yusuke
e24fd2fd79 test_parser: Add missing packet data for OFP15
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:38 +09:00
IWASE Yusuke
2ae4f884ab tox: Adapt to PyPy interpreter
Note: Though tests may not be enough, as far as running unit test,
this patch makes compatible with PyPy interpreter.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:46:35 +09:00
Minoru TAKAHASHI
4dc709d90d of12/3/4/5: fix to_jsondict of OFPActionSetField
Some fields missing in the JSON dict that to_jsondict of OFPActionSetField is returnd.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:35:13 +09:00
Jason Kölker
00c7d2918d protocols/bgp: Log socket creation error
Helpful to track down why the bgp server is stopping when the user
running ryu does not have CAP_NET_BIND_SERVICE.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:35:12 +09:00
FUJITA Tomonori
4f1a4db7a4 Ryu 3.30
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-02 09:27:53 +09:00
IWAMOTO Toshihiro
1076dfd3b4 Update conntrack test json and binary packets
Ovs has changed the definition of conntrack flags in commit
63bc9fb1c69fa81f3b30c2669d25962da3119d0f, and packet_data_generator3
now generates different test data.  Update the data and corresponding
json data accordingly.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:49:00 +09:00
IWAMOTO Toshihiro
135a1cb4cd test_parser: add conntrack NAT tests
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:38:38 +09:00
IWAMOTO Toshihiro
1d75182e9e packet_data_generator3: add a couple of conntrack packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:38:37 +09:00
IWAMOTO Toshihiro
9fe0126b93 Implement NXActionNAT
This action is for the conntrack Nicira extension.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:38:34 +09:00
Victor Orlikowski
28cb1d59d9 rest_router: Ensure that usage of icmp.dest_unreach and icmp.TimeExceeded complies with RFC 4884
When using the icmp.dest_unreach and icmp.TimeExceeded classes, we
should ensure that it is in compliance with RFC 4884.  As such, the
data_len parameter passed to the constructor of each should be
interpreted in 32 bit units.  Furthermore - any data that is passed in
must be zero padded to a 32 bit boundary.

The only sample application known to use either of these types is rest_router.
This patch corrects its use of these classes.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 09:00:46 +09:00
Victor Orlikowski
8f7d302fd5 packet: Better validate parameters to constructors better icmp
According to RFC 4884 (which supersedes RFC 792), the Destination
Unreachable and Time Exceeded ICMP message get a new “length” field.
This length field, for ICMPv4, is interpreted in 32 bit units.

In the constructor, we cannot validate that the length specified
matches the length of the data passed; the length may need to be
larger (in 32 bit units) in order to accommodate the data that is
actually being sent.  We *should*, however, ensure that the data_len
parameter passed fits into a single byte.

It may make sense to document the fact that the length is specified 32
bit units, for when users of the icmp class get a ValueError back
from these constructors.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 14:54:06 +09:00
FUJITA Tomonori
0b00bfb274 doc: remove obsolete OpenStack info
ofagent is obsolete. Ryu became the part of OVS agent.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 14:20:38 +09:00
Victor Orlikowski
0bfdd1e8fb bgp: Clean up syntax in services/protocols/bgp/operator/views/base.py to avoid SyntaxErrors
When byte-compiled, base.py in the bgp protocol service generates a large number of SyntaxErrors for me.
This patch cleans up the SyntaxErrors, while retaining the original (intended?) semantics.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 13:40:47 +09:00
Victor Orlikowski
e3d0721892 Reconnected event additions and cleanups
This patch adds ports to the EventDPReconnected in dpset, and adds an EventSwitchReconnected to the topology module.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 13:19:27 +09:00
Victor Orlikowski
14379f280b test: Yet another typo fix
This patch merely cleans up a typo.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 13:09:54 +09:00
Ygor Amaral
8a90e9a830 test: ImportError fix, error caused by unordered import Link
Signed-off-by: Ygor Amaral <ygor.amaral@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 12:50:44 +09:00
Chia-Lin Cho
648ac64fd6 topology: Make sure the last IP in the list is the newest IP.
In the wireless network, when host attaches AP, it will send many ARP
requests which Src IP were used before.  This causes the last IP in
the list may not be the newest one and we also cannot know which IP in
the list is the newest.

So this patch can solve it.

Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 12:46:48 +09:00
Victor Orlikowski
63f9502ea0 Message cleanup in ofproto_parser
Minor message text cleanup.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:56:37 +09:00
Victor Orlikowski
849a9e3a4d Typo cleanup
Minor message text cleanup.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:56:15 +09:00
Victor Orlikowski
9386be6ebc Typo fixes in lib/packet/bgp.py
A couple of minor typo fixes.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:55:05 +09:00
Jan Keler
c1c78269ac Fix: "AddrFormatError: address '...' is not an EUIv48"
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:35:28 +09:00
Jason Kölker
73416eacb1 packet/bgp: Gaurd against extra data in the buffer
While attempting to peer with a vendor switch, parsing its
BGPOptParamCapabilityGracefulRestart excepted due to the length of the
identifier tuples not being a multiple of 4 octets.

It appears that this might be common as other implementations also stop
when the buffer is < 4.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 22:19:05 +09:00
Jason Kölker
a71c2a9e1b protocols/ovsdb: Forcably kill the main_thread
Should allow AppManager.run_apps to terminate.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 22:18:51 +09:00
Jason Kölker
636de20197 protocols/ovsdb: Handle accept() errors
An exception during server.accept() should not cause the server thread
to terminate. Log the exception and continue instead.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 22:18:45 +09:00
Jason Kölker
df065f5bb1 protocols/ovsdb: Handle disconnects gracefully
If the client closes the connection during setup, the socket's FD is
closed out automatically, ignore the errors while forcably shuting down
the socket.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 22:18:40 +09:00
FUJITA Tomonori
5d04752421 test: disable rpc unittest with large file for now
disable the rpc unittest with large file for now because it doesn't
work with eventlet 0.18 and later. Ryu doesn't have any use cases like
this test but should be investigated.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 22:00:19 +09:00
Minoru TAKAHASHI
75fe76c4a5 ofproto/NXAction: Fix NXActionUnknown parsing
Exception error occurs when NXActionUnknown parsing,
because _subtype(NXActionUnknown class member variable) is not defined.

This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-21 23:01:17 +09:00
Minoru TAKAHASHI
97ebd2fc56 of14_parser: unify OFPActionExperimenter implementation
Currently, there is different OFPActionExperimenter implementation of between of_parser_v14 and v13/5.
Because the implementation of v13/5 is better than v14, this patch fixes to of_parser_v14 for unification the implementation.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-21 23:01:16 +09:00
IWASE Yusuke
dbbd05f7bb test_ofctl: Update json representations
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:19 +09:00
IWASE Yusuke
001a6956f2 test_ofctl_utils: Add unit tests for ofctl_utils.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:18 +09:00
IWASE Yusuke
19e49c861f lib/ofctl: Add utility library for ofctl_v1_*.py
This patch enables ofctl_v1_*.py to use the reserved OpenFlow
numbers (e.g. port numbering such as "OFPP_CONTROLLER") in the
request and reply parameters of ofctl_rest.py.

Example:
  - When adding a flow entry:
    $ curl -X POST -d '{
        "dpid": 1,
        "actions":[
            {
                "type": "OUTPUT",
                "port": "CONTROLLER"
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

  - When getting flows stats:
    $ curl -X GET http://localhost:8080/stats/flow/1
    {
      "1": [
        {
          ...
          "actions": [
            "OUTPUT:CONTROLLER"
          ],
          ...
        }
      ]
    }

Suggested-by: Sergio Andres Rivera Polanco <sergiorivera88@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:12 +09:00
IWASE Yusuke
9571fde7dd doc: Add Nicira Extension Structures references
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:21 +09:00
IWASE Yusuke
a2d71f3198 doc: ofproto_ref: Update supported actions/matches list
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:19 +09:00
IWASE Yusuke
6d2b1c5035 packet_data: regen
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:10 +09:00
IWASE Yusuke
de2602bac7 test_parser: Add expected json representations
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:08 +09:00
IWASE Yusuke
aa3a2d5949 packet_data_generator2: Add some OFP13/15 messages
Add the following OFP13/15 Messages.

 - OFP13/15 Handshake
     Implemented: OFPT_FEATURES_REPLY
     TODO:        OFPT_FEATURES_REQUEST
 - OFP13/15 Switch Configuration Messages
     Implemented: OFPT_SET_CONFIG, OFPT_GET_CONFIG_REPLY
     TODO:        OFPT_GET_CONFIG_REQUEST

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:07 +09:00
IWASE Yusuke
7d626a55b2 lib/ofctl_v1_*: Confirm hw_addr is str in mod_port_behavior
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:51:55 +09:00
IWASE Yusuke
a40efc3a45 test_ofctl: Compare sent messages in json representation
Currently, test_ofctl compares the sent messages in binary, so it
is difficult to figure out the differences of the sent messages
and the expected messages.

This patch fixes to compare the sent messages in json representation
in order to make easy to debug.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:51:47 +09:00
Chia-Lin Cho
beb3353e39 Remove old link when link updates
Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:22:06 +09:00
Minoru TAKAHASHI
ecfd21e5f9 fixes for mutable default arguments
modify the default argument from list to None,
because default value {}/[] as argument is dangerous.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:03:57 +09:00
Victor Orlikowski
7826290ba6 Cleanup variable name for clarity
Just cleaning up where the patch you previously applied for me is the original version, and not the corrected version.
Thanks for applying the original!

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-08 22:05:35 +09:00
FUJITA Tomonori
2250171098 cap oslo.config version only in python2.6
https://bugs.launchpad.net/neutron/+bug/1531837

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
2016-01-08 21:07:35 +09:00
FUJITA Tomonori
cd779e2c55 Ryu 3.29
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-04 09:50:45 +09:00
Victor Orlikowski
27ca64c726 Generate new datapath event for switch connecting multiple times
If a switch connects multiple times, there are a number of potential
causes.  A potential cause is that the OF agent on the switch crashed,
and was re-launched - but, because of the crash, Ryu believes that the
switch is still connected.

Should this occur, the newly re-launched OF agent on the switch often
clears the flow tables on the switch, before connecting to the
controller.  When the switch agent re-connects to Ryu, the state of
the flow tables on the switch may not match what Ryu expects.

As a result, I suggest generating a new event: EventDPReconnected
Extending the existing EventDP would change semantics, and would break
apps others have written that rely on those semantics.

Applications registering a handler for EventDPReconnected would then
be able to choose whether to wipe the flow tables on the switch and
re-send flow rules, or whether to probe the switch with a flow-stats
message, and re-send rules more carefully.

Adding EventDPReconnected is the best solution to not break existing
apps, and to implement the following portion of section 6.3.3
(“Connection Interruption”) of the OpenFlow 1.3.4 specification, for
switches that have connected multiple times:

" When the OpenFlow channel is reestablished, the flow entries present
in the flow tables at that time are preserved and normal OpenFlow
operation resumes. If desired, the controller has then the option of
reading all flow entries with a flow-stats request (see 7.3.5.2), to
re-synchronise its state with the switch state. Alternatively, the
controller then has the option of deleting all flow entries with a
flow-mod request (see 6.4), to start from a clean state on the switch.
"

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-30 14:21:01 +09:00
Victor Orlikowski
6945ad3ef1 Fix handling of state transition to config mode
We have found, in production usage, a race condition in the transition to config mode.

If a sufficient number of events is being received, the reply to the FeaturesRequest may be received before the datapath is able to move into CONFIG_DISPATCHER state. As a result, the EventOFPSwitchFeatures handler may never fire (because the reply is received before the datapath has changed state).

This patch also includes a minor typo fix.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-30 14:18:39 +09:00
Victor Orlikowski
46f4ced165 Clean up for stability patch submitted previously
While continuing to run our application with the stability patch I submitted earlier, I discovered additional failure modes for some of our hardware switches were causing unexpected exceptions.

This revision better handles these situations.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-30 14:18:39 +09:00
IWAMOTO Toshihiro
c085c0d40e Ensure to terminate threads where RyuApp.start() gives a thread object
Otherwise, AppManager.run_apps fails to terminate.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
Minoru TAKAHASHI
4feded18f3 ofctl_v1/2/3: Some improvements
* modify from "flow" to "meter" the argument of meter_mod
* modify the default argument from {} to None of the following methods
  because default value []/{} as argument is dangerous.
  - get_flow_stats
  - get_aggregate_flow_stats
  - mod_meter_entry
* fix some log messages for better readability

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
Minoru TAKAHASHI
3e86414b02 of14: Add action experimenter to flow stats reply unit test
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
IWASE Yusuke
541dc65026 test_tcp: Update test cases for tcp option
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
IWASE Yusuke
9521e46181 lib/packet/tcp: Parse TCP Option field
Suggested-by: Ramana Reddy <gtvrreddy@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:52 +09:00
ISHIDA Wataru
d9ecfccdc8 bgp: fix handling unknown and unsupported transitive path
attributes

we must forward optional transitive path attributes.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:52 +09:00
IWASE Yusuke
fede089e93 ofp_handler: Remove sending SET_CONFIG message
Because Ryu always sends SET_CONFIG message when a datapath connecting,
the switch configurations of user applications will be overwritten by
the default values of Ryu when the datapath re-connecting.

This patch removes sending SET_CONFIG message from ofp_handler and
avoids this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 14:13:16 +09:00
IWASE Yusuke
d736b830b9 lib/ofctl: Add test cases for ofctl_v1_0
TODO: Add test cases for the other messages after adding test cases
for ofproto/test_parser.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
83d529a979 lib/ofctl: Add test cases for ofctl_v1_2
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
77f8628574 lib/ofctl: Add test cases for ofctl_v1_3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
1025d18297 lib/ofctl: Implement unit test for sending messages
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
41e81c500a lib/ofctl: Rename unit test for action/match
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
ed6adb6d83 lib/ofctl: Confirm UTF-8 in binary fields
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
366044d724 ofproto_v1_[23]_parser: Add default arguments in OFPQueueProp
When loading OFPQueueGetConfigReply message from json dict,
ofproto_parser can not set the property field in OFPQueueProp,
because __init__() of OFPQueueProp sub-classes do not pass any
argument to its own super-class.
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
d58d93f2db test_parser: Add some expected json representations
This patch adds expected json representations for:
 - ofp_group_stats_request
 - fp_group_stats_reply

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
9418dc530d packet_data: Regen
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
d0c9ddd659 packet_data_generator: Add ofp_group_stats messages for OF1.2
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
IWASE Yusuke
6e4b2b67a3 ofproto_v1_[2345]_parser: Set default length field
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-22 13:50:27 +09:00
FUJITA Tomonori
1ed92b25b5 avoid oslo.config 3.1.0 and later for python2.6 support
oslo.config v3.1.0 dropped python2.6 support:

9470f19eac

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-08 21:48:38 +09:00
IWASE Yusuke
106e88f77a test_controller: Add unit test for _recv_loop()
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-08 21:24:50 +09:00
IWASE Yusuke
0a223481dd controller: Split received message buffer
When Ryu getting multiple OpenFlow messages in a single packet,
_recv_loop() can pass the messages data including the subsequent
OpenFlow message binary data to ofproto_parser.msg().
If the received OpenFlow message containing a binary data field
(e.g. Echo-Reply, Packet-In), the parser may compose messages
class with the subsequent messages data into the data field.

This patch splits the received message buffer by the recieved
OpenFlow message lenght and passes it to the parser.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-08 21:24:49 +09:00
Victor J. Orlikowski
6ca70939a4 Fix a stability issue relating to switch disconnection/re-connection events.
If a switch gets disconnected via a network interruption on the control plane (or a similar event),
the datapath associated with that switch might not be properly cleaned up.

At the same time, the socket associated with that datapath can get leaked.
This ultimately results in file descriptor resource exhaustion for Ryu,
as a socket had the potential to be leaked on each reconnect.

Also, a small typo was corrected in a method name in DPSet.
2015-12-02 10:27:07 -05:00
FUJITA Tomonori
f449488e6a Ryu 3.28
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-02 09:04:18 +09:00
IWAMOTO Toshihiro
7a9b1be5d6 test_parser: add conntrack tests
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 16:14:00 +09:00
IWAMOTO Toshihiro
877ed2804a packet_data_generator3: add a couple of conntrack packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 16:13:59 +09:00
IWAMOTO Toshihiro
0599edf753 Implement NXActionCT and related ct_* matches
These are a Nicira extension for conntrack.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 16:13:58 +09:00
Satoshi KOBAYASHI
89e1bcd577 tox: disable wheel cache
Recently, installed packages are cached by Wheel. It is serious when the package is using 2to3 with setuptools (use_2to3) for adapting python3. Because Wheel is caching the contents of translated. If the contents of translated are cached, it can't work properly in python2

Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:37:14 +09:00
Satoshi KOBAYASHI
7615458870 python3: implicit relative import was deprecated
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:51 +09:00
Satoshi KOBAYASHI
d6a16862ac python3: itertools.ifilter() doesn't exist
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:51 +09:00
Satoshi KOBAYASHI
718e934184 python3: iter#next() doesn't exist
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:51 +09:00
Satoshi KOBAYASHI
6c85fc9c70 python3: <function>#func_name is renamed to __name__
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:51 +09:00
Satoshi KOBAYASHI
3a0ea9e2bb python3: import __future__ for just in case
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:51 +09:00
Satoshi KOBAYASHI
466cf26d92 python3: StandardError doesn't exist
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:36:50 +09:00
Minoru TAKAHASHI
6133901bb5 ofctl_v1_3: Fix unsuitable error log in mod_meter_entry()
When omit the parameter of "flags" in mod_meter_entry(), following error log will be shown.

  example)

    1.use mod_meter_entry() with omitting the parameter of "flags".

   curl -X POST -d '{
   "dpid": 1,
   "meter_id": 1
   }' http://localhost:8080/stats/meterentry/delete

    2.following error log will be shown.

    Unknown flags: 0

This patch fixes the problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:35:34 +09:00
FUJITA Tomonori
0aefad7048 Ryu 3.27
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-03 12:53:30 +09:00
Toshiki Tsuboi
5b81c634be bgp: fix of sending "Start-of-RIB" and "End-of-RIB" in Enhanced Route-Refresh
According to RFC 7313 [Enhanced Route Refresh Capability for BGP-4], Ryu bgps needs to send "Start-of-RIB" before it advertises the Adj-RIB-Out. And then, Ryu bgps needs to send "End-of-RIB" after it advertises the Adj-RIB-Out.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 17:43:58 +09:00
Minoru TAKAHASHI
30e2eb67c4 doc/app/ofctl_rest: Add description for OFPTableStats message
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:41 +09:00
Minoru TAKAHASHI
58cb365755 doc/app/ofctl_rest: Add description for OFPQueueGetConfig message
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:41 +09:00
Minoru TAKAHASHI
ec55ca5756 doc/app/ofctl_rest: Add description for OFPTableFeaturesStats message
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:41 +09:00
Minoru TAKAHASHI
6518654a1b ofctl_rest: support OFPQueueGetConfig Message
this patch makes ofctl_rest enable use of OFPQueueGetConfig message.

Get queues config:

  usage)

    URI:    /stats/queueconfig/<dpid>/<port>
    method: GET

  e.g.)

    $ curl -X GET http://localhost:8080/stats/queueconfig/1/1
    {
      "1": [
        {
          "port": 1,
          "queues": [
            {
              "properties": [
                {
                  "property": "MIN_RATE",
                  "rate": 80
                }
              ],
              "port": 0,
              "queue_id": 1
            },
            {
              "properties": [
                {
                  "property": "MAX_RATE",
                  "rate": 120
                }
              ],
              "port": 2,
              "queue_id": 2
            },
            {
              "properties": [
                {
                  "property": "EXPERIMENTER",
                  "data": [],
                  "experimenter": 999
                }
              ],
              "port": 3,
              "queue_id": 3
            }
          ]
        }
      ]
    }

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:41 +09:00
Minoru TAKAHASHI
26e8efb246 ofctl_rest: support OFPTableFeaturesStats Message
this patch makes ofctl_rest enable use of OFPTableFeaturesStats message.

Get table features:

  usage)

    URI:    /stats/tablefeatures/<dpid>
    method: GET

  e.g.)

    $ curl -X GET http://localhost:8080/stats/tablefeatures/1
    {
      "1": [
        {
          "metadata_write": 18446744073709552000,
          "config": 0,
          "table_id": 0,
          "metadata_match": 18446744073709552000,
          "max_entries": 4096,
          "properties": [
            {
              "type": "INSTRUCTIONS",
              "instruction_ids": [
               {
               "len": 4,
               "type": 1
               },
	       ....
              ]
            },
            ...
          ],
          "name": "table_0"
        },
        {
          "metadata_write": 18446744073709552000,
          "config": 0,
          "table_id": 1,
          "metadata_match": 18446744073709552000,
          "max_entries": 4096,
          "properties": [
            {
              "type": "INSTRUCTIONS",
              "instruction_ids": [
               {
               "len": 4,
               "type": 1
               },
               ....
              ]
            },
            ...
          ],
          "name": "table_1"
        },
        ...
      ]
    }

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:40 +09:00
Minoru TAKAHASHI
9a534b46a6 ofctl_rest: support OFPTableStats Message
this patch makes ofctl_rest enable use of OFPTableStats message.

Get table stats:

  usage)

    URI:    /stats/table/<dpid>
    method: GET

  e.g.)

    $ curl -X GET http://localhost:8080/stats/table/1

More infomation about this feature is described in the following URL.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#get-table-stats

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:44:40 +09:00
Toshiki Tsuboi
f4f24469da vrrp: fix param of virtual_ip_address for rpc_api
It looks VRRPManager can't handle virtual_ip_address properly as bellow.

$ sudo ryu-manager ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.manager
instantiating app ryu.services.protocols.vrrp.manager of VRRPManager
instantiating app ryu.services.protocols.vrrp.rpc_manager.py of RpcVRRPManager
instantiating app None of VRRPInterfaceMonitorNetworkDevice
instantiating app None of VRRPRouterV3
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: None -> Initialize
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: Initialize -> Backup
hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 276, in _event_loop
    handler(ev)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 234, in master_down_handler
    self.state_impl.master_down(ev)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 613, in master_down
    self._master_down()
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 579, in _master_down
    vrrp_router.send_advertisement()
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 219, in send_advertisement
    packet_.serialize()
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py", line 74, in serialize
    data = p.serialize(self.data, prev)
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 394, in serialize
    return self.serialize_static(self, prev)
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 625, in serialize_static
    *[conv(x) for x in vrrp_.ip_addresses])
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/addrconv.py", line 27, in text_to_bin
    return self._addr(text, **self._addr_kwargs).packed
  File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 314, in __init__
    % (addr, self._module.version))
AddrFormatError: base address '.' is not IPv4

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:33:38 +09:00
IWASE Yusuke
7af6e28ea3 tester: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:32:03 +09:00
IWASE Yusuke
ce6e5ddd62 tester: Add test cases for OpenFlow1.0
Note: OpenFlow 1.0 does not mention IPv6, but some implemetation
of the switch (e.g. Open vSwitch) can deal with IPv6 header field
in some OpenFlow1.0 match/actions.
So this patch includes tester.py to test match/actions with IPv6.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:32:03 +09:00
IWASE Yusuke
74d5de7803 tester: Support to test OpenFlow1.0 switch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:32:02 +09:00
IWASE Yusuke
7c7fb56ad6 packet_data: Fix wildcarded match value in OF1.0
OpenFlow Spec 1.0 does not define clearly the match value when the
corresponding wildcard flags are set, but OpenFlow 1.3.2 mandate
that masked value must be 0-bits in match.
This patch fixes wildcarded match value (dl_src) into 0-bits.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:32:02 +09:00
IWASE Yusuke
d6b7dd5c40 of10: Human readable address field in json Match/Action
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-28 14:32:02 +09:00
IWAMOTO Toshihiro
a9876bf5c4 Try logging.config.dictConfig before in-tree version
Python bundles dictConfig since 2.7.  Try the bundled version first
as the version included in Ryu will not work with python3.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-22 05:50:56 +09:00
IWAMOTO Toshihiro
ff66183243 Python3: use int instead of long
Using int for long int should not cause issues since python2.4.
c.f. https://docs.python.org/2.6/whatsnew/2.4.html#pep-237-unifying-long-integers-and-integers

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-22 05:50:55 +09:00
IWAMOTO Toshihiro
dc361d1a3b Python3: complete previous removal of types usage
Fix the leftover of previos types.*Type removal.  Also, as python3
doesn't have long type, use six.integer_types instead.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-22 05:50:54 +09:00
IWAMOTO Toshihiro
d5bb8d4603 Python3: use dict instead of types.DictType
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-22 05:50:53 +09:00
IWASE Yusuke
604b16c565 doc: Change Sphinx html_theme to sphinx_rtd_theme
Currently, Ryu-Documentation page adopts 'haiku' for Sphinx
html_theme, but 'haiku' does not have page-index and no sidebar.
This patch changes Sphinx html_theme to 'sphinx_rtd_theme', which
outputs page-index for each page and a mobile-friendly sphinx
theme that was made for readthedocs.org.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-22 05:45:50 +09:00
Toshiki Tsuboi
e22f86f417 bgp: support of CAP_ENHANCED_REFRESH for vpnv4
Bgpspeaker cannot handle CAP_ENHANCED_REFRESH in BGP OPEN Messages.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-15 21:58:57 +09:00
IWASE Yusuke
e4f4704b73 tester: Use six.binary_type for binary data comparison
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:27 +09:00
IWASE Yusuke
e4333e3286 tester: Enable to sort instructions instance by type
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:24 +09:00
IWASE Yusuke
72a5b442b1 tester: Remove too broad exception handling
Because too broad exception handling obscures errors while testing,
it makes difficult to detect the bugs in tester.py or the test
pattern files.
This patch removes an except statement and avoid this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:24 +09:00
IWASE Yusuke
c9783734b4 tester: Strict string argument encoding in Python3
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:24 +09:00
IWASE Yusuke
2c92a0a0eb tester: Adapt to Python3 dictview
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Minoru TAKAHASHI
fb9d3cdb81 packet_data: Regen
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Minoru TAKAHASHI
e43796062a test_parser: Add expected json for OFP13/15 Messages
Add expected json for the following messages.

 - OFP13/15 Symmetric Messages
 - OFP13/15 Asynchronous Messages
 - OFP15 Multipart Messages
 - OFP13/15 TableMod Message
 - OFP13 PortMod Message
 - OFP13/15 MeterMod Message

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Minoru TAKAHASHI
44e7069704 packet_data_generator2: Add OFP13/15 Messages
Add the following OFP13/15 Messages.

 - OFP13/15 Symmetric Messages
 - OFP13/15 Asynchronous Messages
 - OFP15 Multipart Messages
 - OFP15 Packet-Out Message
 - OFP15 Barrier Message
 - OFP15 Role Request Message
 - OFP15 Set Asynchronous Configuration Message
 - OFP13/15 TableMod message
 - OFP13 PortMod message
 - OFP13/15 MeterMod message

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Minoru TAKAHASHI
3f0fdbc542 packet_data_generator2: Sort by OF1.5 index order
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Minoru TAKAHASHI
55ed988834 packet_data_generator2: Fix to use struct eth_addr
In accordance with the upgrade of the ofputil in OVS libraries,
this patch fixes to use struct eth_addr.

FYI: The appropriate commit on OVS GitHub
74ff3298c8

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 22:10:23 +09:00
Yusuke Iwase
b4c3ef03a4 doc: Add openflow api reference for of1.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
4195d3863a ofproto_v1_0_parser: Add comments for OF1.0 protocol
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
4242dcff1a doc: Handle ERROR of unexpected indentation
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
e7ce316918 test_ip: Add tests for IPv4-int conversion
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
9e542b8851 of10: Add __contains__ method into OFPMatch
To support query whether a match instance contains a specific field,
This patch adds __contains__ method into OFPMatch.

Example:
  >>> if 'nw_src' in match:
  ...     print match['nw_src']
  ...
  '192.168.0.1'

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
85bb012896 test_parser_v10: Fix wildcards param for unit test
If all field is specified, wildcards field should be lower than
(NW_DST_WILDCARD << 14 | NW_SRC_WILDCARD << 8), but the given
value of this test case is larger than this value.
So some test cases which check the wildcards field raise errors.
This patch fixes the wildcards parameter to the possible value.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:38 +09:00
Yusuke Iwase
9663fbe563 of10: Support human readable MAC/IPv4 address in OFPMatch
In OF1.0, OFPMatch is required to specify MAC address as a binary
type value and to specify IPv4 Address as an int type value.
This behavior is differ from that in OF1.2+.
This patch makes OFPMatch in OF1.0 enable to support human readable
representation of MAC/IPv4 address like OF1.2+ API.

The current API in OF1.0:
  >>> match = parser.OFPMatch(dl_src=b'\x01\x02\x03\x04\x05\x06',
  ...                         nw_src=167772163)
  >>> match.dl_src
  '\x01\x02\x03\x04\x05\x06'
  >>> match.nw_src
  167772163

The introduced API (the same as OF1.2+ API):
  >>> match = parser.OFPMatch(dl_dst='aa:bb:cc:dd:ee:ff',
  ...                         nw_dst='192.168.0.1')
  >>> match['dl_dst']
  'aa:bb:cc:dd:ee:ff'
  >>> match['nw_dst']
  '192.168.0.1'

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-11 21:51:37 +09:00
FUJITA Tomonori
c0723eb0a6 Ryu 3.26
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-02 04:25:01 +09:00
Yusuke Iwase
b1c1adf79a switch/tester: Add sleep interval for each test case
Open vSwitch, which installed with the kernel module, has a cache in
the kernel for the flow table and the cached flow entries have a
hard timeout of 5 seconds.
tester.py attempts to confirm its flow modifications with a barrier
request, but Open vSwitch sends a barrier reply back regardless of
the the state of the cached entries in the kernel module.
So in some cases, Open vSwtich needs the interval between each test
case.
This patch adds an option for setting interval for the workaround.

Note: With a zero seconds interval, the whole test suite runs in
20-30 minutes, but with a 10 seconds interval between each test,
the entire suite takes 3-4 hours.

Reported-by: Alan Deikman <alan.deikman@znyx.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-01 13:27:45 +09:00
Yusuke Iwase
40acc4bc82 ofproto_v1_[45]_parser: Add parser() for OFPRequestForward
OFPT_REQUESTFORWARD is defined as Asynchronous Message which sent
from OF-Switch to Controller, but currently, OFPRequestForward class
does not have parser() method.
This patch adds parser() method into OFPRequestForward class and
OFPGroupMod/OFPMeterMod classes which forwarded by OFPRequestForward
message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-30 23:06:59 +09:00
FUJITA Tomonori
927cda4392 remove old Ryu OpenStack plugin stuff
The plugin that uses these was removed from OpenStack long ago.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-28 22:23:21 +09:00
FUJITA Tomonori
50ad776a32 packet: lldp: python3 fix
iterator doesn't has next method.

Reported-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Takeshi <a86487817@gmail.com>
2015-09-28 22:11:06 +09:00
FUJITA Tomonori
571f6a1c5a bgp: support disabling listening socket
Setting bgp_server_port to 0 disables listening socket

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-23 13:14:32 +09:00
FUJITA Tomonori
448ebe99e9 bgp: python3 fixes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-21 21:18:40 +09:00
Yusuke Iwase
95ae3c7211 test_parser_ofpmatch: Add tests for Experimenter OXMs
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:32:18 +09:00
Yusuke Iwase
be5b00996d OXM/OXS: Enable to sort Experimenter oxm_type/oxs_type in Python3
The representation of oxm_type/oxs_type is an int type value if
OXM/OXS in OpenFlowBasic class, but a tuple type value if in
Experimenter class.
So, Python3 may fail to sort a list of OXM/OXS fields by using
oxm_type/oxs_type.
This patch adds 'key' parameter into sort() method and enables to
sort a list which contains both OpenFlowBasic and Experimenter.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:32:09 +09:00
Yusuke Iwase
1d1777c891 test_parser_ofpmatch: Add test cases for OF1.4 and OF1.5
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:31:59 +09:00
Yusuke Iwase
033d99474a .travis.yml: Suppress the output of unit tests
Because Travis-CI has a limit of the log file to 4MB, this patch
suppress the output of unit tests by setting NOSE_VERBOSE in tox.ini.
tox.ini does not effect when running run_tests.sh locally,
so please run run_tests.sh, if the full log messages are needed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:31:44 +09:00
Yusuke Iwase
4ada0bbd9c ofproto: Sort out the NX OXMs definition
Because the Nicira Experimenter OXMs are independent of the OpenFlow
version, this patch separates the NX OXMs definitions into nx_match.py
and enable to use the NX OXM in all OpenFlow 1.2+.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:30:29 +09:00
Yusuke Iwase
81208354e9 ofproto: Refine module import
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:30:27 +09:00
Yusuke Iwase
5116d1f84f ofproto_v1_[45]_parser: Remove unused OFPMatchField
OFPMatchField and its subclasses are parser classes for old API of
OFPMatch, but in OF1.4+, OFPMatch drops old API supports.
This patch removes these unused classes from ofproto_v1_[45]_parser.py

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:29:59 +09:00
Minoru TAKAHASHI
7872ba275c doc/ofproto_v1_2_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
2079d06d6f doc/ofproto_v1_3_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
950a506494 doc/ofproto_v1_4_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
c36bafea26 doc/ofproto_v1_5_ref: Add description for Port Structures and Controller Status Structure
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Steffen Gebert
c638c345dd Examples contain invalid MAC addresses
The documentation for `OFPActionSetField()` contains the
following example:

    set_field = OFPActionSetField(eth_src="00:00:00:00:00")

However, this MAC address lacks one byte. Thus add it.
2015-09-17 12:03:22 +02:00
Yusuke Iwase
388adf152c ofproto_v1_0_parser: Add __getitem__ method into OFPMatch
Currently, ofproto_v1_0_parser does not support query with a match
field name like ofproto_v1_[2345]_parser support.
This patch adds __getitem__ method in order to get the match value
witch a match field name.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:02:17 +09:00
Yusuke Iwase
5cda019b3c test_parser_v10: Add test case for __getitem__ of OFPMatch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:02:16 +09:00
Minoru TAKAHASHI
b874ae839d doc/app/ofctl_rest: Add command examples for WRITE/CLEAR_ACTIONS
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:01:54 +09:00
IWAMOTO Toshihiro
992bf7318d Uncap pbr version
This reverts commit 9414322f307fe607f7fefb8611871bbf810b5ee4,
as the workaround for readthedocs seems to be no longer necessary.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:01:53 +09:00
Chia-Lin Cho
2b527f67ef topology: Fixed conditional statement
_is_edge_port(port) in switches.py will return `False` if the port belongs to link.

Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:00:46 +09:00
Yusuke Iwase
4c6b03ab02 ofproto_v1_5: Add OFPBAC_BAD_METER
OpenFlow 1.5.1 adds new error OFPBAC_BAD_METER for bad meter in
flow-mod (EXT-530).

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 16:59:36 +09:00
ISHIDA Wataru
66eeb5b1fe bgp: enable nexthop_self for locally generated routes
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:32:17 +09:00
Minoru TAKAHASHI
969b4b6837 test_ofctl: improving readability
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Minoru TAKAHASHI
dc2d5a90b7 test_ofctl: Add unit test for OFPIT_[WRITE/CLEAR]_ACTIONS
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Minoru TAKAHASHI
91af6a5ada ofctl_v1_[23]: Add support for OFPIT_[WRITE/CLEAR]_ACTIONS
This patch makes ofctl_rest enable setting instruction type of OFPIT_WRITE/CLEAR_ACTIONS.

  e.g.)

  $ curl -X POST -d '{
        "dpid": 1,
        "cookie": 1,
        "cookie_mask": 1,
        "table_id": 0,
        "idle_timeout": 30,
        "hard_timeout": 30,
        "priority": 11111,
        "flags": 1,
        "match":{
            "in_port":1
        },
        "actions":[
            {
                "type":"WRITE_ACTIONS",
                "actions":[
                    {
                        "type":"POP_VLAN",
                    },
                    {
                        "type":"OUTPUT",
                        "port": 2
                    }
                    ]
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

  $ curl -X POST -d '{
        "dpid": 1,
        "cookie": 1,
        "cookie_mask": 1,
        "table_id": 0,
        "idle_timeout": 30,
        "hard_timeout": 30,
        "priority": 11111,
        "flags": 1,
        "match":{
            "in_port":1
        },
        "actions":[
            {
                "type":"CLEAR_ACTIONS"
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Yusuke Iwase
b6e280172a ofp_handler: Output human readable error msg ev log
Currently, the error message event log which is output by ofp_handler.py
is difficult to understand what is wrong in the previous OpenFlow request
message.
This patch improves the readability of this output to find out errors.

*** Output Example ***
EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0xecc7f07b
 `-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9, data=b'\x04\x0e\x00\x58\xec\xc7\xf0\x7b\x00\x0
0\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x2b\x67\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0
0\x01\x00\x0c\x80\x00\x18\x04\xc0\xa8\x00\x01\x00\x00\x00\x00')
 |-- type: OFPET_BAD_MATCH(4)
 |-- code: OFPBMC_BAD_PREREQ(9)
 `-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0xecc7f07b
     `-- msg_type: OFPT_FLOW_MOD(14)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
f5932480c5 ofproto_parser: Unify str representation of MsgBase
This patch unifies str representation of MsgBase into comma-separated
array of 'key=value' style.

before:
  version: 0x1 msg_type 0x0 xid 0x660a4ade OFPHello()

after:
  version=0x1,msg_type=0x0,msg_len=0x8,xid=0x660a4ade,OFPHello()

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
23b2fc4b41 utils: Add binary_str() method to print binary data
Because repr() is not enough to escape ascii code or control code,
MsgBase.__str__() may collapse representation with binary data.
This patch add binary_str() in order to convert binary data into a
sequence of '\x00' style string.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
27befc18fa utils: Unify output str format of hex_array()
This patch simplifies hex_array() and unifies its output into
'0x%02x' format.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Minoru TAKAHASHI
97906ee740 doc: Add some JSON examples to openflow api reference for of1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
62a53a548d test_parser: Add expected json outputs for OF1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
5b0106eb45 doc: Add openflow api reference for of1.5
Update OpenFlow API document.
- add OpenFlow 1.5 API Reference
- update OpenFlow API Reference index for OF1.5

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
182e2e7067 test_parser: Add test case for OFP15 table_features_reply
TODO: Because Open vSwitch (lib/ofp-util) does not support Egress
Tables [EXT-306] yet, re-generate the packet data by using
packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:42 +09:00
FUJITA Tomonori
8726f8b0bf Ryu 3.25
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-04 08:20:05 +09:00
FUJITA Tomonori
396c32d4aa packet: dhcp should set _MIN_LEN
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:47:35 +09:00
FUJITA Tomonori
e47c5bf16a packet: udp should detect dhcp
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:35:02 +09:00
Minoru TAKAHASHI
22387e09e4 ofctl_v1_[23]: Fix the output result of get_flow_stats()
Add flows OFPIT_APPLY_ACTIONS and OFPIT_WRITE_ACTIONS and
OFPIT_CLEAR_ACTIONS as the type of instructions, respectively.
Then, the output results of get_flow_stats() are the same.
This patch fix this problem.

before applying this patch:

 * case OFPIT_APPLY_ACTIONS and OFPIT_WRITE_ACTIONS

{
    "1": [
        {
            "actions": [
                "OUTPUT:2",
                "OUTPUT:3"
            ],
        ...
        }
    ]
}

 * case OFPIT_CLEAR_ACTIONS

{
    "1": [
        {
            "actions": [],
        ...
        }
    ]
}

after apply this patch:

 * case OFPIT_APPLY_ACTIONS

{
    "1": [
        {
            "actions": [
                "OUTPUT:2",
                "OUTPUT:3"
            ],
        ...
        }
    ]
}

 * case OFPIT_WRITE_ACTIONS

{
    "1": [
        {
            "actions": [
                {
                    "WRITE_ACTIONS": [
                        "OUTPUT:4",
                        "OUTPUT:5"
                    ]
                }
            ],
        ...
        }
    ]
}

 * case OFPIT_CLEAR_ACTIONS

{
    "1": [
        {
            "actions": [
                "CLEAR_ACTIONS"
            ],
        ...
        }
    ]
}

Reported-by: Liu, Weijie <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:26:57 +09:00
Yusuke Iwase
2701fa129f ofctl_v1_[23]: Convert masked match value into str
Currently, ofctl_v1_[23].py always converts metadata field into str
type for display, but does not convert pbb_isid and tunnel_id fields
even if these fields are masked.
So ofctl_v1_3.py fails to convert masked pbb_isid and tunnel_id fields.

This patch fixes to convert masked match field into str type and not
to convert non-masked field.
These changes will improve maintainability when ofctl_v1_*.py will
support new match fields.

Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:21:51 +09:00
Fadi Moukayed
9bca06c31c packet/igmp: Python 3: truncate IGMP timer fields to integers before packing
This patch adds explicit integer conversions to the IGMP timer
fields. This is necessary because Python 3's pack(...) does not
automatically coerce floating-point values to integers (Python 3
actually throws a struct.error on struct.pack('B', 1.0)).

This fixes IgmpQuerier._send_query and IgmpSnooper._do_query under
Python 3, and possibly other functions that pass/assign floats to the
`maxresp' attribute.

Signed-off-by: Fadi Moukayed <smfadi@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:17:30 +09:00
Yusuke Iwase
7028704b3f doc: ofctl_rest: Add table of contents
This patch adds a table of contents into the ofctl_rest API
reference in order to improve its readability.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:04:38 +09:00
FUJITA Tomonori
08edfa067e README.rst: add OF 1.5 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-25 04:55:43 +09:00
ISHIDA Wataru
2a4423fda3 bgp: Added support to indicate the next hop IP address for the BGP module
If the path has a next hop value set, it should be used in the BGP
Update message first.  This changes to logic to use the check for the
next hop in the order prefix/path->peer config->speaker config.  This
will allow for sending the nexthop as part of the add_prefix message and
allow for overiding the nexthop of the peer if one is set.

Based-on: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:37:27 +09:00
FUJITA Tomonori
1a9008b73e bgp: add neighbor_state_get method
Can be used to get the state of peer(s).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:23:44 +09:00
Takeshi
0d405de657 Remove hosts from edge port when link added
Host could be added into edge port if host packet arrived before lldp
packet.

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:04:09 +09:00
Minoru TAKAHASHI
65695e47a6 ofproto_v1_5_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00
Minoru TAKAHASHI
d24b96c40f ofproto_v1_4_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00
Minoru TAKAHASHI
51dc621fcf ofproto_v1_3_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00
Minoru TAKAHASHI
3f005ea5e0 ofproto_v1_2_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00
IWAMOTO Toshihiro
08cbbfbfff python3: Fix relative imports
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-21 13:10:58 +09:00
Yusuke Iwase
1fc4ec6d8a doc: Include snort_integrate page into toctree
Currently, snort_integrate page is not included into toctree,
and it is difficult for user to find this page.
This patch adds snort_integrate page into toctree,
and removes warnings when building this page.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-21 09:39:48 +09:00
Takeshi
ad4613d7db Add missing comment to rest_topology
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-21 09:33:15 +09:00
Takeshi
06d84458a4 Add EventHostAdd handler for web socket application
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-21 09:33:15 +09:00
Yusuke Iwase
0d64e7f890 test_parser: Add test case for OFPQueuePropExperimenter
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
742644a21d ofproto_v1_3_parser: Add OFPQueuePropExperimenter support
This patch is the implementation for the following TODO.
- # TODO: add ofp_queue_prop_experimenter

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
f99d0cf84a ofproto_v1_3_parser: Backport OFPTableFeatureProp class
This patch backports OFPTableFeatureProp class from
ofproto_v1_[45]_parser.py.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
1a6b3e75cb ofproto_v1_[45]_parser: Add missing OFPTFPT_EXPERIMENTER_MISS
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
189d5d5bfd ofproto_v1_3_parser: Backport OFPPropBase/OFPPropCommonExperimenter4ByteData
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
ec73df506e test_parser: Fix some expected json representations
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
90f75158b0 ofproto_v1_[45]_parser: Fix to parse experimenter_data
This patch fixes to parse experimenter_data of ofp_*_prop_experimenter
as a list of uint32_t values at OFPPropCommonExperimenter4ByteData.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:40 +09:00
Yusuke Iwase
0b5dd61930 ofproto_v1_[345]: Define common structure for experimenter property
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:39 +09:00
Yusuke Iwase
e61ade46d9 ofproto_v1_4_parser: Move utility method to OFPPropBase
The backport from ofproto_v1_5_parser: This patch moves get_rest()
and serialize() from OFPTableFeatureProp to OFPPropBase in order
to share it with other subclass.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:28:39 +09:00
Yusuke Iwase
3af4f650f8 test_parser: Add test case for OFP15 packet_out
TODO: Because Open vSwitch (lib/ofp-util) does not support OF1.5
packet_out structure [EXT-427] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
3be0ac4b35 ofproto_v1_5_parser: Enable setting OFPMatch in OFPPacketOut message
OpenFlow 1.5 supports setting all pipeline field of the packet
in the Packet-Out message.

This patch adds match field in packet_out message and moves the
in_port field into the match field.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
0841ac66ed test_parser: Add test case for OFP15 controller connection status messages
TODO: Because Open vSwitch (lib/ofp-util) does not support
controller connection status messages [EXT-454] yet,
re-generate the packet data by using packet_data_generator2
when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
0d9dfe33de test_parser: Add implemented type for OFPT_CONTROLLER_STATUS
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
d7fd76fd0e ofproto_v1_5_parser: Add OFPControllerStatusStats support
OpenFlow Spec 1.5 introduces controller status multipart messages
to query status of controller connections.

This patch adds controller status multipart messages support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
57e1fa741e ofproto_v1_5_parser: Add OFPControllerStatus support
OpenFlow Spec 1.5 introduces controller status message to inform
controller of changes in connection status.

This patch adds controller status message support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
2a0d6862d2 ofproto_v1_5_parser: Add OFPControllerStatusProp support
OpenFlow Spec 1.5 introduces controller status property to describe
additional controller status information.

This patch add controller status property support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:12 +09:00
Yusuke Iwase
7ec9537b06 ofproto_v1_5_parser: Enable OFPRoleRequest to set short_id
OpenFlow Spec 1.5 introduces short_id to identify controller
themselves and enables ofp_role_request to set short_id.

This patch adds short_id field into OFPRoleRequest message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:22:11 +09:00
Takeshi
6cdc2720f1 Add register_service to topology events
If an application consumes topology event,  Switches application should
start automatically.

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:14:22 +09:00
Takeshi
2281b7a6ae Add EventHostAdd event.
This event is generated when a new host is added to a switch.

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 18:14:19 +09:00
Jason Kölker
59da77306c Allow specifing match fields in ClsRule.__init__
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 17:35:27 +09:00
Jason Kölker
1d30f0987f Sprinkle StringifyMixin
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 17:35:26 +09:00
Jason Kölker
2fb5871a56 PEP8 Line length
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 17:35:26 +09:00
Jason Kölker
31acdf8462 Remove unused import
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-20 17:35:26 +09:00
Jason Kölker
6921b54ac5 Stop old app on reconnection
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-18 00:11:04 +09:00
Jason Kölker
5c4a199c7c Use system_id from event
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-18 00:11:04 +09:00
Jason Kölker
2119e6c787 Handle disconnection during discover_system_id
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-18 00:11:04 +09:00
IWAMOTO Toshihiro
d71d84fe08 test_parser: Add tests generated by packet_data_generator3
This includes tests for recently added nicira extensions.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-11 13:17:15 +09:00
IWAMOTO Toshihiro
ea85625f63 Introduce packet_data_generator3
packet_data_generator3 works as a UNIX domain socket server and
executes ovs-ofctl to collect flow_mod packets.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-11 13:17:15 +09:00
IWAMOTO Toshihiro
68ed177295 test_parser: prepare for tests with packet_data_generator3
Be able to specify xid in packet.json files, as data generated by
packet_data_generator3 have non-zero xid.  Also, give some detail
on data mismatch in order to ease debugging.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-11 13:17:15 +09:00
IWAMOTO Toshihiro
94750b9092 Add register0 for nicira extensions
It was missing in the previous commit.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-11 13:17:15 +09:00
Yusuke Iwase
e0c19a2ecd packet_data_generator2: Add Makefile for GNU environment
The existing Makefile seems to suppose the BSD environment.
This patch renames existing Makefile into "Makefile.BSD" and
adds "Makefile.GNU" for GNU environment.

Usage Example:

 - For BSD environment
   $ make -f Makefile.BSD

 - For GNU environment
   $ make -f Makefile.GNU

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-11 10:50:54 +09:00
Takeshi
79db626806 use idle timeout in ofctl to avoid incomplete querying
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-10 11:24:05 +09:00
Fadi Moukayed
3706eec9bc Python 3: Fix search for bound methods
Signed-off-by: Fadi Moukayed <smfadi@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-10 10:54:11 +09:00
Fadi Moukayed
45c14ec59b Python 3: Filter out None values returned by getmodule(...) to fix the stack inspection
Signed-off-by: Fadi Moukayed <smfadi@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-10 10:54:10 +09:00
Yusuke Iwase
3b4a82bab2 ofproto_v1_5_parser: Add OFPBundleFeaturesStats support
OpenFlow Spec 1.5 introduces bundle features request/reply messages
to query a switch about its bundle capabilities.

This patch adds bundle features request/reply messages support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
9497aad69f ofproto_v1_5_parser: Support new OFPTableFeaturesStats structure
OpenFlow Spec 1.5 introduces a new ofp_table_features structures
in accordance with table feature request commands for simpler table
features updates.

This patch fixes OFPTableFeaturesStats class to support the new
structure of ofp_table_features.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
1fef327dc4 ofproto_v1_5_parser: Add OFPBundlePropTime support
OpenFlow Spec 1.5 introduces ofp_bundle_prop_time property
which is used in scheduled bundles.

This patch adds ofp_bundle_prop_time property support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
a4a75eb2a5 test_parser: Add test case for OFP15 bundle_features request/reply
TODO: Because Open vSwitch (lib/ofp-util) does not support time
scheduled bundles [EXT-340] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
48ce2b5cc8 test_parser: Add test case for OFP15 table_features_request
TODO: Because Open vSwitch (lib/ofp-util) does not support Egress
Tables [EXT-306] yet, re-generate the packet data by using
packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
605165ce92 ofproto_v1_5_parser: Add OFPBundleFeaturesProp support
OpenFlow Spec 1.5 introduces bundle features properties to  indicate
the bundle-related features that are supported by the switch.

This patch adds bundle features properties support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:20 +09:00
Yusuke Iwase
964df7e69d ofproto_v1_5_parser: Add new table feature properties support
OpenFlow Spec 1.5 introduces new table feature properties as following.
  enum ofp_table_feature_prop_type {
    ...
    OFPTFPT_WRITE_COPYFIELD = 18, /* Write Copy-Field property. */
    OFPTFPT_WRITE_COPYFIELD_MISS = 19, /* Write Copy-Field for table-miss. */
    OFPTFPT_APPLY_COPYFIELD = 20, /* Apply Copy-Field property. */
    OFPTFPT_APPLY_COPYFIELD_MISS = 21, /* Apply Copy-Field for table-miss. */
    OFPTFPT_PACKET_TYPES = 22, /* Packet types property. */
    ...
  }

This patch adds these properties support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-08 13:24:19 +09:00
Minoru TAKAHASHI
e8cda9e30a test_parser: Regen OFP15 port_desc request packet
Re-generate the packet data by using packet_data_generator2.
(This patch is to complete the TODO of b7b8e2fca3 )

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:39:57 +09:00
Minoru TAKAHASHI
310397305b test_parser: Regen OFP15 group_desc request packet
Re-generate the packet data by using packet_data_generator2.
(This patch is to complete the TODO of d0733220f3 )

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:39:56 +09:00
Yusuke Iwase
d815eb0f17 test_parser: Add test case for OXS related messages in OF1.5
TODO: Because Open vSwitch (lib/ofp-util) does not support
Extensible Flow Entry Statistics [EXT-334] yet, re-generate
the packet data by using packet_data_generator2 when
Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:32:51 +09:00
Yusuke Iwase
317d3c4634 ofproto_v1_5_parser: Add OFPFlowDesc support
OpenFlow Spec 1.5 introduce lightweight flow statistics multipart,
rename existing flow statistics as flow description.

This patch add flow description multipart support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:32:50 +09:00
Yusuke Iwase
c7df2ef4fb ofproto_v1_5_parser: Fix OFPFlowStats/OFPAggregateStats to use OFPStats
OpenFlow Spec 1.5 introduces OXS into flow statistics multipart
and flow aggregate multipart.

This patch fixes these multipart to use OXS.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:32:49 +09:00
Yusuke Iwase
141957fbbd ofproto_v1_5_parser: Fix OFPFlowRemoved to use OFPStats
OpenFlow Spec 1.5 introduces OXS into flow removed message.
This patch fixes flow removed message to use OXS.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:32:48 +09:00
Yusuke Iwase
be1b802c07 ofproto_v1_5_parser: Use b'str' for binary data
Note: ofproto_v1_[034]_parser was done in previous commits.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
50274170a1 ofproto_v1_5_parser: Use six.binary_type instead of buffer
To support Python3, buffer() type need to be replaced with
six.binary_type().

Note: ofproto_v1_[0234]_parser was done in previous commits.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
5e6877b10a test_parser: Add test case for OFP15 group_desc reply
TODO: Because Open vSwitch (lib/ofp-util) does not support OF1.5
group_desc structure [EXT-350] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
148cd09792 test_parser: Add expected json representations of OF1.5 GroupMod
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
4dc9a034aa packet_data: Regen
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
fcff174771 packet_data_generator2: Generate OF1.5 GroupMod packets
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
64df2437ee ofproto_v1_5_parser: Support OF1.5 OFPGroupDescStats structure
OpenFlow Spec 1.5 adds properties field which is a list of group
properties.

This patch adds properties field support in group description
multipart reply message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
09cef6dc1d ofproto_v1_[345]: Fix backward compatibility for OFPGroupDescStats
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
6fe9321485 ofproto_v1_5_parser: Support OF1.5 OFPGroupMod structure
OpenFlow Spec 1.5 adds bucket_id and properties fields.
And also introduces command_bucket_id field which indicates
Bucket Id used as part of the new commands, OFPGC_INSERT_BUCKET
and OFPGC_REMOVE_BUCKET.

This patch adds these fields support and fixes the example of
usage according to this changes.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
7b2c49e822 ofproto_v1_5_parser: Add OFPGroupProp support
OpenFlow Spec 1.5 introduces group property to extend groups.

This patch add group property support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
9d3e6520a8 ofproto_v1_5_parser: Add OFPGroupBucketProp support
OpenFlow Spec 1.5 introduces group bucket properties to extend
group buckets and redefine bucket fields weight, watch_port and
watch_group as group bucket properties.

This patch adds group bucket properties support and restructures
bucket fields.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:09 +09:00
Yusuke Iwase
1c822d02c1 ofproto_v1_5: Fix a typo
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 21:31:08 +09:00
FUJITA Tomonori
579383ed75 Ryu 3.24
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-03 13:34:33 +09:00
ISHIDA Wataru
27b7a524d4 ospf: fix serialize() to work with packet.Packet()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:41:46 +09:00
Minoru TAKAHASHI
65205dcdb0 of1.5: Multipart METER_CONFIG was renamed to METER_DESC
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:42 +09:00
Minoru TAKAHASHI
70021b25d7 of1.5: Meter statistics field flow_count was renamed to ref_count
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:41 +09:00
Minoru TAKAHASHI
b7b8e2fca3 test_parser: Add test case for OFP15 port_desc request
TODO:Open vSwtich (lib/ofp-util) support OF1.5 port_desc_request, but it has a bug[1].
So, re-generate the packet data by using packet_data_generator2 when Open vSwitch fix the bug.

ref: 1) http://openvswitch.org/pipermail/discuss/2015-July/018253.html

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Minoru TAKAHASHI
ebb87b4e03 of1.5: port statistics and port descriptions use a common request format
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Minoru TAKAHASHI
d0733220f3 test_parser: Add test case for OFP15 group_desc request
TODO:Open vSwtich (lib/ofp-util) support OF1.5 group_desc_request, but it has a bug[1].
So, re-generate the packet data by using packet_data_generator2 when Open vSwitch fix the bug.

ref: 1) http://openvswitch.org/pipermail/discuss/2015-July/018253.html

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Minoru TAKAHASHI
69ef757e4a of1.5: group statistics and group descriptions use a common request format
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Minoru TAKAHASHI
b57db813b5 test_parser: Add test case for OFP15 queue_desc request
TODO: Because Open vSwitch (lib/ofp-util) does not support queue_desc request,
re-generate the packet data by using packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Minoru TAKAHASHI
57c5a1f88f of1.5: queue statistics and queue descriptions use a common request format
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:31:12 +09:00
Yusuke Iwase
8153510446 ofproto_v1_[2345]_parser: Add items method to OFPMatch/OFPStats
iteritems() was renamed as items() to support Python3.
In accordance with this change, this patch adds items() into
OFPMatch/OFPStats class for convenience.

Reported-by: Ed Kiefer <ehk8@cornell.edu>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-31 08:30:38 +09:00
Jason Kölker
aa198d6900 Add OVSDB manager protocol application
Allows listening on a socket for OVSDB clients, reacting to their events
and modifying their database.

Co-Authored-By: Chris Hansen <chris.hansen.career@gmail.com>
Co-Authored-By: Ravi Kamachi <ravi.kamachi@rackspace.com>

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: Chris Hansen <chris.hansen.career@gmail.com>
Signed-off-by: Ravi Kamachi <ravi.kamachi@rackspace.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-30 16:54:46 +09:00
FUJITA Tomonori
0de43f7b60 OF: send fin/ack in response to fin packet
Calls socket's close().

Reported-by: Guru Chaitanya Perakam <gperakam@Brocade.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Guru Chaitanya Perakam <gperakam@Brocade.com>
2015-07-29 14:57:30 +09:00
Yusuke Iwase
7025a0fd6d packet_data_generator2: Adopt upgrade of ofputil_packet_in
In accordance with the upgrade of ofputil_packet_in structure
in OVS libraries, this patch fixes the usage of struct
ofputil_packet_in when initializing the flow metadata field.

FYI: The appropriate commit on OVS GitHub
50dcbd8ed4

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-25 14:58:48 +09:00
Minoru TAKAHASHI
9aa8e1556c test_ofctl: Add some test cases of OF1.0 actions
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:12:48 +09:00
Minoru TAKAHASHI
10df461c7b ofctl_v1_0: fix output string of ENQUEUE
There is no port information in output string of ENQUEUE in ofctl_v1_0.py
This patch fixes this problem.

Execution example is as follows.

curl -X GET http://localhost:8080/stats/flow/1

{
    "1": [
        {
            "actions": [
                "ENQUEUE:2:3"  # ENQUEUE:<port>:<queue_id>
            ],
            "byte_count": 0,
            "cookie": 0,
            "duration_nsec": 864000000,
            "duration_sec": 107,
            "hard_timeout": 0,
            "idle_timeout": 0,
            "match": {
                "in_port": 5
            },
            "packet_count": 0,
            "priority": 32768,
            "table_id": 0
        }
    ]
}

Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:12:47 +09:00
Yusuke Iwase
46185c48d9 OXM/OXS: Initialize exp_type with oxm_field
OpenFlow Spec 1.5 mandates that Experimenter OXMs encode the
experimenter type in the oxm_field field of the OXM header
(EXT-380).

Assumption: This can be applied for OXSs too.

This patch initializes exp_type value of _Experimenter class
with oxm_field/oxs_field value.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
8a638c088f ofproto_v1_5_parser: Add OFPPortDescPropRecirculate class
This class is parser class for OFPPDPT_RECIRCULATE type
in Port Description Properties.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
142e180b94 ofproto_v1_5_parser: Add OFPPortDescPropOxm class
This class is parser class for OFPPDPT_PIPELINE_INPUT and
OFPPDPT_PIPELINE_OUTPUT type in Port Description Properties.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
3a9559e042 ofproto_v1_5_parser: Move utility method to OFPPropBase
This patch moves get_rest() and serialize() from OFPTableFeatureProp
to OFPPropBase in order to share it with other subclass.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
188d47e083 ofproto_v1_[45]_parser: Sort out the inheritance relation of OFP*Prop
This patch sorts out the inheritance relation of properties field class.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
d885753270 ofproto_v1_[45]_parser: Correct example of OFPPortMod
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
8cb9b9a67a ofproto_v1_[45]_parser: Rename Port Description Properties class
To reflect the name of struct ofp_port_desc_prop_* in OpenFlow Spec 1.4/1.5,
this patch renames "OFPPortProp" to "OFPPortDescProp".

e.g.) in OpenFlow Spec 1.4
  struct ofp_port_desc_prop_header {
      uint16_t type;    /* One of OFPPDPT_*. */
      uint16_t length;  /* Length in bytes of this property. */
  };

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:01:01 +09:00
Yusuke Iwase
7e313b90fd ofproto_v1_5_parser: Enable setting mask in OFPActionSetField
OpenFlow Sepc 1.5 allows wildcard to be used in set-field
action (EXT-314).
This patch enables setting mask in set-field action.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 19:00:18 +09:00
Yusuke Iwase
ecb1d55607 ofproto_v1_5_parser: Add OFPActionCopyField support
OpenFlow Spec 1.5 introduces Copy-Field action which allows to copy
the value from one header or pipeline field into another header or
pipeline field (EXT-320).

This patch add Copy-Field action support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 13:56:08 +09:00
Yusuke Iwase
00a920c440 ofproto_v1_5_parser: Add OFPInstructionStatTrigger support
OpenFlow Spec 1.5 introduces new instruction OFPIT_STAT_TRIGGER
to define a set of statistics thresholds using OXS (EXT-335).

This patch adds OFPIT_STAT_TRIGGER instruction support.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-22 13:56:07 +09:00
Takeshi
c7bf2707df add host restful api
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-18 15:28:49 +09:00
Takeshi
af63e5f519 add host discovery functions
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-18 15:28:46 +09:00
Takeshi
b5c4b9ae51 ignore lldp packet to avoid wrong links
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-10 11:23:48 +09:00
FUJITA Tomonori
7d37e33b5b bgp: fix withdrawn label handling again
The commit fba7213 is incomplete; doesn't parse properly so crashes
when serializing.

Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
2015-07-09 10:54:12 +09:00
Takeshi
4175f99a34 ignore lldp packet to avoid wrong links
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-09 05:51:08 +09:00
FUJITA Tomonori
607eeb0c7e declare python3 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-08 13:02:49 +09:00
ISHIDA Wataru
fba7213421 bgp: fix bug of not taking care of withdrawn label
Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-06 15:48:58 +09:00
Gal Sagie
625aefffa2 Add registers 1-7 as nicira extensions for matching and setting
This patch adds the ability to match and set registers 1-7
in openflow.
Verified to work with OVS 2.3.1

Signed-off-by: Gal Sagie <gal.sagie@huawei.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-05 20:14:23 +09:00
YAMAMOTO Takashi
2cc542c4d7 Implement NX Resubmit-table action
Signed-off-by: YAMAMOTO Takashi <imuwoto@gmail.com>
Tested-by: Gal Sagie <gal.sagie@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-04 14:22:40 +09:00
FUJITA Tomonori
ecd1e4209a travis: run tests with python3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-04 14:22:34 +09:00
IWAMOTO Toshihiro
fa4318ba69 python3: Convert chr to six.int2byte
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:03 +09:00
IWAMOTO Toshihiro
c31d6e8669 Fix test packet data generation
They are bugs found during python3 compatibility work.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:03 +09:00
IWAMOTO Toshihiro
675a7dbc37 Use the asciilist type for lists of ip addresses
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:03 +09:00
IWAMOTO Toshihiro
eff5326d47 python3: Misc str related fixups
In python2, binary_type + bytearray gives bytearray, but it gives
binary_type in python3.  Make sure the result is bytearray in both
cases.  Also, remove some redundunt str()s rather than converting
them to six.binary_type.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:03 +09:00
IWAMOTO Toshihiro
60c51214f3 python3: Round time() return value to microseconds
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:01 +09:00
IWAMOTO Toshihiro
01ac890ec8 python3: Adapt to iterator change
Use next(i) instead of i.next() for iteration, which works both
in python2 and 3.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
f99b504742 python3: Use b'str' for binary data
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
8df05b17d0 python3: Convert str to six.binary_type
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
0fc3d72ba2 packet_utils: Remove checksum() side-effect
checksum() was modifying argument when it is bytearray.  Make sure
checksum() doesn't modify its argument.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
57f9f8f27d python3: Use {encode, decode}('ascii') for text packet data
Some packet data are ascii type.  Use {encode,decode} to make
python3's struct.pack happy.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
ed5b3edd27 python3: Partially revert b'str' conversion
This patch partially reverts 75e8c58916524243e6796e73c371981e14fff6ee
and 536a42d8c1c0be48e78d5f29b6fd55a38012d953.  dhcp.sname is ascii.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
e86e8c88b0 python3: Use six.indexbytes for extracting single byte of data
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
IWAMOTO Toshihiro
7da17ac941 python3: Store AsciiStringType class data as str
AsciiStringType data are mostly IP addresses and they must be
text_type in python3 for text_to_bin to work.
Also introduce AsciiStringListType, which is suitable for lists of
IP addresses.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-03 11:38:00 +09:00
FUJITA Tomonori
1bb849b304 Ryu 3.23
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-02 08:20:53 +09:00
FUJITA Tomonori
fe128c1172 python3: fix bgp reggression
fix the c0590ea903d1fbe40a22e04970d5a8a7e489aa44 commit.

Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
2015-07-01 10:45:42 +09:00
IWAMOTO Toshihiro
ffb409135e python3: Misc. python3 fix
These are several kinds of python3 compatibility idioms.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:23 +09:00
IWAMOTO Toshihiro
8fe50be72f python3: Make stringify test functional
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
IWAMOTO Toshihiro
698cf43b03 python3: Make ryu.utils.hex_array functional
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
IWAMOTO Toshihiro
fb6256ab17 python3: Use b'str' for binary data
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
IWAMOTO Toshihiro
675f33d664 python3: Use six.binary_type for I/O of ryu.lib.rpc
While msgpack has default binary-unicode conversion, the feature is
somehow disabled in ryu.  As the other parts of ryu requires binary_type
data where they directly appear on-wire, simply follow the policy.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
IWAMOTO Toshihiro
464f56070d python3: Use 'str' not b'str' for user test data
These "user" test data are similar to ones that are initialized from
JSON.  So it makes more sense to define them as str not binary_type.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
IWAMOTO Toshihiro
7984bf5035 python3: Restore original str()s where six.binary_type shouldn't be used
This partially reverts 227b8fd984fc2fa5a37b4d8ae5d64dbd8166cc18.
These tests are testing __str__ method and shouldn't have been changed.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-07-01 10:13:22 +09:00
FUJITA Tomonori
093776af17 python3: fix bgp reggression
fix the c0590ea903d1fbe40a22e04970d5a8a7e489aa44 commit.

Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
2015-06-30 20:40:32 +09:00
Yusuke Iwase
0e4fec9f1f Avoid string exception raising
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Yusuke Iwase
fe86b9527e packet.ospf: Avoid parameter 'cls' reassignment
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Yusuke Iwase
4d9819c4a3 Remove duplicated definitions
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Minoru TAKAHASHI
ebb69c8dad test_ofctl: Fix dynamic addition of test cases
This unittest was not run from a certain time.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Minoru TAKAHASHI
5250352b4e test_ofctl: Some improvement
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Minoru TAKAHASHI
269028ee18 test_ofctl: Remove unused codes
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
Minoru TAKAHASHI
45f3db2640 test_ofctl: Add unit test for ofctl_v1_0
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-30 17:00:24 +09:00
IWAMOTO Toshihiro
576d186351 python3: Don't use str.encode
This commit partially reverts b48fedc7295cb0c9c3fe62fc2d2f124b7fc739f8.
This kind of change complicates assertion checks below.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:55 +09:00
IWAMOTO Toshihiro
39697ad1e7 python3: Remove harmful AsciiStringType.{encode, decode}
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:42 +09:00
IWAMOTO Toshihiro
01a3cde6ac python3: Decode return value of b64encode into str
b64encode is mainly used to encode binary data into JSON.  As binary_type
isn't JSON serializable in python3, it makes more sense to convert to
binary_type early.  Also, allow text_type to be base64 encoded.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:41 +09:00
IWAMOTO Toshihiro
2f74871758 python3: More b'str' conversion
Some test data look like human readable strings, but the data that
directly appear on-wire should be defined as binary_type from first place.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:40 +09:00
fumihiko kakuma
25b3f23c2f python3: Calculate the number of ports as integer
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:16 +09:00
fumihiko kakuma
8c8be53de6 python3: encode from string to bytes for s type of pack format
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:15 +09:00
fumihiko kakuma
4099aec69a python3: Modify a literal argument in a bytes method call to bytes type
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-29 22:09:14 +09:00
Eran
815dc505b7 Add support for pkt_mark nicira ext (NXM_NX_PKT_MARK)
Add support for pkt_mark match and set

Signed-off-by: Eran Gampel <eran@gampel.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-27 21:29:16 +09:00
fumihiko kakuma
645ae7633f python3: Continuous patch to replace buffer to six.binary_type
python3: Continuous patch to replace buffer to six.binary_type

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-27 21:08:47 +09:00
fumihiko kakuma
b48fedc729 python3: Continuous patch to replace str to six.binary_type
python3: Continuous patch to replace str to six.binary_type

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-27 21:08:46 +09:00
IWAMOTO Toshihiro
89bc04b4ae python3: Convert str to six.binary_type
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-26 21:21:51 +09:00
IWAMOTO Toshihiro
27134712f1 python3: More b'str' conversion
Use b'str' instead of 'str' where binary data is expected.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-26 21:21:50 +09:00
IWAMOTO Toshihiro
a9b250da75 python3: Apply "2to3 -f map"
map() has been changed to return an iterator in python3.  Iterators aren't
JSON serializable, and can be used only once for for loops.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-26 21:21:49 +09:00
IWAMOTO Toshihiro
227b8fd984 python3: Convert str to six.binary_type where appropriate
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-26 15:58:11 +09:00
fumihiko kakuma
7421556723 python3: Use six.binary_type instead of str for binary data
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-26 15:58:10 +09:00
Satoshi KOBAYASHI
955daab412 python3: adapt @wsgi.route()
- Method in Python3 is obtained as a mere function from class attributes

Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 20:14:00 +09:00
IWAMOTO Toshihiro
02ab23fcb8 python3: Use items instead of iteritems
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
5ab96772b8 python3: Use zip instead of itertools.izip
Avoid itertools micro-optimization and simply use zip.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
f4b405f31a python3: Avoid applying ord() to integers
In python3, b'abc'[0] isn't a string but a int value and ord() should not
be used.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
2749f9d4ed python3: Use formencode instead of xml_compare
The last release of xml_compare is 7 years ago and doesn't support python3.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
5b7fee0641 python3: Open packet data with binary mode
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
a23734444c python3: Fix dynamically added test methods
Usage of types.MethodType has changed and means a bound method in python3.
This is probably the reason why self must be passed explicitly in python3.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
536a42d8c1 python3: Use b'str' for binary literals
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
IWAMOTO Toshihiro
79ad56e682 python3: Remove use of buffer()
python3 doesn't have buffer().  They are mostly needed by the fact that
python2.6's unpack doesn't take bytearray.  Replace them with
six.binary_type or remove them where not needed.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
fumihiko kakuma
267bcda006 python3: Use six.text_type instead of unicode
This is the partial patch to supporting python 3.
unicode was removed in python 3. So we use six.text_type instead of unicode.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-25 12:23:31 +09:00
FUJITA Tomonori
f65ecadfaa eventlet has already supported WebSocket(RFC6455) in stable releases (>= 0.15)
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-23 14:55:51 +09:00
IWAMOTO Toshihiro
4ee2f054d2 python3: Use integer division where appropriate
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-23 05:56:06 +09:00
IWAMOTO Toshihiro
7681cf91ea python3: Fix import issues with python2
Fix issues introduced in commit c3c2112cb16a60271f4eb595f82721b1f1adc633,
reported by Satoshi KOBAYASHI on ryu-devel.
Use six.moves to handle module name changes.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-22 13:27:59 +09:00
IWAMOTO Toshihiro
75e8c58916 python3: Use bytes type for binary data
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:19:17 +09:00
IWAMOTO Toshihiro
c0590ea903 python3: Adapt to new iterator names
This patch is generated by "2to3 -f dict" and irrevant parts were
hand-removed.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:19:12 +09:00
IWAMOTO Toshihiro
c3c2112cb1 python3: Fix starndard library imports
Generated by runnig "2to3 -f imports".

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:19:10 +09:00
IWAMOTO Toshihiro
6adf399345 ofproto: Fix ImportError on python3
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:19:02 +09:00
IWAMOTO Toshihiro
e83acc434d tox.ini: Be able to run python3 unit tests
With this change, you can run "tox -e py34" to test python3 compatibility.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:18:58 +09:00
Yusuke Iwase
d67a22647f test_parser_ofpstats: Add unit test for OFPStats class
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 18:24:08 +09:00
Yusuke Iwase
05984d0c04 ofproto_v1_5_parser: Add OPFStats parser for Flow Stats Structures
This patch adds OPFStats class which has simpler API with OFPMatch class.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 18:24:07 +09:00
Yusuke Iwase
7510d10a3e test_oxs: Add unit test for oxs_fields.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 18:24:06 +09:00
Yusuke Iwase
c7503bfe0b oxs_fields: Add OXS class support
This patch adds OXS class parser for Extensible Flow Entry
Statistics in OpenFlow Spec 1.5.
And this implementation introduces oxx_fields.py to share
the logic functions with oxm_fields.py.

note: This pacth has no implementation for specific OXS
Experimenter classes as oxm_fields.py has.
(eg. ONF Experimenter, Nicira Experimenter)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 18:24:05 +09:00
Jerry Cen
ce219b31b4 Clean up server socket and thread when shutting down
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 16:31:31 +09:00
Jerry Cen
d3e9f6b06d Fixed the function name of out filter
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 13:07:39 +09:00
Minoru TAKAHASHI
9251504f15 ofctl_rest: fix error of delete_flow_entry
ofctl_rest caused an exception when run delete_flow_entry command in OpenFlow1.0.
this patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-18 08:33:38 +09:00
Minoru TAKAHASHI
cd46e0685f ofctl_v1_0: fix output of get_flow_stats
After applying this patch,
ofctl_v1_0:get_flow_stats outputs only match fields that no wildcard is set.
Execution example is as follows.

before applying this patch:

$curl http://127.0.0.1:8080/stats/flow/1
{
    "1": [
        {
            "actions": [
                "OUTPUT:1"
            ],
            "byte_count": 238,
            "cookie": 0,
            "duration_nsec": 585000000,
            "duration_sec": 154,
            "hard_timeout": 0,
            "idle_timeout": 0,
            "match": {
                "dl_dst": "00:00:00:00:00:01",
                "dl_src": "00:00:00:00:00:00",
                "dl_type": 0,
                "dl_vlan": 0,
                "dl_vlan_pcp": 0,
                "in_port": 2,
                "nw_dst": "0.0.0.0",
                "nw_proto": 0,
                "nw_src": "0.0.0.0",
                "nw_tos": 0,
                "tp_dst": 0,
                "tp_src": 0
            },
            "packet_count": 3,
            "priority": 32768,
            "table_id": 0
        }
    ]
}

after applying this patch:

$curl http://127.0.0.1:8080/stats/flow/1
{
    "1": [
        {
            "actions": [
                "OUTPUT:1"
            ],
            "byte_count": 238,
            "cookie": 0,
            "duration_nsec": 593000000,
            "duration_sec": 12,
            "hard_timeout": 0,
            "idle_timeout": 0,
            "match": {
                "dl_dst": "00:00:00:00:00:01",
                "in_port": 2
            },
            "packet_count": 3,
            "priority": 32768,
            "table_id": 0
        }
    ]
}

Reported-by:Liu, Weijie <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-14 22:48:30 +09:00
FUJITA Tomonori
8e7a4c6ddb Ryu 3.22
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-04 21:40:47 +09:00
IWAMOTO Toshihiro
d573cb9bd8 test_parser: Add some expected json representations
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-02 09:14:19 +09:00
IWAMOTO Toshihiro
74c04e9659 packet_data: Regen
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-02 09:14:19 +09:00
IWAMOTO Toshihiro
2b09bd0faf packet_data_generator2: Generate conjunction packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-02 09:14:19 +09:00
IWAMOTO Toshihiro
50769ac837 Implement NXActionConjunction and conj_id match for OF1.3 and OF1.5
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-02 09:14:19 +09:00
YAMAMOTO Takashi
5b280f4915 Add missing ryu.contrib.update_module_path calls
Found by investigating readthedocs logs.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-27 11:09:51 +09:00
YAMAMOTO Takashi
9414322f30 Cap pbr version
This is a workaround oslo.config related failures on readthedocs.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-27 11:09:51 +09:00
YAMAMOTO Takashi
12fd9e26b4 packet_data: Regen
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
dfcb5cd920 packet_generator2: learn action
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
af5d973c2e test_parser: Add some expected json representations
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
f6e2134f29 ofproto_v1_5: Add legacy NXM aliases for some OXMs
A motivation of this change is UTs comparing on-wire binaries;
some of NX actions (eg. learn) includes OXM/NXMs fields and
Open vSwitch prefers legacy NXMs over OXMs when encoding them.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
36f8825b75 ofproto_v1_3: Add legacy NXM aliases for some OXMs
A motivation of this change is UTs comparing on-wire binaries;
some of NX actions (eg. learn) includes OXM/NXMs fields and
Open vSwitch prefers legacy NXMs over OXMs when encoding them.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
3c7012fe43 Pull nx_actions for OpenFlow 1.5
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
0c9726efdf _NXFlowSpec: Add type annotation for stringify stuff
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:28 +09:00
YAMAMOTO Takashi
765c847c78 nx_actions: Modify __module__ for generated classes for stringify stuff
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:27 +09:00
YAMAMOTO Takashi
9510f513d9 NXActionRegMove: Add type annotation for stringify stuff
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:27 +09:00
YAMAMOTO Takashi
c73d7303a6 Adapt to namespace-less oslo
oslo packages got away from namespaces while ago.
Update ryu to use the new namespace-less import path.
Bump oslo.config requirement version accordingly.

Reference:
https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:27 +09:00
YAMAMOTO Takashi
e14c49abc8 test_lib: Remove a questional exception re-raising
This "raise" makes the following code to fall back to non-color
unreachable.  While this has been so since the initial version,
recently it started biting us on travis-ci.
(I haven't investigated why.  It might or might not be related to
recently released tox 2.0's "ENV isolation".)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:27 +09:00
IWAMOTO Toshihiro
d90209e871 Be able to parse classes that start with "NX"
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-19 15:39:27 +09:00
FUJITA Tomonori
3318324bb6 Ryu 3.21
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-02 14:37:54 +09:00
Satoshi Kobayashi
2a00087221 Suppress warning
UserWarning is always shown when ryu.controller.dpset.DPset is loaded. It is noisy.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-05-02 14:29:40 +09:00
Claudio Pisa
3c68b43e1a sw test tool: Fix typo
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-29 21:41:17 +09:00
YAMAMOTO Takashi
2639d7c240 tests: Remove some unnecessary shebangs
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:33 +09:00
YAMAMOTO Takashi
c25a05ce36 packet_data: Regen
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:33 +09:00
YAMAMOTO Takashi
368d7a732c test_parser: Add expected json representations
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:29 +09:00
YAMAMOTO Takashi
bd5d4c2841 packet_data_generator2: Generate OF1.3 packets where appropriate
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:29 +09:00
YAMAMOTO Takashi
c037915f44 packet_data_generator2: Make the list of OF versions per messages
Preparation for OF1.3 tests.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:29 +09:00
YAMAMOTO Takashi
ac7988f15b tests: Fix dynamically added test cases
I haven't investigated since when it has been broken.
The versions of unittest and nose might be relevant.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:29 +09:00
YAMAMOTO Takashi
720dc37d23 tests: Remove unnecessary shebang and x bit from test_lib.py
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:29 +09:00
YAMAMOTO Takashi
376a264844 test_parser_compat: Fix indent
No functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:28 +09:00
YAMAMOTO Takashi
27107b03b9 test_parser: Try to detect test discovery failures and bail out loudly
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:28 +09:00
YAMAMOTO Takashi
1282393c0d MANIFEST.in: Exclude packet_data_generator2
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:28 +09:00
YAMAMOTO Takashi
f40bc34ac8 tox.ini: Pass posargs to make "tox -e py27 path.to.test" work
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:28 +09:00
YAMAMOTO Takashi
b498958405 bgpspeaker: Import paramiko only when necessary
This fixes document build. (library_bgp_speaker_ref.rst)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-26 20:46:12 +09:00
YAMAMOTO Takashi
7cd6b2f1e9 README.rst: Correct component which needs paramiko
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-26 20:46:11 +09:00
Rom
fd348e71ae disable padding check for llc packets
the llc padding check causes an exception when android or iOS devices are used (dhcp).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-22 11:40:17 +09:00
YAMAMOTO Takashi
cdd7084b94 ryu.contrib: Be explicit about sys.path modification
Avoid the automatic modification of sys.path because it hurts
ryu-as-a-library use cases.
An example is the recent versions of neutron OVS-agent,
which optionally imports OVS python bindings, and ends up to
use a wrong copy in ryu.contrib.ovs.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-18 08:56:19 +09:00
YAMAMOTO Takashi
d4e8026aa8 Revert recent py3 changes under ryu/contrib
Revert recent py3 changes under ryu/contrib,
namely parts of the following commits:

- commit e2dfdbf5800742ce7b3af6cf6bffb7a95b73198c
  ("Treatment was not enough") and
- commit 325c9ae9c345d4bb043ae81efb748b19adc9dd91
  ("Syntax level compatibility with Python 3")

Because:

- Some of them are broken (stream.py)
- Changes like these should go to upstream

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 13:51:26 +09:00
Satoshi Kobayashi
30777ea1b9 str to bytes
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
14e02069ff 'reload' has been renamed to 'imp.reload' in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
813f2cbeb4 Integers between '/' operation become float in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
82fcd1b015 'string.upper' and 'string.lower' has been deprecated in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
8e0e09ec64 'map' returns iterator like object with Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
ab20640f20 'izip' has been deprecated in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
84d247ea75 'reduce' has been renamed to 'functools.reduce' in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
87a051889e 'long' has been deprecated in Python 3
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-17 07:46:31 +09:00
Satoshi Kobayashi
fad258d458 'reduce' has been renamed to 'functools.reduce' in Python 3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:31:42 +09:00
Satoshi Kobayashi
67e3821c94 'sys.maxint' has been deprecated in Python 3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:31:42 +09:00
Satoshi Kobayashi
d8a8a99bb2 'itertools.izip()' has been deprecated in Python 3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:31:42 +09:00
Satoshi Kobayashi
07bc428d47 'ConfigParser' is renamed to 'configparser' in Python 3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:31:42 +09:00
Satoshi Kobayashi
22f5e67e88 '__div__' is renamed to '__truediv__' in Python 3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:31:38 +09:00
YAMAMOTO Takashi
78cb838b2e app_manager: Clean up apps harder
Necessary for neutron functional tests so that a test won't
interfere the next test in a run.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:20:56 +09:00
Satoshi Kobayashi
cfdba5c12d Fix ImportError(s) with Python3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:19:56 +09:00
Satoshi Kobayashi
8698e09839 Use range() instead of xrange()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:19:56 +09:00
Satoshi Kobayashi
cad8261b30 Reduce pep8 warnings with Python3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:19:56 +09:00
Satoshi Kobayashi
e2dfdbf580 Treatment was not enough
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:19:56 +09:00
Satoshi Kobayashi
813379fea9 '+' operator can't combine no-string object
I don't know what it is not a really a string but use '%' for safety.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:19:56 +09:00
Takeshi
6973cde0cf Avoid invalid dpid and simplify the checking of ofctl version
Signed-off-by: Takeshi <a86487817@gmail.com>
Reviewed-by: Yusuke Iwase <iwase.yusuke0@gmail.com>
2015-04-14 05:18:37 +09:00
YAMAMOTO Takashi
c330ba18f7 packet_data_generator2: Fix message length field
Some of ofputil_encode_xxx functions does not fill in
the correct value for the length field in the ofp header.
Fix it up before writing out the message to a file.

NOTE: For Open vSwitch, ofconn_send() fixes it up before
sending out the message to the peer.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-14 05:17:58 +09:00
YAMAMOTO Takashi
856c3a9a70 test_parser: Add an expected result (bundle_add)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:20 +09:00
YAMAMOTO Takashi
a658eb6ca6 packet_data: regen (bundle_add)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:20 +09:00
YAMAMOTO Takashi
29424b68c1 packet_data_generator2: Add bundle_add
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:20 +09:00
YAMAMOTO Takashi
99ff8525ea test_parser: Add an expected result (flow_mod)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
af63b00d26 packet_data: regen (flow_mod)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
c8fe765eda packet_data_generator2: clear XID field
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
afb153f175 packet_data_generator2: Add flow_mod
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
3e48d82c62 test_parser: Add a expected result (bundle_ctrl)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
1cc160913a packet_data: regen (bundle_ctrl)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
86697d52f9 packet_data_generator2: Add bundle_ctrl
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
49ef3cd658 of15: Implement OFPBundleCtrlMsg parser
TODO: backport to of14
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
YAMAMOTO Takashi
87015d1a2d packet_data_generator2: README
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 15:46:17 +09:00
Satoshi Kobayashi
172d9702ac Show warning when Datapath#ports is read
Datapath#ports is kept for compatibility with the previous openflow versions (< 1.3). Datapath#ports is not updated when received EventOFPPortStatus. This behavior may confuse users. Wherefore, showing warning message when the user accesses to Datapath#ports with the currently openflow versions (>= 1.3) is friendly.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 12:57:49 +09:00
Satoshi Kobayashi
325c9ae9c3 Syntax level compatibility with Python 3
We use syntaxes which can be used only in Python2 at many locations. But we should reduce the use of the syntaxes. This patch serves syntax level compatibility with Python3. However, for full compatibility is required still a lot of work because many API changes are made between 2 to 3.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-08 12:57:45 +09:00
FUJITA Tomonori
3f448ad2e4 Ryu 3.20
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 20:21:01 +09:00
Yusuke Iwase
e598af67d2 rest_firewall: Prevent adding fields which is unrelated to match
This patch prevent rest_firewall.py from adding unrelated fields
(e.g. priority, actions) into match fields.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:59:51 +09:00
Yusuke Iwase
45762b0d9e ofctl_v1_[23]: Ignore unkown match fields
Currently, ofctl_v1_[23].py adds non-existing match fields
when getting unknown match fields, then parser returns KeyError.
This patch fixes ofctl_v1_[23].py to ignore unkown match fields and
output error messages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:59:50 +09:00
YAMAMOTO Takashi
ea5f9ff097 Revert "pip-requires: Remove comments"
This reverts commit 8fc25ca6c8c3f4510980b14db2604e62af043a2d.
The workaround is no longer necessary because the relevant fix
in devstack [1] has been merged.

[1] https://review.openstack.org/#/c/165709/

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:51:29 +09:00
YAMAMOTO Takashi
a9b26f0fa6 test_parser: Enable OpenFlow 1.5 tests
Dig into the "of15" directory.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:51:29 +09:00
YAMAMOTO Takashi
c43c6e49e5 test_parser: Add a expected result
For OpenFlow 1.5.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:51:29 +09:00
YAMAMOTO Takashi
420bef6a7d packet_data: regen
For OpenFlow 1.5.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:51:29 +09:00
YAMAMOTO Takashi
a85fbc9694 packet_data_generator2: another packet data generator using libofproto
For OpenFlow 1.5.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-03 17:51:29 +09:00
YAMAMOTO Takashi
8fc25ca6c8 pip-requires: Remove comments
This partially reverts commit bf58a6dcf3dcf6241fc1c9e58f3e43d2aa9ea7f2.

devstack (stable/juno) fails to process comments in this file.
While a fix for devstack has been proposed [1], it might take some time
to be merged.  I guess it's best to fix it in ryu, at least for a while.

[1] https://review.openstack.org/#/c/165709/

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-22 15:39:18 +09:00
YAMAMOTO Takashi
76969c0c0a lib.ovs.vsctl: Fix a crash
Fix some typos in the code.
This fixes a crash reported on ryu-devel@.
http://sourceforge.net/p/ryu/mailman/message/33607025/

Reported-by: Jason Syu <newdongfong@gmail.com>
Tested-by: Jason Syu <newdongfong@gmail.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-22 15:39:17 +09:00
Toshiki Tsuboi
b0a69791bb bmp: fix bug of logging format in bmpstation
% ryu-manager bmpstation.py --verbose
loading app bmpstation.py
instantiating app bmpstation.py of BMPStation
BRICK bmpstation
listening on 0.0.0.0:11019
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Logged from file bmpstation.py, line 51

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-22 15:39:16 +09:00
Yusuke Iwase
e9d7050a91 ofctl_rest: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-18 22:27:13 +09:00
Yusuke Iwase
7c98ab2345 doc/app/ofctl_rest: Fix example of ipv6_exthdr match field
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-18 22:27:12 +09:00
Yusuke Iwase
d299339991 test_ofctl: Add unit test for masked ipv6_exthdr match field
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-18 22:27:11 +09:00
Yusuke Iwase
109d2bb2fd ofctl_v1_3: Support masked ipv6_exthdr match field
In OpenFlow Spec 1.3.4, ipv6_exthdr is maskable match field,
but ofctl_v1_3 does not support mask.

This patch makes ofctl_v1_3 enable to set masked ipv6_exthdr.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-18 22:27:10 +09:00
YAMAMOTO Takashi
f39e95043c requirements: Drop some optional requirements
Move some non pure python requirements (namely lxml and paramiko)
from pip-requires to test-requires.  Document it in README.rst.

Motivations:

- Make this pip-installable with pypy
- Less distribution package requirements (deb/rpm/etc) in case
  a user do not actually need the functionality

Note: while paramiko itself is pure python, it requires pycrypto.
Note: msgpack has pure python fallback implementation.

Separating ryu into smaller packages would be a better alternative.
However, it would involve a lot more work than this workaround.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 12:20:25 +09:00
YAMAMOTO Takashi
e33f5e4d3a README.rst: Replace a reference to ryu-plugin with ofagent
Ryu-plugin is obsolete and has been removed in the development version
of OpenStack/Networking.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 12:20:24 +09:00
YAMAMOTO Takashi
bf58a6dcf3 pip-requires: Add comments to say what's required by what
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 12:20:23 +09:00
YAMAMOTO Takashi
e7b5e2c1fd UT: Remove unused imports
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 12:20:22 +09:00
YAMAMOTO Takashi
7701b4d792 bgp: Remove an unused import
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 12:20:20 +09:00
Mark Lentczner
10dcde272d yet more logging call cleanups
Signed-off-by: Jerry Cen <zhiweic@google.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-17 08:16:59 +09:00
YAMAMOTO Takashi
5d993c46ee ryu.app.ofctl: Handle a race with connection close
Report the failure to the client rather than crashing.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-16 21:39:44 +09:00
FUJITA Tomonori
f10f4f7cfd silence pep8 warnings to the previous commit
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-16 21:30:09 +09:00
Mark Lentczner
b636219007 Reduce logging overhead by cleaning up logging calls
Deferred formatting to the logging system:
---------------------------------------------
In general
    logger.debug('xxx %s yyy %d zzz' % (a, b, c))
can be written as:
    logger.debug('xxx %s yyy %d %zzz', a, b, c)
This is faster, as Python logging doesn't bother doing the format
operation (which is slow) if the log message won't be logged.

We measured that a significant amount of CPU time in the BGP service
was attributable to these formatting operations.

Removed unneeded calls to str() and repr()
------------------------------------------
since formatting operations %s and %r will make these calls when
(and if) the formatting is performed.

Signed-off-by: Jerry Cen <zhiweic@google.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-16 21:11:10 +09:00
FUJITA Tomonori
1dd28e459e Ryu 3.19
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-02 10:59:35 +09:00
Yusuke Iwase
e922a92979 snortlib: Remove disabled flag MSG_WAITALL
Because Ryu is based on Eventlet, GreenSocket is used by default and
blocking flags is disabled. So MSG_WAITALL flag is not available.

This patch removes MSG_WAITALL flag, and fixes snortlib.py to check
received buffer size in _recv_loop_nw_sock().

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-02 10:47:32 +09:00
YAMAMOTO Takashi
305e41f47b ryu.cfg: Use a dedicated ConfigOpt instance
This might be necessary for future vesions of Neutron OVS agent.

1. The agent parses options, including command line options, using
  oslo.config.cfg.CONF ConfigOpt instance.
2. Depending on options, it might lazily import ryu modules.
3. The ryu modules might have import-time register_cli_opts calls
  against ryu.cfg.CONF.
3. As ryu.cfg.CONF is same as oslo.config.cfg.CONF, oslo.config
  raises an exception, complaining register_cli_opts is used after
  parsing command line options.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-26 20:18:27 +09:00
Yusuke Iwase
7fb83c149f snortlib: Fix nw_sock handling
Currently, snortlib cannot receive reconnect request from Snort client
program (e.g. pigrelay.py).
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-25 22:57:58 +09:00
Akihiro Suda
afccf3954b of: Prevent __str__() methods from raising exceptions
ofproto_parser.MsgBase.__str__(): avoid "TypeError: %x format: a number is required, not NoneType"
2015-02-25 22:56:56 +09:00
Akihiro Suda
665be6e276 bgp: Prevent __str__() methods from raising exceptions
bgp.BadMsg.__str__(): avoid "AttributeError: 'BadMsg' object has no attribute 'msg'"

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-25 22:56:23 +09:00
Minoru TAKAHASHI
d1ff39ebab packet lib: dhcp: Fix to calculate Hardware address length
Reported-by: Sam Russell <sam.h.russell@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-20 21:15:18 +09:00
FUJITA Tomonori
e330e439b8 travis-ci: use container-based infrastructure for faster testings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-16 13:23:39 +09:00
YAMAMOTO Takashi
72a06f6f60 Move msg_pack_into from ofproto to lib
A motivation of this change is a better modularity.
I.e. Make packet lib independent from ofproto.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-16 13:05:32 +09:00
YAMAMOTO Takashi
bbecb6ca56 tox.ini: Disable pep8 W503 for now
Disable pep8 "W503 line break before binary operator" warning for now.
The check was recently introduced by pep8 1.6.2.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-16 13:05:30 +09:00
ISHIDA Wataru
83c5c15cd3 bgp/bmp: bug fix. remove redundant construction of path attributes
BGPPathAttributeNextHop and BGPPathAttributeMpReachNLRI is already in
new_pathattr. so stop construct and append it to new_pathattr list.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-15 11:38:58 +09:00
YAMAMOTO Takashi
b04e98faa7 Move the definitions of ether types and inet protocols to lib.packet
A motivation of this change is a better modularity.
I.e. Make packet lib independent from ofproto.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-15 09:39:49 +09:00
Shu Shen
4de8c7425e ofproto: Fix invalid error code OFPQCFC_EPERM -> OFPSCFC_EPERM (EXT-208)
Invalid error code OFPQCFC_EPERM should be OFPSCFC_EPERM instead.
This is EXT-208 that was included in Openflow v1.3.1.

OFPSCFC_EPERM is backported to ofproto_v1_2 so that any new or updated
application could consistently use OFPSCFC_EPERM to handle all protocol
versions.

OFPQCFC_EPERM is left in ofproto_v1_2 and ofproto_v1_3 definitions for
backward compatibility.

Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-15 09:07:15 +09:00
Shu Shen
2889711e46 ofproto: Openflow 1.5 support (work-in-progress)
Work done:
- The baseline is copied over from ofproto_v1_4.py and
  ofproto_v1_4_parser.py and into ofproto_v1_5.py and
  ofproto_v1_5_parser.py respectively.
- Most of structs, enums, and pack strings in ofproto_v1_5.py has been
  updated to spec. Exception is oxs_fields has not been done yet.
- ofproto_v1_5_parser.py has not been updated except those necessary to
  allow run_tests.sh to complete successfully
- ofproto_protocol.py imports ofproto_v1_5 and ofproto_v1_5_parser now
- oxm_fields.py is updated for OFPXMC_PACKET_REGS
- Tests are updated to include Openflow v1.5 when it's obvious. But not
  much work has been done to acutally test v1.5 yet. I also found tests
  for v1.4 are scarce.

TODO:
- Add oxs_fields support. It shall be similar to oxm_fields
- Update and implement ofproto_v1_5_parser.py
- More tests, tests, tests.

Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-15 09:06:20 +09:00
FUJITA Tomonori
45e37843b9 ignore some pep8 errors for now
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 12:31:56 +09:00
YAMAMOTO Takashi
b3084c0e45 test_oxm: Add tests for EXT-109 and EXT-233
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:17:40 +09:00
YAMAMOTO Takashi
aef9838a8f ofproto_v1_3: Implement EXT-109 and EXT-233
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:17:40 +09:00
YAMAMOTO Takashi
c938f094f4 oxm_fields: Rename ONFExperimenter to OldONFExperimenter
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:17:40 +09:00
YAMAMOTO Takashi
ee0c84be6a oxm_fields: Update comment for the new version of EXT-256
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:17:40 +09:00
Toshiki Tsuboi
ef0c72c5bf bgp: support of new api for "show neighbor"
You can understand adj-RIB-in information through new api.
 - received-routes : paths received and not withdrawn by given peer
 - sent-routes : paths sent and not withdrawn to given peer

(sample log of show neighbor)
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['neighbor', 'received-routes', '192.168.101.101', 'all'], 'format': 'cli'}
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
    Timestamp           Network                          Labels   Next Hop             Metric LocPrf Path
    2015/02/06 06:52:04 192.168.1.0/30                   None     192.168.101.101      100    None   [65010] i
    2015/02/06 06:52:04 192.168.2.0/30                   None     192.168.101.101      100    None   [65010] i
    2015/02/06 06:52:04 0.0.0.0/0                        None     192.168.101.101      100    None   [65010, 65001] i

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:16:57 +09:00
Alan Quillin
973d43f6fb bgp: Fixed error in bgp implementation with single peer
When a single peer is specified for BGPSpeaker the server value was not
being set upon return.

Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:16:41 +09:00
Toshiki Tsuboi
79774a3fe9 bgp: fix bug of Path formatting in "show neighbor"
The field of "Path" has not displayed in properly as bellow.
It looks the raw data of Origin code has displayed instead.

bgpd> show neighbor received-routes 192.168.101.101 all
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
    Timestamp           Network                          Labels   Next Hop             Metric LocPrf Path
    2015/02/05 07:39:05 192.168.1.0/30                   None     192.168.101.101      100    None   [65010] 2
    2015/02/05 07:39:05 192.168.2.0/30                   None     192.168.101.101      100    None   [65010] 2
    2015/02/05 07:39:05 0.0.0.0/0                        None     192.168.101.101      100    None   [65010, 65001] 2

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 10:15:17 +09:00
FUJITA Tomonori
b4c488f807 Ryu 3.18
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-03 15:05:47 +09:00
Toshiki Tsuboi
32a57971b3 bgp: bug fix of sending Adj-RIB-Out
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-01 20:57:31 +09:00
Satoshi Kobayashi
00bc1592e1 ryu-manager: add --enable-debugger option
Eventlet's monkey patch overwrite Python standard threading library by default. It affects to Python debugger working. This will be often an issue for the user of Python debugger. Therefore, it's necessary to add the option which doesn't overwrite Python standard threading library.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-30 08:00:53 +09:00
ISHIDA Wataru
578327edc9 bgp/cli: fix internel data destruction due to cli show command
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
ISHIDA Wataru
611ffbe5a6 bgp: remove unnecessary bgp update construction
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
ISHIDA Wataru
e3e07209e3 bgp: fix bug of NameError: global name 'sent_route' is not defined
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
ISHIDA Wataru
66da38e3c1 bmpstation: bug fix. stop closing fds which are in use.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
ISHIDA Wataru
b86ab0904e bgp: don't hold withdrawn routes in adj_rib_in
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
ISHIDA Wataru
34465b3ac1 bgp/bmp: send unmodified BGPUpdate to bmp server.
Current implementation of bmp client uses Peer._construct_update()
which modifies original BGPUpdate message for sending to peers.
This function is not appropriate to use for bmp client, because
bmp client must send a BGPUpdate message which contains unmodified path
attributes. Fix this by introducing BMPClient._construct_update().

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-26 01:37:17 +09:00
Che-Wei Lin
3736b0c37d Add parsing libpcap and reading/writing PCAP file
Add parsing libpcap and reading/writing PCAP file for debugging.
Now you can easily dump the PCAP file in ryu controller.

Here is the quick example for dumping the data packets:

    from ryu.lib import pcaplib

    class SimpleSwitch13(app_manager.RyuApp):
        OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

        def __init__(self, *args, **kwargs):
            super(SimpleSwitch13, self).__init__(*args, **kwargs)
            self.mac_to_port = {}

            # Creating an instance with a PCAP filename
            self.pcap_pen = Writer(open('mypcap.pcap', 'wb'))

        @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
        def _packet_in_handler(self, ev):
            msg = ev.msg

            # Dump the data packet into PCAP file
            self.pcap_pen.write_pkt(msg.data)

Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:51:22 +09:00
YAMAMOTO Takashi
a34eda1fe1 nx_actions: Avoid confusing StringifyMixin
Having class attributes and instance attributes of the same name
confuses StringifyMixin.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
306a500ee6 nx_actions: Implement nx_action_learn
This is planned to be used for upcoming Neutron OVS agent changes.
(https://blueprints.launchpad.net/neutron/+spec/ovs-ofctl-to-python)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
181d2fa3a2 test_nx_flow_spec: Add UTs for NX flow_mod_spec
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
1d2a30dc57 nx_actions: Implement NX flow_mod_spec
Will be used for NX learn implementation.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
4d06beda4f type_desc: Separate type conversion classes from oxm_fields
Will be used for NX learn implementation.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
820a7cf75c nx_actions: Remove redundant initializations
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-25 21:50:37 +09:00
YAMAMOTO Takashi
cbb387f8eb Implement nx_action_reg_move for OpenFlow 1.3
Also, improve experimenter action related code so that
it can handle unknown actions as unknown.

Only OpenFlow 1.3 for now because this is planned to be used
for Neutron OVS agent and 1.3 is the version to be used there.
(https://blueprints.launchpad.net/neutron/+spec/ovs-ofctl-to-python)

Following the style of oxm_fields, make an OpenFlow version independent
module generate OpenFlow version specific code so that it's easier to
add the functionality to other OpenFlow versions later.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-20 13:12:48 +09:00
Yusuke Iwase
1a03f4c650 doc/app/ofctl_rest: Add description for OFPAggregateStats message
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-20 13:12:48 +09:00
Yusuke Iwase
a4e9abfcbc ofctl_rest: support OFPAggregateStats message
this patch makes ofctl_rest enable use of OFPAggregateStats message.

Get aggregate flow stats:

  usage)

    URI:    /stats/aggregateflow/<dpid>
    method: GET

  e.g.)

    $ curl -X GET http://localhost:8080/stats/aggregateflow/1
    {
      "1": [
        {
          "packet_count": 18,
          "byte_count": 756,
          "flow_count": 3
        }
      ]
    }

Get aggregate flow stats filtered by fields:

  usage)

    URI:    /stats/aggregateflow/<dpid>
    method: POST

    the message body is as follows.

        table_id     Table ID (int)
        out_port     Require matching entries to include this as an output port (int)
        out_group    Require matching entries to include this as an output group (int)
        cookie       Require matching entries to contain this cookie value (int)
        cookie_mask  Mask used to restrict the cookie bits that must match (int)
        match        Fields to match (dict)

  e.g.)

    $ curl -X POST -d '{
             "table_id": 0,
             "out_port": 2,
             "cookie": 1,
             "cookie_mask": 1,
             "match":{
                 "in_port":1
             }
         }' http://localhost:8080/stats/aggregateflow/1

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-20 13:12:48 +09:00
Yusuke Iwase
310e20ee0b doc/app/ofctl_rest: Add description for OFPQueueStats message
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-20 13:12:48 +09:00
Yusuke Iwase
fe0d068f86 ofctl_rest: support OFPQueueStats message
this patch makes ofctl_rest enable use of OFPQueueStats message.

usage)

  URI:    /stats/queue/<dpid>
  method: GET

e.g.)

  $ curl -X GET http://localhost:8080/stats/queue/1
  {
    "1": [
      {
        "port_no": 1,
        "queue_id": 0,
        "tx_bytes": 0,
        "tx_packets": 0,
        "tx_errors": 0,
        "duration_sec": 4294963425,
        "duration_nsec": 3912967296
      },
      {
        "port_no": 1,
        "queue_id": 1,
        "tx_bytes": 0,
        "tx_packets": 0,
        "tx_errors": 0,
        "duration_sec": 4294963425,
        "duration_nsec": 3912967296
      }
    ]
  }

NOTE: The "duration_sec" and "duration_nsec" fields are for OF1.3(or later).

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-20 13:12:48 +09:00
YAMAMOTO Takashi
be94c50ce6 test_oxm: Add UTs for 64-bit experimenter OXMs
Following Open vSwitch, introduce "dp_hash" OXM for testing.

>From their commit log: (commit 508a933809f8a8ede4fb93f1c1e3212799efc16a)
> Testing experimenter OXM is tricky because I do not know of any in
> widespread use.  Two ONF proposals use experimenter OXMs: EXT-256 and
> EXT-233.  EXT-256 is not suitable to implement for testing because its use
> of experimenter OXM is wrong and will be changed.  EXT-233 is not suitable
> to implement for testing because it requires adding a new field to struct
> flow and I am not yet convinced that that field and the feature that it
> supports is worth having in Open vSwitch.  Thus, this commit assigns an
> experimenter OXM code point to an existing OVS field that is currently
> restricted from use by controllers, "dp_hash", and uses that for testing.
> Because controllers cannot use it, this leaves future versions of OVS free
> to drop the support for the experimenter OXM for this field without causing
> backward compatibility problems.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:59 +09:00
YAMAMOTO Takashi
98a9f699be test_oxm: dedicated UTs for oxm_fields module
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
a7621f93dc oxm_fields: Fix 64-bit experimenter OXM support
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
3260df570b oxm_fields: Fix oxm_length calculation for experimenter OXMs
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
b7b920c257 oxm_fields: Add header-only variants of serializer/parser
These will be used for coming REG_MOVE support.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
2ce0f9cab8 oxm_fields: Prefix internal functions with _ for readability
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
0d3ccc9457 oxm_fields: Add comments
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
95d3a075fb OF 1.0: Use ofproto_common.NX_EXPERIMENTER_ID instead of NX_VENDOR_ID
And remove now unused NX_VENDOR_ID.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
893517cb29 nicira_ext: Separate the most of NX definitions from ofproto_v1_0
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
YAMAMOTO Takashi
22aaa699c9 Cleanup isinstance(foo, (int, long))
Use numbers where appropriate.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:51:55 +09:00
Yusuke Iwase
ef909210b7 doc/app/ofctl_rest: Add descriptions for duration_nsec field
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-19 00:46:26 +09:00
Alan Quillin
5b1a2651bb of_v1_0: Fixed the flow format logic to set it correctly when registers matches are set
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-13 21:40:13 +09:00
Alan Quillin
25c76192d5 of_v1_0: Added support for the NXM_NX_TUN_IPV4_{SRC & DST}[_W] fields
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-13 21:40:08 +09:00
ISHIDA Wataru
c1e01c54ca ospf: fix wrong OSPF LSA type
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-13 21:32:57 +09:00
Toshiki Tsuboi
36d734f4e4 bgp: support of understanding assigned mpls-label for prefix_add in vpnv4
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-13 21:24:36 +09:00
Minoru TAKAHASHI
5d63bbfbaf ofctl_v1_0/2/3: Fix unsuitable log level
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-13 21:22:49 +09:00
FUJITA Tomonori
b4f21bdb60 Ryu 3.17
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-05 09:46:04 +09:00
ISHIDA Wataru
350ce71bd2 ospf: add SummaryLSA class
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-31 07:39:50 +09:00
FUJITA Tomonori
bd4bde945e ofctl_v1_2, 3: Fix regression of IP arbitrary bitmask support
Reported-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Wei-Li Tang <alextwl@xinguard.com>
2014-12-28 22:54:10 +09:00
Toshiki Tsuboi
a962e9a472 bgp: bug fix of timestamps of BMPRouteMonitoring in bmp.py
It looks “timestamps” of BMPRouteMonitoring incorrect, in case of using ryu.app.bmpstation.py.

(1) BMPPeerUpNotification
-> timestamp=1419540815.870563 (Fri Dec 26 05:53:35 2014)

(2) BMPRouteMonitoring
-> timestamp=1419573216.0 (Fri Dec 26 14:53:36 2014)

ryu_bmp.log
-----------------
2014 Dec 26 06:44:51 | 192.168.0.101 | BMPInitiation(info=[{'type': 0, 'value': u'This is Ryu BGP BMP message', 'len': 27}],len=37,type=4,version=3)

2014 Dec 26 06:44:51 | 192.168.0.101 | BMPPeerUpNotification(is_post_policy=False,len=162,local_address='192.168.201.101',local_port=58925,peer_address='192.168.201.1',peer_as=65001,peer_bgp_id='10.0.0.1',peer_distinguisher=0,peer_type=0,received_open_message=BGPOpen(bgp_identifier='10.0.0.1',hold_time=180,len=53,my_as=65001,opt_param=[BGPOptParamCapabilityMultiprotocol(afi=1,cap_code=1,cap_length=4,length=6,reserved=0,safi=1,type=2), BGPOptParamCapabilityCiscoRouteRefresh(cap_code=128,cap_length=0,length=2,type=2), BGPOptParamCapabilityRouteRefresh(cap_code=2,cap_length=0,length=2,type=2), BGPOptParamCapabilityFourOctetAsNumber(as_number=65001,cap_code=65,cap_length=4,length=6,type=2)],opt_param_len=24,type=1,version=4),remote_port=179,sent_open_message=BGPOpen(bgp_identifier='10.0.1.1',hold_time=40,len=41,my_as=65002,opt_param=[BGPOptParamCapabilityMultiprotocol(afi=1,cap_code=1,cap_length=4,length=6,reserved=0,safi=1,type=2), BGPOptParamCapabilityRouteRefresh(cap_code=2,cap_length=0,length=2,type=2)],opt_param_len=12,type=1,version=4),timestamp=1419540815.870563,type=3,version=3)

2014 Dec 26 06:44:51 | 192.168.0.101 | BMPRouteMonitoring(bgp_update=BGPUpdate(len=54,nlri=[BGPNLRI(addr='192.168.0.0',length=24)],path_attributes=[BGPPathAttributeNextHop(flags=64,length=4,type=3,value='192.168.201.101'), BGPPathAttributeOrigin(flags=64,length=1,type=1,value=2), BGPPathAttributeAsPath(flags=64,length=6,type=2,value=[[65002, 65001]]), BGPPathAttributeMultiExitDisc(flags=128,length=4,type=4,value=100)],total_path_attribute_len=27,type=2,withdrawn_routes=[],withdrawn_routes_len=0),is_post_policy=True,len=102,peer_address='192.168.201.1',peer_as=65001,peer_bgp_id='10.0.0.1',peer_distinguisher=0,peer_type=0,timestamp=1419573216.0,type=0,version=3)

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-28 21:41:04 +09:00
Wei-Li Tang
1bac27ed27 topology/switches: add of1.2+ support for the drop_packet function.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-28 10:26:50 +09:00
Jerry Cen
9de9596880 bgp: Fix filter message variable
Signed-off-by: Jerry Cen <zhiweic@google.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-22 22:56:20 +09:00
Toshiki Tsuboi
c484d73bfb bgp: support New best path selecting
In case of selecting new best path, Ryu BGPSpeaker send withdraw messages.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-18 12:40:39 +09:00
Yusuke Iwase
3bfa3c56da ofctl_rest: Fix clear flow entries command
Currently, clear flow entries command (/stats/flowentry/clear/<dpid>)
in ofctl_rest deletes flow entries from only table 0.
This patch fixes the command to delete flow entries from all tables.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-11 15:38:59 +09:00
Minoru TAKAHASHI
76e3903e38 rest_qos: fix error of additional a qos rule with "priority"
Currently, rest_qos is impossible to set the "priority" of QoS rule on a switch.
Also, "priority" is should be described in the same depth as "match" and "actions".
This patch fixes these problems.

Now, rest_qos is possible to set the "priority" with the following curl command.

e.g.)
  $ curl -X POST -d '{"priority":"5",
                      "match": {"nw_dst": "10.0.0.1", "nw_proto": "UDP", "tp_dst": "5002"},
                      "actions":{"queue": "1"}}' http://localhost:8080/qos/rules/0000000000000001

Reported-by: Jace Liang <b436412@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-08 15:15:09 +09:00
Minoru TAKAHASHI
d160f78d83 rest_qos: fix a comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-08 15:15:08 +09:00
Toshiki Tsuboi
3c03ba0034 bgp: support new handler in case of changing BGP session
When BGP session goes up/down, BGPSpeaker can detect changing the session.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-07 23:35:01 +09:00
Yusuke Iwase
567ff4ec17 doc/app/ofctl_rest: Add description for capabilities field in OPFMeterFeatures
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-05 10:00:58 +09:00
Yusuke Iwase
9ecfa8f3be ofctl_v1_3: Fix to parse capabilities field in OPFMeterFeatures
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-05 10:00:56 +09:00
Yusuke Iwase
311fe904d2 ofproto_v1_[234]_parser: Add notes for vlan_vid match field
To make it possible to refer the usage of vlan_vid match field
at Ryu-documentation, This patch adds notes into ofproto_v1_[234]_parser.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-05 10:00:32 +09:00
FUJITA Tomonori
cf58ed0109 Ryu 3.16
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-02 13:35:23 +09:00
FUJITA Tomonori
b00969a317 packet lib: don't crash with bogus ospf packet
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-30 22:15:22 +09:00
Yuji Oshima
df42ea0dc0 bmp: bug fix of peer bgp ID in BMP Message
Ryu BGP sets self-BGP ID as Peer BGP ID in BMP Message.

Signed-off-by: Yuji Oshima <yuji.oshima0x3fd@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-30 22:13:05 +09:00
Minoru TAKAHASHI
d72ff0a550 doc/app/ofctl_rest: Add command examples for OFPVID_NONE/PRESENT
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-29 08:17:02 +09:00
Minoru TAKAHASHI
1979bde573 ofctl_v1_2/3: Fully support the match combinations for VLAN ID
Currently, when VLAN ID match field is specified,
ofctl_v1_[23] is compatible with only match combination 1) of
the following three match combinations.
This patch makes it possible to set the all three combinations.

  Match combinations for VLAN ID :
    1) To match only packets with VLAN tag and VID equal value
    2) To match only packets without a VLAN tag
    3) To match only packets with a VLAN tag regardless of its value

In order to set the match combinations 2) or 3), please describe
"dl_vlan" field as hexadecimal string value like as follows.

  Before applying this patch:
    {"dl_vlan": 3 }              # int

  After applying this patch:
    {"dl_vlan": 3 }              # int (same as before applying)
    {"dl_vlan": "0x0000"}        # hexadecimal string without mask
    {"dl_vlan": "0x1000/0x1000"} # hexadecimal string with mask

NOTE: When "dl_vlan" field is described as decimal int value,
      OFPVID_PRESENT(0x1000) bit is automatically applied.
      OTOH, OFPVID_PRESENT(0x1000) bit is NOT automatically applied
      to hexadecimal string value.

For curl command examples, please refer to the following page in Ryu-documentation.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#example-of-vlan-id-match-field

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-29 08:17:01 +09:00
Yusuke Iwase
31353a95dd fix security problem of some RESTful apps
I'm very sorry I didn't include rest_firewall.py and rest_qos.py in my patch.
I suggested for ofctl_rest.py only...

Here is the patch for rest_firewall.py and rest_qos.py.

---------------------------------------------------------------
Subject: [PATCH] fix security problem of some RESTful apps

It is not safe to use eval function because input data(request body) is not checked
For example, someone can send this data to remove all files in the directory
"import('os').system('rm -rf .')"

I suggest to use json.loads to parse the request body if the data is json format
or disable builtin functions like:
eval(req.body, {"__builtins__":None})

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-26 12:46:24 +09:00
Chris Small
6a133b0cac Workaround of os.path.samefile
os.path.samrfile not implemented on Windows. Adding alternative using
os.stat

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-25 11:39:03 +09:00
Yusuke Iwase
007d5adc0e test_ofctl: Modify to use new match api and field parser
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-25 11:21:54 +09:00
Yusuke Iwase
9d3c9db776 ofctl_v1_/2/3: Modify to_match() to use new match api
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-25 11:21:24 +09:00
Yusuke Iwase
a552d5080a ofctl_v1_/2/3: Modify match_to_str() to use new match field parser
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-25 11:21:23 +09:00
Toshiki Tsuboi
aa497ed5d9 bgp: bug fix of handling nexthop for eBGP peering
RyuBGP doesn't work properly becase of handling wrong nexthop address.
Therefore, in spite of receiving BGP UPDATE Message in the peering router,
the router fails to learn a new route entry from RyuBGP in BGP table.
(Memo: this issue has not occurred in Vpnv4/mpBGP environment.)

(1) register route entry as prefix_add(prefix='x,x,x,x', next_hop='y.y.y.y')

                 static               eBGP
    ------- R1 ------------ RyuBGP ---------> Router
    x.x.x.x   y.y.y.y            z.z.z.z       => Drop UPDATE(Nexthop: y.y.y.y)

(2) receiving BGP UPDATE Message from iBGP session

                 iBGP                 eBGP
    ------- R1 -----------> RyuBGP ---------> Router
    x.x.x.x   y.y.y.y            z.z.z.z       => Drop UPDATE(Nexthop: y.y.y.y)

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-25 11:21:21 +09:00
Yusuke Iwase
00b84aa3c0 test_utils: Add unit test for ryu.utils
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-07 14:43:22 +09:00
Yusuke Iwase
b1b02cec00 utils: Fix bytearray conversion
The parameter buf is an instance of bytearray, but Ryu tries to convert it as string,
and outputs the error messages as a result.
This patch fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-07 14:43:20 +09:00
Minoru TAKAHASHI
828b6f48c4 test_ofctl_v1_2/3: Add a test case of masked metadata
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-18 15:57:56 +09:00
Minoru TAKAHASHI
b8d7db4076 test_ofctl_v1_2/3: Fix some test cases
UnitTest of the following cases had not been executed successfully.

{'dl_src/dst': "aa:bb:cc:11:22:33/*"}
{'eth_src/dst': "aa:bb:cc:11:22:33/*"}
{'nw_src/dst': "192.168.0.1/*", 'eth_type': 0x0800}
{'ipv4_src/dst': "192.168.0.1/*", 'eth_type': 0x0800}
{'arp_spa/tpa': "192.168.0.22/*", 'eth_type': 0x0806}
{'arp_sha/tha': "aa:bb:cc:11:22:33/*", 'eth_type': 0x0806}
{'ipv6_src/dst': '2001::aaaa:bbbb:cccc:1111/*', 'eth_type': 0x86dd}

This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-18 15:57:54 +09:00
Toshiki Tsuboi
ecc57e8660 bgp: bug fix of Multi Exit Discriminator (MED)
RyuBGP doesn't work well regarding the advertisement of BGP MED Attribute as follows.

(1) In spite of receiving BGP MED:"500" from iBGP(R2), RyuBGP can't advertise BGP MED:"100" to eBGP(R3).

    R1 -------------> R2 -------------> RyuBGP -------------> R3
       eBGP(MED:500)     iBGP(MED:500)    ^     eBGP(MED:500)
                                       (MED:100)

(2) When RyuBGP has received BGP MED:"200" from eBGP(R3), RyuBGP has sended BGP with missing-MED to iBGP(R2).
    As result, PolicyBaseRouting in R2(other RyuBGP) doesn't work properly becase of selecting wrong BestPath.

                   eBGP(MED:100)
    R1 ------------------------------------>+
                                            |
    R3 -------------> RyuBGP -------------> R2(RyuBGP) => Wrong result [BestPath is "R3-R2"]
       eBGP(MED:200)          iBGP(MED:N/A)

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-18 07:27:52 +09:00
Palubinskas Vilius
8daa12a625 ofctl_rest: fix some mistypes
In ryu/app/ofctl_rest.py found some mistypes. Error gets when using
stats/groupdesc/<dpid> and /stats/groupfeatures/<dpid>

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-18 07:11:14 +09:00
Yusuke Iwase
7b97aa040a doc/app/ofctl_rest: Correct command examples
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-17 08:27:17 +09:00
Yusuke Iwase
32a17fbec6 fix security problem of some RESTful apps
It is not safe to use eval function because input data(request body)
is not checked For example, someone can send this data to remove all
files in the directory "import('os').system('rm -rf .')"

I suggest to use json.loads to parse the request body if the data is
json format or disable builtin functions like: eval(req.body,
{"__builtins__":None})

In this patch, ast.literal_eval() is used to evaluate REST body,
because ofctl_rest needs to be compatible with hexadecimal value
or ascii byte array (e.g. "\x00\x00\x00\x01" in Experimenter)
in order to keep usability.

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-10 13:20:03 +09:00
ISHIDA Wataru
f430528929 bgp: support connect modes to choose how to connect to the neighbors
three connect modes are supported

    CONNECT_MODE_ACTIVE: try to connect from us. don't listen
    CONNECT_MODE_PASSIVE: just listen
    CONNECT_MODE_BOTH: try both methods

dynamic change of connect modes is also supported

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-10 09:31:40 +09:00
ISHIDA Wataru
1352d0c667 bgp: enable to stop a chile thread by specifying its name
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-10 09:31:40 +09:00
ISHIDA Wataru
b4c8c0d0af bgp: fix lacking import
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-10 09:31:40 +09:00
ISHIDA Wataru
cc544c8dea bgp/cli: show adjacency rib in/out by show neighbor commands
show neighbor sent-routes/received-routes commands used to show the
routes in local rib, but the right behavior is to show adjacency rib
in/out.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-10 09:31:39 +09:00
Yusuke Iwase
9ed1681783 ofctl_v1_0: Add remaining actions
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-07 22:00:32 +09:00
Yusuke Iwase
74c6595305 doc: Add tables about match and actions structures
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-07 22:00:31 +09:00
FUJITA Tomonori
91515a4d32 bgp: remove uncommon open msg check
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-06 16:59:24 +09:00
FUJITA Tomonori
8571349274 bgp: fix _OptParamCapability parser
It could include multiple Capabilities.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-06 16:19:07 +09:00
FUJITA Tomonori
9f1c0b388e Ryu 3.15
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-01 06:57:10 +01:00
FUJITA Tomonori
89c339634b simple_switch_12: handle non-buffering switch
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-01 05:26:35 +01:00
FUJITA Tomonori
5021716be3 simple_switch: handle non-buffering switch
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-01 05:22:39 +01:00
Benjamin Eggerstedt
2528c33ba6 simple_switch_13.py: Added ability to use buffer_id in FlowMod
This avoids to send two packets (FlowMod & PacketOut).

OF v1.3.1 (the specification most switch vendors implemented) mentions
in A.3.4.1 on page 65 that this is a valid way to avoid two packets.

Signed-off-by: Benny Eggerstedt <benjamin.eggerstedt@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-01 05:13:49 +01:00
Benjamin Eggerstedt
8fd7b9098a simple_switch_13: Added a logging when running in --verbose for truncated packets
Added a logging when running in --verbose as truncated packets in packet_in
have caused some confusion and this would hopefully help others

Signed-off-by: Benjamin Eggerstedt <benjamin.eggerstedt@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-01 05:05:01 +01:00
Toshiki Tsuboi
b6093c3049 bgp: supporting best_path_change_handler for Vpnv4/6 prefix in BGPSpeaker
BGPSpeaker is aware of "best_path_change_handler" in MPLS-VPN topology.
This feature is available in calculating Best Path Selection of VPNv4/6 prefixes.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-28 11:33:20 +09:00
Takeshi
16ea9e4701 rest_router: fix security problem
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-27 19:48:46 +09:00
FUJITA Tomonori
df2cf837ab packet lib: don't crash with truncated dhcp packet
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-26 20:29:52 +09:00
FUJITA Tomonori
1f2b24e834 packet lib: don't crash with corrupted lldp packet
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Benjamin Eggerstedt <benjamin.eggerstedt@gmail.com>
2014-10-26 16:47:32 +09:00
Charles M.C. Chan
f0ab847f64 ofctl_v1_0: match_to_str() does not convert nw_tos correctly
The match_to_str() function in ryu/lib/ofctl_v1_0.py does not convert
nw_tos correctly.  As a result, we cannot obtain nw_tos value of any
flow entry by invoking get_flow_stats()

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-26 16:21:23 +09:00
Toshiki Tsuboi
bac1f3038d bgp: fix bug of ASPathFilter in case of iBGP peering
In normally, when RyuBGPSpeaker originates some prefixes, it sends BGP Update messages as [ASpath: None] to peering iBGP router.
But, In use of ASPathFilter 'policy=TOP', RyuBGPSpeaker has failed to send Update messages as bellow.

$ sudo python sampleBGP_for_InterAS-MPLS-VPN-in-RyuBGP1.py
INFO:bgpspeaker.api.base:API method core.start called with args: {'router_id': '10.0.1.1', 'label_range': (1000, 1999), 'waiter': <ryu.lib.hub.Event object at 0x7f6ba91de890>, 'local_as': 65011, 'bgp_server_port': 179, 'refresh_max_eor_time': 0, 'refresh_stalepath_time': 0}
INFO:bgpspeaker.api.base:API method neighbor.create called with args: {'remote_as': 65010, 'cap_mbgp_vpnv6': False, 'cap_mbgp_vpnv4': True, 'cap_mbgp_ipv6': False, 'is_next_hop_self': False, 'cap_mbgp_ipv4': True, 'multi_exit_disc': 100, 'is_route_server_client': False, 'peer_next_hop': None, 'password': None, 'ip_address': '192.168.101.101'}
INFO:bgpspeaker.api.base:API method neighbor.create called with args: {'remote_as': 65011, 'local_port': 50001, 'cap_mbgp_vpnv6': False, 'cap_mbgp_vpnv4': True, 'cap_mbgp_ipv6': False, 'is_next_hop_self': True, 'cap_mbgp_ipv4': True, 'is_route_server_client': False, 'peer_next_hop': None, 'local_address': '10.0.1.1', 'password': None, 'ip_address': '10.0.1.2'}
INFO:bgpspeaker.api.base:API method neighbor.create called with args: {'remote_as': 65011, 'local_port': 50002, 'cap_mbgp_vpnv6': False, 'cap_mbgp_vpnv4': True, 'cap_mbgp_ipv6': False, 'is_next_hop_self': True, 'cap_mbgp_ipv4': True, 'is_route_server_client': False, 'peer_next_hop': None, 'local_address': '10.0.1.1', 'password': None, 'ip_address': '10.0.1.3'}
INFO:bgpspeaker.api.base:API method vrf.create called with args: {'import_rts': ['65010:101'], 'route_family': 'ipv4', 'site_of_origins': None, 'route_dist': '65010:101', 'export_rts': ['65010:101']}
INFO:bgpspeaker.api.base:API method prefix.add_local called with args: {'prefix': '192.168.4.0/30', 'next_hop': '0.0.0.0', 'route_dist': '65010:101', 'route_family': 'ipv4'}
INFO:bgpspeaker.api.base:API method prefix.add_local called with args: {'prefix': '10.10.10.4/32', 'next_hop': '192.168.4.2', 'route_dist': '65010:101', 'route_family': 'ipv4'}
INFO:bgpspeaker.api.base:API method prefix.add_local called with args: {'prefix': '192.168.204.0/30', 'next_hop': '192.168.4.2', 'route_dist': '65010:101', 'route_family': 'ipv4'}
INFO:bgpspeaker.api.base:API method neighbor.attribute_map.set called with args: {'ip_address': '10.0.1.3', 'route_family': 'ipv4', 'route_dist': '65010:101', 'attribute_map': [AttributeMap(filters=[ASPathFilter(as_number=65010,policy=TOP)],attribute_type=LOCAL_PREF,attribute_value=200)]}
INFO:bgpspeaker.cli:starting ssh server at localhost:4990
INFO:bgpspeaker.peer:Connection to peer: 192.168.101.101 established
INFO:bgpspeaker.peer:Connection to peer: 10.0.1.2 established
INFO:bgpspeaker.peer:Connection to peer: 10.0.1.3 established
ERROR:ryu.lib.hub:hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 708, in _process_outgoing_msg_list
    self._send_outgoing_route(outgoing_msg)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 667, in _send_outgoing_route
    update_msg = self._construct_update(outgoing_route)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 938, in _construct_update
    result = self._lookup_attribute_map(at_maps, attr_type, path)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 2004, in _lookup_attribute_map
    cause, result = m.evaluate(path)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/info_base/base.py", line 1171, in evaluate
    cause, result = f.evaluate(path)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/info_base/base.py", line 1074, in evaluate
    path_seg = path_seg_list[0]
IndexError: list index out of range

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-20 10:22:36 +09:00
fortitude.zhang
ac4c9cc9d8 stplib.py: Should wildcard non-relevant bits in the mask field of port mod message for OpenFlow 1.2+.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-20 10:21:34 +09:00
YAMAMOTO Takashi
9ea360f89f simple_switch_14: Update a comment about OVS bug
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-16 11:49:20 +09:00
YAMAMOTO Takashi
a6098fdfd6 simple_switch_13: Update a comment about OVS bug
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-16 11:49:18 +09:00
Shu Shen
ad13db892d Add a simple switch for Openflow 1.4, an easy adaption of SimpleSwitch13
Signed-off-by: Shu Shen <shu.shen@radisys.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-16 11:20:56 +09:00
Yusuke Iwase
ab9f00c1b0 sw test tool: Fix typos
Reported by Ian Y. Choi on ryu-devel.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-16 10:59:30 +09:00
YAMAMOTO Takashi
b94c288083 ofproto_v1_4: Add tun_ipv4_src and tun_ipv4_dst NXMs
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-16 10:59:26 +09:00
YAMAMOTO Takashi
f473308b37 test_parser: Update expected json representations
Update after tun_ipv4_src/tun_ipv4_dst changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:26 +09:00
YAMAMOTO Takashi
c93cafbd2c packet_data: Regen
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
0e2e378359 packet_data_generator: Add tun_ipv4_src and tun_ipv4_dst for OF1.3
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
70c0e58492 ofproto_v1_3: Add tun_ipv4_src and tun_ipv4_dst NXMs
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
be892f863b oxm_fields: Add Nicira Extended Match (NXM) support
Note: It wasn't clear to me which NXM stands for "Extensible" or
"Extended".  I chose the latter because it's in the primary
specification.  (nicira-ext.h)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
73e336e74e oxm_fields: Add comments
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
dcf6ddd828 oxm_fields: Avoid shadowing python builtin
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 13:34:25 +09:00
YAMAMOTO Takashi
6fb4550337 travis: Run tests via tox
Also, run pep8 in a separate environment.

The way to specify python versions might seem awkward.
(Well, it seems so to me.)
But it follows one of examples referenced in the official
documentation:
    http://docs.travis-ci.com/user/languages/python/
    https://github.com/twisted/klein/blob/master/.travis.yml

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
YAMAMOTO Takashi
00d736a8c3 test_addrconv: Fix a way to import the tested module
I'm not quite sure how it happens to work with the current
test environment.  But the current coding doesn't work when
running via testr probably due to different PYTHONPATH.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
YAMAMOTO Takashi
2d52d1922b test_parser: Make this independent from test environment path
To make this able to run via testr.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
YAMAMOTO Takashi
aae00a8ba5 tox.ini: Add pep8 environment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
YAMAMOTO Takashi
459baf87d3 pyang_plugins: pep8 style fix
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
FUJITA Tomonori
9bfba7fd54 bgp: fix pep8 warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-11 17:00:44 +09:00
Toshiki Tsuboi
5fc3113d73 bgp: supporting loopback interface as neighbour_source_address for iBGP
In generally, iBGP session is established between loopback interfaces.
Therefore, we need to specify loopback interface as neighbour_source_address.
This parameter is just like update-source command in cisco router.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-11 10:30:31 +09:00
Wei-Li Tang
5aa14c61a1 bfdlib: follow TTL/hop limit in RFC5881 explicitly.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 18:10:47 +09:00
Wei-Li Tang
49aa2ff9ae doc: add lib.packet.bfd classes to library_packet_ref.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
0b42159893 lib: add IPv4 single hop BFD (RFC5881) support.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
44437ea06d unit test for lib.packet.bfd
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
d1f9408314 packet lib: add BFD support.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
bcc2c13484 ofctl_v1_0/2/3: check lock timeout by lock.is_set().
send_stats_request never catches hub.Timeout exception because it
has been caught by the event wait function itself.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 09:38:50 +09:00
Minoru TAKAHASHI
39f06bff87 test: add unittests for of1.3 parser
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:51:56 +09:00
Minoru TAKAHASHI
1e72c73685 of12/3: support setting the oxm_value to OFPVID_NONE
In openflow spec 1.2 and 1.3.4, in order to match only packets without a VLAN tag,
the value of OFPXMT_OFB_VLAN_VID must be set to OFPVID_NONE (0x0000).
Old API of ofproto_v1_2/3_parser is now enabled to setting the oxm_value to OFPVID_NONE(0x0000) as follows:

e.g.)
    match = ofproto_v1_2_parser.OFPMatch()
    match.set_vlan_vid_none()

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:51:55 +09:00
YAMAMOTO Takashi
baf4b7a01a ofproto_v1_4_parser: Handle experimenter OXMs in TableFeatures
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
YAMAMOTO Takashi
8e16d24bd1 ofproto_v1_3_parser: Handle experimenter OXMs in TableFeatures
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
YAMAMOTO Takashi
9c83c8dba9 oxm_fields: Add a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
Hiroshi Yokoi
75753841aa bgp: support next_hop_self
Support next_hop_self.
BGPSpeaker can replace a path's next_hop address with its own address
when it sends the path to iBGP peer.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
FUJITA Tomonori
dca514f198 Ryu 3.14
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-02 12:31:15 +09:00
Yusuke Iwase
2a4ba63d55 doc: Add ryu.app.ofctl_rest document
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-30 11:33:28 +09:00
IWASE Yusuke
223dab9afe of: Fix name of class member variables
Fix name of class member variables in OFPMeterFeaturesStats
to reflect OpenFlow Specification.

Accordingly, fix json pattern files for unit tests.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-30 10:53:45 +09:00
Yoshiharu Yamashita
8f07bb29a9 gui_topology: fix to work using WebSocket
I midified ryu.topology.js to dinamicaly add or remove switch
using WebSocket on Ryu Topology Viewer.

Signed-off-by: Yoshiharu Yamashita <dyson.yamashita@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:44:25 +09:00
Hiroshi Yokoi
ff064e662a bgp: ignore link-local address
According to RFC 2545, both a global address and a link-local address
can be sent as a next_hop address in BGPUpdate message.
Since the link-local address is not needed in Ryu BGP,
Ryu BGP ignore it if the address family is IPv6 unicast.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Hiroshi Yokoi
594fb6a191 bgp: local preference support IPv6, VPNv4/v6 route family
local preference supports IPv6 and VPNv4/v6 route family.
sorry, previous patch contains pep8 warnings, so I cleaned them.
Please discard previous one.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Sriram Natarajan
0fff3fa73c Improve debug messages for unsupported request Log correct debug message
Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Sriram Natarajan
97c9e79743 Fix spell check in group feature message Maintain name consistency in meter type in Meter Features message in OF 1.3 Add length field in group statistics reply in OF 1.2
Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Minoru TAKAHASHI
2674a272f2 sw test tool: fix an error caused by changing enum name in of1.4
In of1.4 spec, enum name has been changed as follows:

of1.3.4 spec:
     OFPR_NO_MATCH = 0, / * No matching flow (table-miss flow entry). * /

of1.4 spec:
     OFPR_TABLE_MISS = 0, / * No matching flow (table-miss flow entry). * /

Along with this change, AttributeError has occurred in the process of comparison of the received message.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Yusuke Iwase
5239336206 ofctl: Add default value to type field of OFPGroupMod
In OF1.2 and OF1.3 Spec, the group type need not be specified
for the group delete request.
However, an error occurs at mod_group_entry in ofctl_v1_[23].py
without specifying group type to delete a group entry.

This patch adds default value to type field of OFPGroupMod
at mod_group_entry in order to reflect OpenFlow Specification.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:19 +09:00
Sriram Natarajan
9bcce6010f of: Add missing fields in OpenFlow statistics messages
update statistics structure to reflect OpenFlow specification.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:45:18 +09:00
Sriram Natarajan
72556a68b4 of: Fix Enum Names and Values
Fix Enum Names and Values in OpenFlow Header files Update no matching
name in packet-in reason as specified in OpenFlow 1.4 Update queeu
stats name in in multipart type as specified in OpenFlow 1.4 Add
additional constants as defined in OpenFlow 1.4

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:39:54 +09:00
Sriram Natarajan
33ecedd81e of: Fix Enum Name for Bad Instruction Code Corrected Reset Count enum name
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:38:25 +09:00
Hiroshi Yokoi
fad987254d bgp: local preference support
add local preference support in bgp. It is possible to apply local
preference to specific paths by using AttributeMap.

Unfortunately this patch supports only IPv4 path and I'm going to
start writing patches for other route families after this.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 14:33:50 -07:00
Minoru TAKAHASHI
43ab3472ff sw test tool: add unit test
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
688351a817 sw test tool: add a comment about specifying the port number support
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
d2d5c4d25d sw test tool: support specifying the port number
You can specify the port number in the options when sw test tool is started.
The example is as follows:

  ryu-manager --test-switch-target_recv_port 4   (default:1)
              --test-switch-target_send_port_1 5 (default:2)
              --test-switch-target_send_port_2 6 (default:3)
              --test-switch-tester_send_port 7   (default:1)
              --test-switch-tester_recv_port_1 8 (default:2)
              --test-switch-tester_recv_port_2 9 (default:3)
               ryu/tests/switch/tester.py

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
2b202aff8b ofctl_v1_0: correct flow modify message
following fields is not set at mod_flow_stats command:

  * out_port, buffer_id

this patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
YAMAMOTO Takashi
4565fa4122 ryu.cfg: Fix a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
YAMAMOTO Takashi
891eb5edf6 ofa_neutron_agent: Add a comment to explain what uses this
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Satoshi Kobayashi
9e8e241652 ofp_pktinfilter: add 'logging' option
When packet_in_filter discards a packet, it is always logging. However,
it may be felt noisy.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Che-Wei Lin
aa21f3d052 Snort Integrate:
Remove the wrong way to get IP and bind with it.
Binding with '0.0.0.0' and listen on all host.

Update and fix typos in the snort_integrate.rst document.

Fix the problem about pigrelay reconnect to ryu will not be accepted.

Pigrelay is a program running on Snort that receive Snort alert
from UNIX socket and send to Ryu via network socket.

Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-07 22:32:16 +09:00
Toshiki Tsuboi
acec421180 bgp: rpc-api 'core.start' method in Network Controller
When net_ctrl has received 'core.start' method through RPC-Session, if has occurred ERROR as follows .

(rpc-client)
$ PYTHONPATH=. ./rpc_cli.py --peers=bgps=localhost:50002
(Cmd) request bgps core.start [{'router_id': '10.0.0.7', 'local_as': 65000}]
RPC ERROR 500.1 - 'waiter'

(Ryu-Bgp)
.. snip
DEBUG 2014-09-06 08:29:03,160 net_ctrl 337 NetworkController started listening for connections...
DEBUG 2014-09-06 08:29:21,277 base 345 Connect request received from client for port 127.0.0.1:45654
CRITICAL 2014-09-06 08:29:21,280 net_ctrl 121 RPC Session to ('127.0.0.1', 45654) started
DEBUG 2014-09-06 08:29:21,281 net_ctrl 199 NetworkController processing outgoing request list.
DEBUG 2014-09-06 08:29:21,281 net_ctrl 166 NetworkController started processing incoming messages
DEBUG 2014-09-06 08:29:39,582 net_ctrl 373 Request from NetworkController<<: core.start [{'router_id': '10.0.0.7', 'local_as': 65000}]
INFO 2014-09-06 08:29:39,582 base 208 API method core.start called with args: {'router_id': '10.0.0.7', 'local_as': 65000}
ERROR 2014-09-06 08:29:39,599 base 226 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/api/base.py", line 221, in call
    return call(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/api/core.py", line 40, in start
    waiter = kwargs.pop('waiter')
KeyError: 'waiter'

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-07 16:15:08 +09:00
Jerry Cen
0d2d1836e1 import BGPPathAttributeCommunities in peer manager
This is used along line 252 in peer_manager.py

Signed-off-by: Jerry Cen <zhiweic@google.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-04 09:48:29 +09:00
Peng Xiao
41d95ac699 bmp: add client information to each bmp message
Differentiate BMP messages from different BMP clients, and modify the
debug logg ing message for client connected and disconnected.

Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-03 10:02:41 +09:00
FUJITA Tomonori
f77f84942f Ryu 3.13
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 20:10:03 +09:00
Satoshi Kobayashi
5b8e7178c2 ws_topology: bugfix an event is dropped
When SocketError occurs, an event may not be notified to an other client.
It is because rpc_clients is changed in the loop.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
Satoshi Kobayashi
4cfc239b30 bgp: should not use dict comprehension
Dict Comprehension is available in Python 2.7+ but Ryu should work
with Python2.6. Currently, It will become syntax error when we try to
operate BGP of Ryu on the platform of Python2.6.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
John-Lin
bbb7724423 Snort integrate: Add the snort lib supporting snort integration. Add an sample application simple_switch_snort.py which can dump alert message.
When there is a Snort alert message, Ryu will receive an event called EventAlert.
You can easily define the event handler in the method which using ‘set_ev_cls’
decorator with snortlib.EventAlert parameter.

The simple_switch_snort.py can install a flow that mirroring incoming packets to the snort's NIC
which correspond the OpenFlow switch on port 3 (by default).

There are two methods that sending alert message to Ryu.

1. Ryu and Snort are both on the same machine.
Ryu receives alert message via Unix Domain Socket.

2. Ryu and Snort are separate on different machines.
Ryu receives alert message via Network Socket.

More detail see doc/snort_integrate.rst

Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
FUJITA Tomonori
86550bf898 packet lib: add linux cooked header support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-30 19:26:33 +09:00
FUJITA Tomonori
2651909844 doc: update obsolete Linux kernel SubmittingPatches url
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-29 22:39:33 +09:00
FUJITA Tomonori
6b5cec7a51 packet bmp: fix Peer Down Reason
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-27 15:04:46 +09:00
Toshiki Tsuboi
dd795150f3 bgp: add parameter 'label_ranges' for 'core.start' method in BGPSpeaker
In case of locating some Ryu-BGPs in the same Topology for BGP/MPLS VPNs :
When same label has been assigned '100 (defalut label)' by each Ryu-BGP, it is difficult to analyze for trouble shooting of RIB for vpnv4 .
Therefore, each Ryu-BGPs should assign different label for vpnv4 prefix according to own label_range .

bgpd> show rib all
Status codes: * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete
     Network                          Labels   Next Hop             Reason          Metric LocPrf Path
Family: rtfilter
 *>  65001:65010:101                  None     0.0.0.0              Only Path                     ?
Family: vpnv6
Family: vpnv4
 *>  65010:101:192.168.104.0/30       [100]    172.16.0.102         Only Path                     65002 ?
 *>  65010:101:192.168.201.0/24       [43]     192.168.100.101      Only Path       100           65010 65011 i
 *>  65010:101:10.10.10.1/32          [38]     192.168.100.101      Only Path       100           65010 65011 ?
 *>  65010:101:192.168.103.0/30       [100]    0.0.0.0              Only Path                     ?
 *>  65010:101:192.168.101.0/30       [42]     192.168.100.101      Only Path       100           65010 ?
 *>  65010:101:192.168.102.0/30       [40]     192.168.100.101      Only Path       100           65010 ?
 *>  65010:101:10.10.10.2/32          [37]     192.168.100.101      Only Path       100           65010 65012 ?
 *>  65010:101:192.168.202.0/24       [44]     192.168.100.101      Only Path       100           65010 65012 i

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-22 01:27:28 -07:00
Yusuke Iwase
04766aaa93 ofctl_rest: support OFPFlowStats filtered by fields
this patch enables ofctl_rest to get OFPFlowStats messages
filtered by the OFPFlowStatsRequest fields in OpenFlow specification.

usage)

  URI:    /stats/flow/<dpid>
  method: POST

  the message body is as follows:

  table_id     ID of table.
  out_port     Require matching entries to include this as an output port.
  out_group    Require matching entries to include this as an output group.
               (Not supported in of1.0)
  cookie       Require matching entries to contain this cookie value.
               (Not supported in of1.0)
  cookie_mask  Mask used to restrict the cookie bits that must match.
               (Not supported in of1.0)
  match        Fields to match.

e.g.)

  curl -X POST -d '{"table_id": 0,
                    "out_port": 2,
                    "cookie": 1,
                    "cookie_mask": 1,
                    "match":{"in_port":1}}'
  http://localhost:8080/stats/flow/1

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-20 05:25:10 -07:00
Hiroshi Yokoi
7cc538a01a bgp: reduce duplicate codes with helper_function.
reduced duplicate codes and put together to a static function.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-20 05:01:54 -07:00
Minoru TAKAHASHI
06a38cf2a8 sw test tool: add a "note" for help to understand
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-20 04:46:32 -07:00
ISHIDA Wataru
950785ee8d bmpstation: make configurable through environment variables
you can specify listening HOST and PORT by setting env variable
'RYU_BMP_SERVER_HOST' and 'RYU_BMP_SERVER_PORT'.

'RYU_BMP_OUTPUT_FILE' specifes the output file name
'RYU_BMP_FAILED_DUMP' specifes the file name of the error dump

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 16:54:11 +09:00
ISHIDA Wataru
7a06df454b bgp: make reserved private variable
reserved field must be 0. this patch add an assertion and
make reserved field invisible when stringified

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
ISHIDA Wataru
9606784f68 bgp: encode 'next_hop' in human readable format
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
ISHIDA Wataru
f01af327c8 bgp: use _class_suffixes to support various AddrPrefix
the AddrPrefix which variable 'nlri' has is not limited to
_BinAddrPrefix. this patch enables to encode to/decode from json dict
with various AddrPrefix in 'nlri'.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
ISHIDA Wataru
fc2b0b0f9c stringify: introduce _class_suffixes for easy jsonize
class variable '_class_suffixes' can be used for the same purpose as
'_class_prefixes' but match with the suffix of the class name.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
ISHIDA Wataru
7a5b83daa6 bgp: move _TYPE declaration of IPAddrPrefix to the appropriate place.
_IPAddrPrefix can be inherited by labeled addr prefix.
In that case, variable 'addr' is tuple and not string. so declare to
parse 'addr' in 'ascii' format in _IPAddrPrefix cause following error.
this patch fix this bug.

p = LabelledIPAddrPrefix(28, ([1], '192.168.0.0'))
p.to_jsondict()

Traceback (most recent call last):
  File "./parse_labeled_addr_prefix.py", line 11, in <module>
    p.to_jsondict()
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 210, in to_jsondict
    dict_[k] = encode(k, v)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 208, in <lambda>
    encode = lambda k, x: self._encode_value(k, x, encode_string)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 155, in
_encode_value
    return cls._get_encoder(k, encode_string)(v)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 56, in encode
    return unicode(v, 'ascii')
TypeError: coercing to Unicode: need string or buffer, tuple found

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
ISHIDA Wataru
f92b674def bgp: add support for RFC3107
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-18 14:14:55 +09:00
Hiroaki KAWAI
cf4299457a fix setup.cfg entry
SubmittingPatches.rst was renamed to CONTRIBUTING.rst.
setup.py sdist will check this dependency.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-15 11:01:26 +09:00
FUJITA Tomonori
c37692cb10 bgp: simplify CLUSTER_LIST attribute parser
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-15 09:08:24 +09:00
Toshiki Tsuboi
1f90cddd20 bgp: fix bug of receiving 'RouteRefresh' Message
When Ryu BGP received 'RouteRefresh' Message from the peering router, BGP session has closed as follows .

DEBUG 2014-08-15 02:20:08,718 speaker 447 Received msg from ('192.168.100.100', '34939') << BGPRouteRefresh(afi=1,demarcation=1,len=23,safi=128,type=5)
DEBUG 2014-08-15 02:20:08,719 speaker 566 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 560, in _recv_loop
    self.data_received(next_bytes)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 275, in data_received
    self._data_received(next_bytes)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 355, in _data_received
    self._handle_msg(msg)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 508, in _handle_msg
    self._peer.handle_msg(msg)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 1585, in handle_msg
    self._handle_route_refresh_msg(msg)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 1619, in _handle_route_refresh_msg
    afi = msg.route_family.afi
AttributeError: 'BGPRouteRefresh' object has no attribute 'route_family'

INFO 2014-08-15 02:20:08,722 peer 1901 Connection to peer 192.168.100.100 lost, reason: 'BGPRouteRefresh' object has no attribute 'route_family' Resetting retry connect loop: False

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-15 09:01:52 +09:00
FUJITA Tomonori
a60c18207e bgp: refine the API for connecting to bmp server
We might want a bgp speaker to talk with multiple bmp servers in the
future so I renamed these functions. Note that currently a speaker can
connect to only one bmp server.

I also update the example code on how to make the speaker to connect
to a bmp server.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-14 18:07:45 +09:00
FUJITA Tomonori
ad2d267879 bgp: add BGP capability code 64 (graceful restart)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-14 18:07:27 +09:00
Xiao Peng
6b28af2636 bgp: add attribute ORIGINATOR_ID and CLUSTER_LIST
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-14 17:09:27 +09:00
FUJITA Tomonori
afbf024447 bgp: move ssh configuration to bgp config file
You can't pass ssh.py to run command any more. If you need ssh CLI,
update the bgp config file and then:

ryu run —-config-file /path/to/ryu.conf /path/to/ryu/ryu/services/protocols/application.py

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-13 22:20:27 +09:00
ISHIDA Wataru
c637147484 bgp: add route server function to bgpspeaker
implemented draft-ietf-idr-ix-bgp-route-server-05 partially.

you can enable this function like below

>    speaker = BGPSpeaker(as_number=64512, router_id='10.10.0.1')
>    speaker.neighbor_add('10.0.0.1', 64514, is_route_server_client=True)
>    speaker.neighbor_add('10.10.0.2', 64513, is_route_server_client=True)

add multiple rib function is a future work

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-13 14:05:18 +09:00
FUJITA Tomonori
c451b6e4ec bgp: fix bug of labels formatting for show VPNv4 prefix information
The field of 'Labels' has not displayed in properly because of extracting 'label_list' in python slicing tuples.

INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
    Network                          Labels   Next Hop             Reason          Metric LocPrf Path/Origin
Family: rtfilter
*>  64512:64511:101                  None     0.0.0.0              Only Path                     2
Family: vpnv6
Family: vpnv4
*>  64511:101:10.10.0.1/32           ([17],)  192.168.100.100      Only Path       0             64511 2
*>  64511:101:10.20.2.0/24           ([100],) 0.0.0.0              Only Path                     2
*>  64511:101:10.20.1.0/24           ([100],) 0.0.0.0              Only Path                     2
*>  64511:101:10.20.3.0/24           ([100],) 0.0.0.0              Only Path                     2
Family: ipv4
Family: ipv6

Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-13 13:56:21 +09:00
Toshiki Tsuboi
c4abf05e9e bgp: fix bug of Path(Origin) formatting for show VPNv4 prefix information
The field of 'Path(Origin)' has not displayed in properly ,because Origin codes '2 (incomplete)' is not defined in the latest code .
Therfore, I've patched the codes for formatting as follows .

INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete
     Network                          Labels   Next Hop             Reason          Metric LocPrf Path
Family: rtfilter
 *>  64512:64511:101                  None     0.0.0.0              Only Path                     ?
Family: vpnv6
Family: vpnv4
 *>  64511:101:10.10.0.1/32           [17]     192.168.100.100      Only Path       0             64511 ?
 *>  64511:101:10.20.2.0/24           [100]    0.0.0.0              Only Path                     ?
 *>  64511:101:10.20.1.0/24           [100]    0.0.0.0              Only Path                     ?
 *>  64511:101:10.20.3.0/24           [100]    0.0.0.0              Only Path                     ?
Family: ipv4
Family: ipv6

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-13 13:02:12 +09:00
Toshiki Tsuboi
4b07ae4714 bgp: show VPNv4 Prefix information
But the result looks unexpected regarding of show_command .
I can’t find the advertised labels or assigned labels for vpnv4 prefix .
 (reference: http://sourceforge.net/p/ryu/mailman/message/32686423/ )
Therfore, I've patched the codes for formatting as follows .
=> needs for fixing labels attribute after that .

INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
     Network                          Labels   Next Hop             Reason          Metric LocPrf Path/Origin
Family: rtfilter
 *>  64512:64511:101                  None     0.0.0.0              Only Path                     2
Family: vpnv6
Family: vpnv4
 *>  64511:101:10.10.0.1/32           ([17],)  192.168.100.100      Only Path       0             64511 2
 *>  64511:101:10.20.2.0/24           ([100],) 0.0.0.0              Only Path                     2
 *>  64511:101:10.20.1.0/24           ([100],) 0.0.0.0              Only Path                     2
 *>  64511:101:10.20.3.0/24           ([100],) 0.0.0.0              Only Path                     2
Family: ipv4
Family: ipv6

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-09 23:37:00 +09:00
Xiao Peng
712460fa93 packet/bgp: add open capability code of 128
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-09 22:24:39 +09:00
Hiroshi Yokoi
7f3af19754 bgp: support add/delete vpnv6 prefix
added VPNv6 prefix support.
This patch enables addition and deletion of VPNv6 prefix.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-08 16:51:15 +09:00
Hiroshi Yokoi
0ee150ec52 bgp: support add/delete VPNv6 VRF
added VPNv6 route family VRF support.
This patch enables addition and deletion of VPNv6 VRF.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-08 16:51:14 +09:00
ISHIDA Wataru
4c98b346e2 app/bmpstation: fix to work with empty BMPMessage
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-07 09:28:39 +08:00
ISHIDA Wataru
2adfda55e6 packet/bmp: fix bug of BMP Peer Down Notification class
BMP Peer Down Notification packet must have a per-peer header.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-07 09:28:38 +08:00
ISHIDA Wataru
5fb5b6c57d packet/bgp: add 32bit AS number support to BGPPathAttributeAsPath
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-06 08:46:19 +08:00
Toshiki Tsuboi
94d5d865f0 added parameter for vrfs_get (in case of format = 'cli')
this parameter will support to display like cli as follows.

    Status codes: * valid, > best
         Network                          Next Hop             Reason          Metric LocPrf Path
    VPN: ('64511:101', 'ipv4')
     *>  10.20.2.0/24                     0.0.0.0              Only Path                     2
     *>  10.20.1.0/24                     0.0.0.0              Only Path                     2
     *>  10.20.3.0/24                     0.0.0.0              Only Path                     2

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-03 17:40:56 +08:00
Toshiki Tsuboi
4076adf5ed added parameter for rib_get
this parameter will support to display like cli as follows.

    Status codes: * valid, > best
         Network                          Next Hop             Reason          Metric LocPrf Path
     *>  10.20.2.0/24                     0.0.0.0              Only Path                     i
     *>  10.20.3.0/24                     0.0.0.0              Only Path                     i
     *>  10.20.1.0/24                     0.0.0.0              Only Path                     i

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-03 17:40:55 +08:00
FUJITA Tomonori
d192aa92b7 Ryu 3.12
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-02 06:01:06 +09:00
Minoru TAKAHASHI
67328e0fb1 ofctl_rest: Add support for strict matching
ofctl_rest is now enable to modify and delete with strict matching.

usage)

  URI:    /stats/flowentry/modify_strict
          /stats/flowentry/delete_strict

  method: POST

e.g. )

  curl -X POST -d '{"dpid": 1,
                    "actions":[{"port":3, "type":"OUTPUT"}],
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/modify_strict

  curl -X POST -d '{"dpid": 1,
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/delete_strict

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-01 18:05:35 +09:00
Hiroshi Yokoi
6096a49d2e bgp: fix conflict of PEER_NEXT_HOP and NEXT_HOP value
The third is fix to a conflict of PEER_NEXT_HOP value in neighbors.py.

There is a conflict between PEER_NEXT_HOP in neighbors.py and NEXT_HOP in api/base.py.
As a result of the conflict, the correct validator for PEER_NEXT_HOP is not used when
neighbir_add is executed.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-31 15:05:15 +09:00
Hiroshi Yokoi
7acda14a5d bgp: add code to handle RD 0:0 at the head of nexthop network address in MP_REACH_NLRI path attribute
The second is patch to add or skip RD 0:0 label for the next_hop address in MP_REACH_NLRI attribute.

According to RFC, next_hop address seems to be required to contain RD of 0 when advertise VPN prefix.
This is defined in RFC 4659(3.2.1.1.  BGP Speaker Requesting IPv6 Transport) for VPN-IPv6
and in RFC 4364(4.3.2.  Route Distribution Among PEs by BGP) for VPN-IPv4.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-31 15:05:15 +09:00
Hiroshi Yokoi
cc3c00b663 bgp: add parameter for site_of_origins to neighbor_add and vrf_add method
Fujita-san,
thank you for your comment and finding the bug that causes test case failure.
I fixed the second and resend the whole patch.

The first is the addition of site_of_origins parameter to neighbor_add and
vrf_add method and fixes to some import error.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-31 15:05:15 +09:00
FUJITA Tomonori
6630328fcc bmpstation: add copyright
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 17:55:59 +09:00
ISHIDA Wataru
915dd2ca82 app: add simple bmp station application
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 17:41:40 +09:00
ISHIDA Wataru
3ead62d37f bgp: add bmp client function
now ryu bgp can send internal information through BGP monitoring protocol

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 17:41:39 +09:00
ISHIDA Wataru
851b486df4 bmp: add unit test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 17:41:38 +09:00
ISHIDA Wataru
7d3b02cfab packet lib: add bmp(BGP Monitoring Protocol)
implements I-D grow-bmp-07

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 17:41:37 +09:00
Minoru TAKAHASHI
40a70a9336 packet lib: sctp: fix default arguments
Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:52:59 +09:00
Minoru TAKAHASHI
be9db8b3f2 packet lib: udp: fix default arguments
Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:52:59 +09:00
Minoru TAKAHASHI
27c0cd5b11 packet lib: tcp: fix default arguments
Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:52:59 +09:00
Minoru TAKAHASHI
8c6185b4d9 packet lib: ipv6: fix default arguments
Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:52:59 +09:00
Minoru TAKAHASHI
cacb69b4e1 packet lib: ipv4: fix default arguments
Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:52:59 +09:00
ISHIDA Wataru
3fa25edeae bgp: fix bugs related to filter
previous implementation apply all filters to all paths regardless of
its route family. this implementation cause error like one shown below.

ryu.lib.hub l.60   |    ERROR | hub: uncaught exception:
Traceback (most recent call last):
  File "/home/wataru/ryu/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 650,
in _process_outgoing_msg_list
    self._send_outgoing_route(outgoing_msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 599,
in _send_outgoing_route
    block, blocked_cause = self._apply_out_filter(path)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 505,
in _apply_out_filter
    return self._apply_filter(self._out_filters, path)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 490,
in _apply_filter
    policy, is_matched = filter_.evaluate(path)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/info_base/base.py",
line 953, in evaluate
    net = netaddr.IPNetwork(prefix.formatted_nlri_str)
  File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py",
line 941, in __init__
    raise AddrFormatError('invalid IPNetwork %s' % addr)
AddrFormatError: invalid IPNetwork 100💯20.0.0.0/24

To fix this bug, this patch introduce the Ipv4PrefixFilter and Ipv6PrefixFilter
class which is only applied to the ipv4 path and ipv6 path.

other condition bug related to applying filter is also fixed.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 14:01:39 +09:00
ISHIDA Wataru
184c88b359 bgp: fix AttributeError bug
for BGPPathAttributeMpUnreachNLRI, use 'withdrawn_routes' instead of
'nlri_list'

bgpspeaker.speaker l.566  |    DEBUG | Traceback (most recent
call last):
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
560, in _recv_loop
    self.data_received(next_bytes)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
275, in data_received
    self._data_received(next_bytes)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
355, in _data_received
    self._handle_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
508, in _handle_msg
    self._peer.handle_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1567,
in handle_msg
    self._handle_update_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1234,
in _handle_update_msg
    self._extract_and_handle_mpbgp_withdraws(mp_unreach_attr)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1496,
in _extract_and_handle_mpbgp_withdraws
    w_nlris = mp_unreach_attr.nlri_list
AttributeError: 'BGPPathAttributeMpUnreachNLRI' object has no attribute
'nlri_list'

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 13:58:08 +09:00
ISHIDA Wataru
b22b6b1a4e bgp: fix NameError bug
variable 'nlri_str' was not defined in peer.py

bgpspeaker.speaker l.566  |    DEBUG | Traceback (most recent call last):
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
560, in _recv_loop
    self.data_received(next_bytes)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
275, in data_received
    self._data_received(next_bytes)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
355, in _data_received
    self._handle_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
508, in _handle_msg
    self._peer.handle_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1564,
in handle_msg
    self._handle_update_msg(msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1230,
in _handle_update_msg
    self._extract_and_handle_mpbgp_new_paths(update_msg)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1445,
in _extract_and_handle_mpbgp_new_paths
    self._adj_rib_in[nlri_str] = received_route
NameError: global name 'nlri_str' is not defined

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 13:58:07 +09:00
YAMAMOTO Takashi
d8c4a462da ofproto_v1_4_parser: Remove a stale comment on OFPTableFeaturesStatsReply
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 13:16:16 +09:00
YAMAMOTO Takashi
cd6aec65d1 ofproto_v1_3_parser: Remove a stale comment on OFPTableFeaturesStatsReply
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-30 13:16:15 +09:00
ISHIDA Wataru
e51f1dcf5a bgp: make 'core.reset_neighbor' API asynchronously
'core.reset_neighbor' was synchronous API and the caller had to wait
until neighbor comes up. This behavior doesn't work well with rpc_cli.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-29 17:56:02 +09:00
ISHIDA Wataru
eb90b2ecc8 bgp: add show neighbor command to ssh client
looks like,

bgpd> show neighbor
 IP Address   AS Number    BGP State
 10.0.0.1     64514        Established

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:16:41 +09:00
ISHIDA Wataru
6cbbe92806 bgp: refine and fix filter code
- change the name of the filter class from PrefixList to PrefixFilter to
  make it easy to understand the role of this class.
- update docs
- fix bugs

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:16:41 +09:00
ISHIDA Wataru
a09850e480 bgp: manage filter in a peer instance instead of rtconf
rtconf is basically for static configuration and filter is
dynamic and also specific configuration for peer instance.

move filter things under peer instance, and change rtconf to do only
static configuration things from a configuration file

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:14:56 +09:00
ISHIDA Wataru
6fe58b8a7f bgp: create adjacent rib in peer instance
this will be used when in-bound and out-bound filter changed at runtime
and to implement BMP(BGP monitering protocol) client

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:14:56 +09:00
ISHIDA Wataru
b8a1f7b6dd bgp: add in-filter function
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:14:56 +09:00
ISHIDA Wataru
e8d81ab194 bgp: enable filter configuration via configuration file
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:13:21 +09:00
ISHIDA Wataru
8c42cb3024 bgp: move filter class under info_base/
move filter class from bgpspeaker.py to info_base/base.py to fix the error
shown below.

$ sudo env PYTHONPATH=/home/wataru/ryu ~/ryu/bin/ryu run --config-file=~/etc/ryu01.conf ./application.py

loading app ./application.py
instantiating app ./application.py of RyuBGPSpeaker
INFO 2014-07-21 06:14:48,066 base 207 API method core.start called with
args: {'router_id': '10.10.0.1', 'label_range': (100, 100000), 'waiter':
<ryu.lib.hub.Event object at 0x1a15dd0>, 'local_as': 64512,
'bgp_server_port': 179, 'refresh_max_eor_time': 0,
'refresh_stalepath_time': 0}
Traceback (most recent call last):
  File "/home/wataru/ryu/bin/ryu", line 20, in <module>
    main()
  File "/home/wataru/ryu/ryu/cmd/ryu_base.py", line 75, in main
    subcmd.run(base_conf.subcommand_args)
  File "/home/wataru/ryu/ryu/cmd/ryu_base.py", line 58, in run
    self.entry(args=args, prog=prog)
  File "/home/wataru/ryu/ryu/cmd/manager.py", line 81, in main
    services.extend(app_mgr.instantiate_apps(**contexts))
  File "/home/wataru/ryu/ryu/base/app_manager.py", line 486, in
instantiate_apps
    t = app.start()
  File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 93, in start
    self._start_core(settings)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 168, in _start_core
    call('core.start', waiter=waiter, **common_settings)
  File "/home/wataru/ryu/ryu/services/protocols/bgp/api/base.py", line
210, in call
    import all  # noqa
  File "/home/wataru/ryu/ryu/services/protocols/bgp/api/all.py", line 4,
in <module>
    import prefix
  File "/home/wataru/ryu/ryu/services/protocols/bgp/api/prefix.py", line
29, in <module>
    from ryu.services.protocols.bgp.core import BgpCoreError
  File "/home/wataru/ryu/ryu/services/protocols/bgp/core.py", line 37,
in <module>
    from ryu.services.protocols.bgp import core_managers
  File
"/home/wataru/ryu/ryu/services/protocols/bgp/core_managers/__init__.py",
line 19, in <module>
    from peer_manager import PeerManager
  File
"/home/wataru/ryu/ryu/services/protocols/bgp/core_managers/peer_manager.py",
line 6, in <module>
    from ryu.services.protocols.bgp.peer import Peer
  File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 32,
in <module>
    from ryu.services.protocols.bgp.bgpspeaker import PrefixList
  File "/home/wataru/ryu/ryu/services/protocols/bgp/bgpspeaker.py", line
56, in <module>
    from ryu.services.protocols.bgp.application import RyuBGPSpeaker
  File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 64, in <module>
    def_desc='Unknown bootstrap exception.')
  File "/home/wataru/ryu/ryu/services/protocols/bgp/base.py", line 105,
in add_bgp_error_metadata
    'already defined.' % (code, sub_code))
ValueError: BGPSException with code 300 and sub-code 1 already defined.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:12:34 +09:00
Minoru TAKAHASHI
312eee129f ofctl_v1_2/3: fix unsuitable log
when using action type below, the log unsuitable is outputted:
Unknown action type: [action type]

  * GOTO_TABLE, WRITE_METADATA, METER(only ofctl_v1_3.py)

this patch fixes this problem.

Reported-by: jalee <jalee@inno-tech.com.tw>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:00:50 +09:00
Minoru TAKAHASHI
883a2aacf9 ofctl_v1_2/3: fix tcp_dst/src match fields
when enclosed the value of "ip_proto" in double quotes,
following match fields is not set at mod_flow_stats command:

  * tcp_dst, tcp_src

this patch fixes this problem.

Reported-by: jalee <jalee@inno-tech.com.tw>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:00:49 +09:00
Minoru TAKAHASHI
44fc2f9b62 unit test for ofctl_v1_2/3
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 19:00:48 +09:00
ISHIDA Wataru
7d08001854 bgp: add neighbor_reset method to bgpspeaker
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 18:47:50 +09:00
ISHIDA Wataru
64e98a9041 bgp: remove an unused variable from bgpspeaker
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 18:47:50 +09:00
ISHIDA Wataru
a1367ba233 bgpspeaker: refine logs
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 18:47:50 +09:00
ISHIDA Wataru
7304a57b95 bgp: make marker private variable
stop showing when stringified because it's noisy

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 18:47:50 +09:00
ISHIDA Wataru
3a12b6b1c1 bgp: fix bug when restart neighbor
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-28 18:47:49 +09:00
Hiroshi Yokoi
5bbc3c2165 bgp: add neighbor_update
added neighbor_update method to BGPSpeaker class.
Currently only MED value can be changed.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-23 23:10:03 +09:00
Hiroshi Yokoi
8ad3ce3ba6 bgp: add med parameter to neighbor_add
Sorry, I changed parameter name for MED to uniform with add_vrf.
I resend patches for neighbor_add method and neighbor_update and
please ignore the patches that I sent before.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-23 23:10:01 +09:00
ISHIDA Wataru
ed7ee8fbdb bgp: shut up runtime warning due to configuration file loading
this patch shut up the warning shown below

/home/wataru/etc/bgpconf01.py:1: RuntimeWarning: Parent module
'bgpspeaker' not found while handling absolute import
  import os

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-23 22:43:24 +09:00
ISHIDA Wataru
d3d5d8a598 bgp: fix bug in net_ctrl listen_tcp
due to fdce89a0, _listen_tcp returns tuple.

Reported-by: 坪井俊樹 <t.tsubo2000@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-23 22:42:45 +09:00
Hiroshi Yokoi
bd9ae63bca bgp: fix logic for checking BGP capability
BGPOpen that is set to sent_open_msg and recv_open_msg doesn't have
caps and BGP capabilities are stored in opt_param as List.
I changed the way of checking BGP capabilities.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-18 20:40:51 +09:00
Hiroshi Yokoi
86192caf07 bgp: fix the way of getting RouteFamily object
RouteFamily objects are treated as a singleton object.
However they are created in peer.py, so I added method to
get RouteFamily object in bgp.py and changed codes to use it.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-18 12:55:14 +09:00
Hiroshi Yokoi
3c0c9ce737 bgp: add out-filter function
Added out-filter function to Ryu BGPSpeaker. It supports IPv4 and
IPv6.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 16:34:23 +09:00
takahashi.minoru
9d7433e44a ofctl_rest: enable getting Description of a port
this patch makes ofctl_rest enable getting Description of a port.

usage)

  URI:    /stats/portdesc/<dpid>
  method: GET

e.g. )

  curl http://localhost:8080/stats/portdesc/1

    {"1": [{"hw_addr": "c6:d8:19:4a:e1:4f", "curr": 0, "supported": 0,
            "max_speed": 0, "advertised": 0, "peer": 0,
            "port_no": 4294967294, "curr_speed": 0, "name": "s1",
            "state": 1, "config": 1},
           {"hw_addr": "8e:96:a1:14:d8:a1", "curr": 2112, "supported": 0,
            "max_speed": 0, "advertised": 0, "peer": 0,
            "port_no": 1, "curr_speed": 10000000, "name": "s1-eth1",
            "state": 0, "config": 0}]}

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 15:04:38 +09:00
takahashi.minoru
78786a47c6 ofctl_rest: support Port Modification Message
this patch makes ofctl_rest enable use of Port Modification Message.

usage)

  URI:    /stats/portdesc/modify
  method: POST

the message body is as follows:

  dpid
  port_no    (default:0)
  config     (default:0)
  hw_addr    (default:automatic-setting)
  mask       (default:0)
  advertise  (default:automatic-setting)

e.g. )

  curl -X POST -d '{"dpid": 1,
                    "port_no": 1,
                    "mask": 0b0000001,
                    "config": 0b0000001}' http://localhost:8080/stats/portdesc/modify

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 15:04:35 +09:00
Satoshi Kobayashi
39c0fc00f9 ws_topology: fix typo
No spec change. The issue occurs at the time of "one_way=True"

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 15:04:26 +09:00
Hiroaki KAWAI
5eb2cdf246 Correct tcp option values in the test set
"\x11"*4 is an invalid value for TCP option, because it
would be decoded as Kind=17 and Length=17, but actual
size is 4.

If we'd like to set some non-zero value for TCP option
here, Kind=1(NOOP) is better.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 15:04:20 +09:00
takahashi.minoru
bfe4b79a1f ofctl_v1_2/3: fix POP_MPLS action and some match fields
The following causes an error at mod_flow_entry command

  - ofctl_v1_2.py
    * match field: metadata, mpls_label

  - ofctl_v1_3.py
    * match field: in_phy_port

and the following causes an error at get_flow_stats command

  - ofctl_v1_2.py
    * action: POP_MPLS
    * match field: metadata, ipv6_nd_target

  - ofctl_v1_3.py
    * action: POP_MPLS
    * match field: ipv6_nd_target

this patch fixes them.

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-17 15:04:17 +09:00
Andrew Ragusa
261cda51a9 adding FloatOpt to the config parser
This patch just adds the ability to parse Float values from a config
using oslo.config.cfg FloatOpt class

Signed-off-by: AJ Ragusa <aragusa@grnoc.iu.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-10 08:45:36 +09:00
ISHIDA Wataru
3770483c67 add --pid-file option to cli
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-07 22:26:19 +09:00
FUJITA Tomonori
a3f24e8cca bgp: support specifying nexthop per prefix
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-07-07 22:17:29 +09:00
Hisaharu Ishii
8051160db1 pip-requires: gui_topology requires webob>=1.2
gui_topology imports webob.static.DirecoryApp
which was added since webob 1.2

Signed-off-by: Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-07 22:13:37 +09:00
FUJITA Tomonori
0c7952cfd7 bgp: fix send_notificaiton crash
self._localname() is invalid before a connection establishes.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 15:21:19 +09:00
FUJITA Tomonori
d884524db5 Ryu 3.11
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 10:05:39 +09:00
ISHIDA Wataru
d096f761f4 ospf: describe prefix in one attribute 'prefix' for ease of use
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 00:09:23 +09:00
ISHIDA Wataru
df7f57e4fe ospf: add segment routing opaque types
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 00:09:23 +09:00
ISHIDA Wataru
972bce0234 ospf: fix bug in encoding
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 00:09:23 +09:00
ISHIDA Wataru
f96435bcfa ospf: support for opaque message
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-03 00:09:23 +09:00
FUJITA Tomonori
fdce89a0de bgp: support md5 authentication for re-active sessions
For now, only Linux is supported.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-07-01 02:36:00 +09:00
FUJITA Tomonori
b984c15f68 bgp: support md5 authentication for pro-active sessions
For now, only Linux is supported.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 22:19:19 +09:00
FUJITA Tomonori
24220ea2e8 bgp: fix withdraw in EventPrefix notification
A lost path's is_withdraw is not True so we can't use it. Let's pass
path and is_withdraw information separately to emit_signal().

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
2014-06-30 21:50:49 +09:00
Hiroaki KAWAI
736e877540 sw test too: use assured Forwarding behavior DSCP value for dscp_remark
OpenFlow spec describes "DSCP values that do not encode a drop
precedence are not modified".

Diffserv Assured Forwarding described in rfc2597(+rfc3260) has
DSCP values which encodes "drop precedence".

I think we'd better test OFPMBT_DSCP_REMARK works on AF21 -> AF22
rating, for example.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 14:29:36 +09:00
FUJITA Tomonori
bf58248a61 bgp: support specifying next hop for neighbor
neighbor_add method takes 'next_hop' parameter. If not specified, like
before, host's ip connected to the neighbor is used as a next hop.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
f2e62c2f2b bgp: add IPv6 advertisement support
You can advertize IPv6 addresses to IPv6 neighbors.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
0ab9f19d60 packet/bgp: fix BGPPathAttributeMpReachNLRI next_hop parser and serializer
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
8907f5e426 bgp: clean up getpeername() and getsockname() usage
The current code calls getpeername() and getsockname() at lots of
places. The formats of the return values of getpeername() and
getsockname() are different between ipv4 and v6. So the code became
messy.

Calling getpeername() and getsockname() at one place and caching the
results is ideal. But that needs some refactoring. This patch is kinda
halfway.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
Srini Seetharaman
d94f7bd0fb Initializing the variable 's' so that the get_desc_stats() call does not cause an exceptions when there are no messages
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Reviewed-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-29 21:24:45 +09:00
YAMAMOTO Takashi
858aec4cef Add a small library to deal with TCP-MD5 socket option
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-29 08:19:49 +09:00
Yoshihiro Kaneko
b620f7a160 doc: improve the appearance of the table
I don't want to write a directive of sphinx in scripts, but
I was not able to find other methods.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-26 08:28:45 +09:00
Yoshihiro Kaneko
3e1fd452b6 doc: leave out too large samples
To let compilation of the document succeed, this patch leave out
large samples.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-26 08:28:44 +09:00
ISHIDA Wataru
6b9f5580ac bgp: add ssh_console option for bgpspeaker module
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:23:40 +09:00
YAMADA Hideki
5b1f5aea29 document: ryu.app.gui_topology
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:12:51 +09:00
Yuichi Ito
a3cb8f8c25 sw test tool: Add default test files (of14: new features)
OF 1.4.0 spec (B.14.14 PBB UCA header field) says:

    A new OXM field OFPXMT_OFB_PBB_UCA has been added to match the "use customer address" header
    field from the PBB header (EXT-256).

These test files aim to examine new features of 'set-field action' and 'match' of FlowMod message.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
44a8c69350 sw test tool: Add default test files (of14: group:all/select)
These test files aim to examine 'group action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/group.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
dd960c9c18 sw test tool: Add default test files (of14: meter)
These test files aim to examine 'meter instruction' of FlowMod message.
This patch only copies ryu/tests/switch/of13/meter.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
1319010d81 sw test tool: Add default test files (of14: match)
These test files aim to examine 'match' of FlowMod message.
This patch only copies ryu/tests/switch/of13/match.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
f333b94368 sw test tool: Add default test files (of14: action with set-field only)
These test files aim to examine 'set-field action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action/25_SET_FIELD.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
947465e4de sw test tool: Add default test files (of14: action without set-field)
These test files aim to examine 'action' excluding 'set-field' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
76da336bd5 sw test tool: run_mininet: support Open vSwitch with OpenFlow 1.4
usage)

  to use Open vSwitch with OpenFlow 1.4:
    sudo ryu/tests/switch/run_mininet.py --swtich ovs14

  to use Open vSwitch with OpenFlow 1.3:
    sudo ryu/tests/switch/run_mininet.py --switch ovs13
      or
    sudo ryu/tests/switch/run_mininet.py --switch ovs
      or
    sudo ryu/tests/switch/run_mininet.py

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
2d173ad25c sw test tool: Modify OFPActionSetField to normalize
This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPActionSetField that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPActionSetField that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
1474ec3255 sw test tool: Modify OFPMatch to normalize
This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPMatch that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPMatch that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
740823f7b6 sw test tool: Enable using connected switches to compare
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
013cc84ce5 sw test tool: Enable using user-specified versions to parse
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
b9034c18bf sw test tool: Add support for using user-specified versions
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
7aa71165d7 ryu/flags: Add config parameters related sw test tool
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
6942189d8f sw test tool: Modify conditions of ofp_packet_in_reason
OF 1.4.0 spec (B.14.2 More descriptive reasons for packet-in) says:

    The main change is that the the "output action" reason OFPR_ACTION is effectively split into four reasons,
    "apply-action", "action-set", "group bucket" and "packet-out", representing the four distinct context
    where this action is used.

A set of reason values for ofp_packet_in message in OF 1.3.3 is:

    enum ofp_packet_in_reason {
        OFPR_NO_MATCH    = 0, /* No matching flow (table-miss flow entry). */
        OFPR_ACTION      = 1, /* Action explicitly output to controller. */
        OFPR_INVALID_TTL = 2, /* Packet has invalid TTL */
    };

And a new set of reason values for ofp_packet_in message in OF 1.4.0 is:

    enum ofp_packet_in_reason {
        OFPR_TABLE_MISS   = 0, /* No matching flow (table-miss flow entry). */
        OFPR_APPLY_ACTION = 1, /* Output to controller in apply-actions. */
        OFPR_INVALID_TTL  = 2, /* Packet has invalid TTL */
        OFPR_ACTION_SET   = 3, /* Output to controller in action set. */
        OFPR_GROUP        = 4, /* Output to controller in group bucket. */
        OFPR_PACKET_OUT   = 5, /* Output to controller in packet-out. */
    };

Therefore, "reason != OFPR_ACTION" means "reason == OFPR_NOMATCH or reason == OFPR_INVALID_TTL".

NOTE: OFPR_TABLE_MISS is defined as OFPR_NO_MATCH in ryu.ofproto.ofproto_v1_4.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
FUJITA Tomonori
63451ce0a2 bgp: fix ipv6 peering regression
Workaround. Needs to clean up get_peername and get_sockname usage.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 17:19:20 +09:00
FUJITA Tomonori
3aeeffa48c bgp: fix best_path_change_handler for best_path_lost
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 17:18:32 +09:00
FUJITA Tomonori
9b0754944f bgp: fix example code
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:59:30 +09:00
YAMAMOTO Takashi
602cf17b40 bgp: fix another crash (recv_open -> recv_open_msg)
Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
2814715ef9 bgp: fix some leftover of transition to packet lib bgp
fix some leftover of commit 9d5e66fa4e49ce66103dbc9640a33bd9c22fab3f.
("bgp: use ryu bgp packet library instead of original one")

Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
254ae732de bgp: fix a crash in path comparison
this fixes the following crash.

API method core.start called with args: {'router_id': '172.17.190.2', 'waiter':<
<ryu.lib.hub.Event object at 0x7f903ed084d0>, 'bgp_server_port': 179, 'local_as:
: 64512, 'refresh_max_eor_time': 0, 'refresh_stalepath_time': 0}
API method neighbor.create called with args: {'cap_mbgp_vpnv6': False, 'ip_addrs
ss': '172.17.190.3', 'cap_mbgp_vpnv4': False, 'remote_as': 64512, 'cap_mbgp_ipv'
': True}
API method neighbor.create called with args: {'cap_mbgp_vpnv6': False, 'ip_addrs
ss': '172.17.190.4', 'cap_mbgp_vpnv4': False, 'remote_as': 64512, 'cap_mbgp_ipv'
': True}
Connection to peer: 172.17.190.3 established
Connection to peer: 172.17.190.4 established
the best path changed: 64512 0.0.0.0/0 172.17.190.3 False
hub: uncaught exception: Traceback (most recent call last):
  File "/opt/ryu/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/opt/ryu/ryu/services/protocols/bgp/base.py", line 241, in start
    self._run(*args, **kwargs)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 97, in _run
    self._process_dest()
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 114, in _proces_
_dest
    next_dest.process()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 396, in prc
cess
    self._process()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 366, in _po
ocess
    new_best_path, reason = self._process_paths()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 485, in _po
ocess_paths
    current_best_path, reason = self._compute_best_known_path()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 588, in _cm
mpute_best_known_path
    next_path)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 252, in computeb
best_path
    best_path = _cmp_by_router_id(local_asn, path1, path2)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 495, in _cmp_byr
router_id
    local_bgp_id = path_source1.protocol.sent_open.bgpid
AttributeError: 'Peer' object has no attribute 'protocol'

Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
24f4a01bc4 library_bgp_speaker.rst: make an example more complete
also, while i'm here, remove trailing whitespaces in the example.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
eb602ab71d ofa_neutron_agent: Change the copyright notice
As a preparation to move this module to neutron repo,
change the copyright notice to the style commonly found there.

Also, add myself as co-author.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
e5f2cad6c0 ofa_neutron_agent: Remove unused logger instance
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
581674dd9b ofa_neutron_agent: Use AppManager.run_apps
No functional changes are intended.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
ecbb8640f5 AppManager: Add a convenient method to run apps
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
771fb79501 ofa_neutron_agent: Simplify
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
ISHIDA Wataru
c770172804 app_manager: prevent loading unnecessary RyuApps
don't load RyuApps which is just imported and not defined in the module.
for example, if we run the script "test.py" as shown below by

$ ryu run test.py

the past implementation loads and instantiates not only Test but also RyuApp
and DPSet. this patch fix this wrong behavior

test.py
===

from ryu.base.app_manager import RyuApp
from ryu.controller.dpset import DPSet

class Test(RyuApp):
    _CONTEXTS = {'dpset' : DPSet}

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
Yoshihiro Kaneko
03731ad04c package: add python-ryu-doc
This patch adds python-ryu-doc package which contains the HTML
documentation generated from doc/.
Also updates the man pages in doc/source/man/.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
Yuichi Ito
cc6dcbabaa sw test tool: Enable IPv6 flow label maskable
OF 1.3.4 spec (B.15.1 Changes) says:

    Make IPv6 flow label maskable (EXT-101).

This patch makes IPv6 flow label maskable, and adds a test file for IPv6 flow label with masks.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
YAMAMOTO Takashi
a2fc54bd79 document ryu.app.ofctl
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 12:13:14 +09:00
YAMAMOTO Takashi
e1f9e1e0a7 ws_topology: shut up pep8 for long lines in a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 12:13:13 +09:00
FUJITA Tomonori
3c3a29b535 bgp: support IPv6 peering
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 10:21:01 +09:00
YAMADA Hideki
dabcfaa856 Add GUI app
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
YAMADA Hideki
6650a97d8d ws_topology: Handle WebSocket disconnection
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
YAMADA Hideki
e1cd4325eb ws_topology: Avoid controller name confliction
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
Yoshihiro Kaneko
712d599f54 add debian files to make packages for Ubuntu
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-17 06:50:42 +09:00
YAMAMOTO Takashi
4f19fc54cd app_manager: Stop checking h.callers in get_handlers()
dynamically registered handlers (vs. ones registered via
set_ev_cls/handler decorators) do not necessarily have h.callers.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-17 06:50:41 +09:00
FUJITA Tomonori
ba9621627d bgp: catch socket error with sendall
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00
FUJITA Tomonori
f513b8751d bgp: use sendall with lock
With the current design, multiple greenlets calls sendall() on a
single tcp socket. This leads to a corrupted bgp message.

This patch introduces mutex to work around the problem. However, I
hope that we _fix_ the design where only one greenlet call sendall()
on a signel tcp socket in the future.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00
FUJITA Tomonori
783663afb2 bgp: use TCP_NODELAY for bgp connection
Disables Nagle to send data immediately.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00
Yoshihiro Kaneko
8d6f150b58 ryu.lib.hub: add logging wrapper for wsgi server
This patch adds a wrapper to relay the log of the wsgi server to the logger.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-15 21:33:07 +09:00
Yoshihiro Kaneko
78a9a20270 contrib: import tinyrpc library
https://pypi.python.org/pypi/tinyrpc/0.5
https://github.com/mbr/tinyrpc

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-15 21:33:07 +09:00
Yoshihiro Kaneko
dbb143f972 downgrade required version of msgpack-python
For Ubuntu 14.04, downgrade the required version of msgpack-python.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-15 21:33:07 +09:00
YAMADA Hideki
a5c1841e44 app_manager: Let application module to use require_app()
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-14 22:44:56 +09:00
FUJITA Tomonori
5474bf214c bgp: add bgpspaker module for non Ryu application usage
This enables you to use Ryu BGP feature as 'bgp speaker' python
library, that is, without ryu-manager, RPC API, REST API, or other Ryu
stuff, you can use Ryu BGP feature in your python application (just
import bgpspeaker.py). The sample code and the API reference docs are
included too.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-06-13 08:05:25 +09:00
Yoshihiro Kaneko
6fbd67e29b fix failure of instantiating app
For example, app-A has app-X in CONTEXTS, and app-B depends on app-X as
SERVICE.  When app-B is specified in the app-lists before app-A, the
instantiating app-X fails by an assertion.

$ PYTHONPATH=. bin/ryu-manager ryu.app.quantum_adapter ryu.app.gre_tunnel
loading app ryu.app.quantum_adapter
loading app ryu.app.gre_tunnel
loading app ryu.controller.dpset
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app None of QuantumIfaces
creating context quantum_ifaces
instantiating app None of ConfSwitchSet
creating context conf_switch
instantiating app None of Network
creating context network
instantiating app None of Tunnels
creating context tunnels
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.gre_tunnel of GRETunnel
instantiating app ryu.controller.dpset of DPSet
Traceback (most recent call last):
  File "/opt/stack/ryu/bin/ryu-manager", line 19, in <module>
    main()
  File "/opt/stack/ryu/ryu/cmd/manager.py", line 77, in main
    services.extend(app_mgr.instantiate_apps(**contexts))
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 434, in instantiate_apps
    self._instantiate(app_name, cls, *args, **kwargs)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 421, in _instantiate
    register_app(app)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 50, in register_app
    assert app.name not in SERVICE_BRICKS
AssertionError

This patch avoid the double loading of app in context and service.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-11 15:40:24 +09:00
FUJITA Tomonori
a13f22337d fix: wrong copyright
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-11 07:03:46 +09:00
Yuichi Ito
6b9cfd3674 sw test tool: Improve readability of IP mask values
4294967040
->  "255.255.255.0"

    4294902015
->  "255.255.0.255"

    340282366920938463463374607431768145920
->  "ffff:ffff:ffff:ffff:ffff:ffff:ffff:0"

    5192296858534827628530496329220095
->  "0:ffff:ffff:ffff:ffff:ffff:ffff:ffff"

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:12:59 +09:00
Yuichi Ito
93c7c1e064 sw test tool: Improve readability of MAC mask values
1099511627775
->  "00:ff:ff:ff:ff:ff"

    281474976710400
->  "ff:ff:ff:ff:ff:00"

    281474959998975
->  "ff:ff:ff:00:ff:ff"

    281470698520575
->  "ff:ff:00:ff:ff:ff"

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:12:59 +09:00
Yuichi Ito
ae69bf231e sw test tool: Improve readability of padding data
str(\"\\x00\" * (60 - 42))
->  str('\\x00' * (60 - 42))

    str(\"\\x11\" * (1500 - 54))
->  str('\\x11' * (1500 - 54))

    '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'
->  str('\\x00' * 30)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:12:58 +09:00
Yuichi Ito
3bfddf9e07 sw test tool: Improve readability of tcp options
option='\\x00\\x00\\x00\\x00'
->  option=str('\\x00' * 4)

    option='\\x11\\x11\\x11\\x11'
->  option=str('\\x11' * 4)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:12:58 +09:00
Kiyonari Harigae
b3d75d14ea rest_qos: Enable queue setting to interface individually
Added an option command to enable the queue setting to interface
individually.  Also, some minor fixes.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:12:26 +09:00
takahashi.minoru
cfdce1f340 packet lib: add Connectivity Fault Management Protocol(CFM, IEEE 802.1ag)
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:11:52 +09:00
YAMAMOTO Takashi
ed25eefa84 app_manager: Fix a crash in unregister_handler
This fixes a regression introduced by commit d3f8f4eb.
("RyuApp: delete a key without handlers when unregistering a handler")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-10 21:11:46 +09:00
FUJITA Tomonori
5be7310ce2 Ryu 3.10
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-03 23:17:12 +09:00
Yoshihiro Kaneko
482bbc97b9 doc: add test-of-config-with-linc page
port from wiki page.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-03 22:51:56 +09:00
Yoshihiro Kaneko
6eb3417388 doc: add test-vrrp page
port from wiki page.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-03 22:51:54 +09:00
takahashi.minoru
f0df43b4b3 ofctl_v1_2: fix errors of get_flow_stats
following match fields caused an exception at get_flow_stats command:

  ipv6_nd_sll, ipv6_nd_tll

this patch fixes this problem.

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-03 22:49:43 +09:00
takahashi.minoru
4c341853a5 ofctl_v1_2: fix pep8
ryu/lib/ofctl_v1_2.py:444:15: E127 continuation line over-indented for visual indent

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-03 22:49:13 +09:00
ISHIDA Wataru
afc0b98b20 bgp: remove unnecessary OutgoingRoute attribute 'bgp4_format'
Attribute 'bgp4_format' was intended to be used to decide whether to
construct UPDATE msg in bgp4 format or mpbgp format.
But we can decide this simply by checking the path type which we are going
update. If the path type is IPv4, we use bgp4 format. In other cases,
we use mpbgp format.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 12:02:03 +09:00
ISHIDA Wataru
2c7ca2ff2d bgp: fix typo
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 12:01:58 +09:00
ISHIDA Wataru
1f316cf1c1 bgp: fix bug of exchanging paths between vrf and global_table
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 12:01:48 +09:00
ISHIDA Wataru
49dcfa5c0d packet/bgp: add route distinguisher classes and refine codes
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 12:01:39 +09:00
ISHIDA Wataru
44725bce37 bgp: keep and use nexthop value as a string internally
Instead of BGPPathAttributeNextHop, keep nexthop value as a string.
Convert it to string as we get Update msg.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 12:01:28 +09:00
takahashi.minoru
24cc165d87 ofctl_v1_2/3: MAC arbitrary bitmask support
ofctl_rest is now enabled to use MAC arbitrary bitmask as follows:

  curl -X POST -d '{"dpid": 1,
                    "actions":[{"port":2, "type":"OUTPUT"}],
                    "match":{"dl_dst":"01:02:03🆎cd:ef/ff:ff:ff:ff:00:00"}}' http://localhost:8080/stats/flowentry/add

And now enabled to display as follows:

  curl http://localhost:8080/stats/flow/1
    {
      "1": [
        {
          "actions": ["OUTPUT:2"],
          "idle_timeout": 0,
          "cookie": 0,
          "packet_count": 0,
          "hard_timeout": 0,
          "byte_count": 0,
          "duration_nsec": 951000000,
          "priority": 0,
          "duration_sec": 35,
          "table_id": 0,
          "match": {"dl_dst": "01:02:03🆎00:00/ff:ff:ff:ff:00:00"}
        }
      ]
    }

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-02 09:44:50 +09:00
FUJITA Tomonori
86a975aca6 bgp: add 'neighbors.get' and 'show.rib' JSON RPC API
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-28 12:36:21 -07:00
FUJITA Tomonori
45ac298d01 bgp: add JSON RPC API
Adds JSON RPC API on web socket to dynamically configure bgp. This is
the initial support (there are still tons of APIs that are not
exported via JSON RPC API).

$ sudo PYTHONPATH=.:$PYTHONPATH ryu-manager ryu/services/protocols/bgp/api/jsonrpc.py ryu/services/protocols/bgp/application.py

then you can configure on another terminal:

~ fujita$ wsdump.py ws://127.0.0.1:8080/bgp/ws
Press Ctrl+C to quit
> {"jsonrpc": "2.0", "id": 1, "method": "core.start", "params" : {"as_number":64512, "router_id":"10.0.0.2"}}
< {"jsonrpc": "2.0", "id": 1, "result": {}}
> {"jsonrpc": "2.0", "id": 1, "method": "neighbor.create", "params" : {"ip_address":"192.168.177.32", "remote_as":64513}}
< {"jsonrpc": "2.0", "id": 1, "result": {}}
> {"jsonrpc": "2.0", "id": 1, "method": "network.add", "params" : {"prefix":"10.20.0.0/24"}}
< {"jsonrpc": "2.0", "id": 1, "result": {}}

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 13:27:51 -07:00
FUJITA Tomonori
85c1917f7e bgp: set bgp-config-file default None
allowing not use a config file.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 13:27:51 -07:00
FUJITA Tomonori
a1416d6205 bgp: fix non configured peer exception
peer is None if the connection comes from non configured bgp peer.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 13:27:51 -07:00
ISHIDA Wataru
3dedb06c16 bgp: import lacking constants
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 05:28:14 -07:00
Yoshihiro Kaneko
2eb59a09ff doc: add components page
port from wiki.

dummy quantumclient is necessary to import ryu.app.quantum_adapter by
sphinx.ext.autodoc.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
2014-05-27 20:24:50 +09:00
FUJITA Tomonori
25e19df614 bgp: use host's ssh host key if not specified
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:39 +09:00
Yuichi Ito
5c78159a36 sw test tool: Add default test files (group:all/select)
These test files aim to examine 'group action' of FlowMod message.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
525a4a11ee sw test tool: Enable sending packets using random values
The switch test tool is now enabled to send packets using random values as follows:

        "tests":[
            {
                "ingress":{
                    "packets":{
                        "data":[
                            "ethernet(dst=netaddr.EUI(randint(0, 2 ** 48 - 1)), ethertype=2048)",
                            "ipv4(proto=6, src=netaddr.IPAddress(randint(0, 2 ** 32 - 1)))",
                            "tcp(dst_port=randint(0, 2 ** 16 - 1))",
                            "str('\\x11' * (1500 - 54))"
                        ],
                        "pktps":1000,
                        "duration_time":30
                    }
                },
                "egress":{
                    "throughput":[
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":2
                                        }
                                    }
                                ]
                            },
                            "kbps":1500
                        }
                    ]
                }
            }
        ]

When ingress.packets.data includes 'randint', the switch test tool will send each packet using random values.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
af5267b4ab sw test tool: Enable parsing OFPGroupMod messages in 'prerequisite'
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
99ab1a4a95 sw test tool: Add support for confirmation of installed group entries
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
bd9c02d124 sw test tool: Add support for installation of group tables
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
1146d1da67 sw test tool: Add support for initialization of group tables
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:28 +09:00
Yuichi Ito
2b4500ab3d sw test tool: Add a link between switches
This change is for tests that use group_table.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-27 20:24:17 +09:00
Satoshi Kobayashi
41a52adaf8 wsgi: add ws_topology application
- Topology change is notified
  - JSON-RPC/WebSocket

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Reviewed-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-24 10:53:06 +09:00
Satoshi Kobayashi
aecc7b0af5 rest_topology: use decorator api
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Reviewed-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-24 10:52:55 +09:00
Yuichi Ito
d91f5e08f7 sw test tool: pylint
E:1026, 8: Instance of 'DummyDatapath' has no 'set_xid' member (but some types could not be inferred) (maybe-no-member)
E:1027, 8: Instance of 'DummyDatapath' has no 'send_msg' member (but some types could not be inferred) (maybe-no-member)

NOTE: These methods are never called. This patch is only for avoiding pylint error.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
0356f5ff22 sw test tool: Reduce similar methods of checking entries exist
All of _test_xxx_exist_chk() are merged as _test_exist_chk().

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
5ad4f2c212 sw test tool: Reduce similar methods of handling events
All of xxx_stats_reply_handler() are merged as stats_reply_handler().

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
d02ab63a7d sw test tool: Reduce similar methods of initializing flows
_test_initialize_flow_tester() is merged into _test_initialize_flow().

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
cc47d4d9f2 sw test tool: Reduce similar methods of deleting flows
OpenFlowSw.del_test_flow() and OpenFlowSw.del_flows_for_throughput_analysis() are merged as OpenFlowSw.del_flows().

And rename OpenFlowSw.del_test_meter() to OpenFlowSw.del_meters(), like OpenFlowSw.del_flows().

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
d73d3bb136 sw test tool: Reduce similar classes
TargetSw and TesterSw are merged as OpenFlowSw.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:52 +09:00
Yuichi Ito
fea1f610aa sw test tool: Remove an unnecessary wrapper method
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-21 17:50:51 +09:00
YAMADA Hideki
f27768650e simple_switch_websocket_13: Add get_arp_table RPC method
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-20 12:39:09 +09:00
YAMADA Hideki
192d693075 pip-requires: WebSocket-RPC requires tinyrpc
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-20 12:39:09 +09:00
YAMADA Hideki
377769e354 Add WebSocket JSON RPC feature
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-20 12:39:09 +09:00
YAMADA Hideki
55fe4e17ec simple_switch_websocket_13: fix typo
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-20 12:39:09 +09:00
Satoshi Kobayashi
7598ef0561 New API for WebSocket support
- API
 - @websocket decorator
 - WSGIApplication#websocketmanager()
- bugfix
 - Even if a connection is cut, it continues remaining
- remove restriction
 - Two or more connections can be accepted

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Reviewed-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-19 14:36:28 +09:00
YAMADA Hideki
eb0055f0ce Add PacketIn dumper websocket application
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 05:03:11 +09:00
YAMADA Hideki
7b6f638874 wsgi: Support WebSocket
- Hack webob.dec.wsgify for taking start_response function.
- Add websocket handshake helper method to controller.

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 05:03:11 +09:00
YAMADA Hideki
28339dd774 Import eventlet.websocket from master branch
Because eventlet 0.14 doen't support RFC 6455.

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 05:03:11 +09:00
YAMADA Hideki
73e16c15cc hub: import semaphore
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 05:03:10 +09:00
Yuichi Ito
ca1b271705 tester: cleanup the code of couting the results
Reported-by: Chiu,Cheng-Han <a54931232@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 04:40:43 +09:00
Chiu,Cheng-Han
200241a66d tester: let each attribute of meter had a chance to be compared.
Signed-off-by: Chiu,Cheng-Han <a54931232@gmail.com>
Reviewed-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-16 04:40:00 +09:00
Yoshihiro Kaneko
ee5bf73b73 add openflow api reference for of1.4
Update OpenFlow API document.
- add OpenFlow 1.4 API Reference
- update OpenFlow API Reference index for OF1.4

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-15 08:00:35 +09:00
Yoshihiro Kaneko
fe8d8e27c5 app/rest_qos: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 15:53:02 +09:00
Yoshihiro Kaneko
6ab117db4f add pep8 options to tox.ini
Add the pep8 section to tox.ini and specify ignoring E113.
Many E113 errors appeared on comments. It seems a bug of pep8, so it can be ignored.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 15:39:33 +09:00
Yoshihiro Kaneko
857ec0c019 tests/unit: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:58 +09:00
Yoshihiro Kaneko
bd61cd5dd1 tests: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:58 +09:00
Yoshihiro Kaneko
c468fdd126 services/protocols: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:58 +09:00
Yoshihiro Kaneko
039f9a154c lib/xflow: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:58 +09:00
Yoshihiro Kaneko
c38270ce12 lib/packet: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:57 +09:00
Yoshihiro Kaneko
853bdeb1c3 lib/of_config: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:20:08 +09:00
Yoshihiro Kaneko
3f46c5a2ff lib: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Yoshihiro Kaneko
16839dfc68 controller: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Yoshihiro Kaneko
89a428b10b app: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Yoshihiro Kaneko
f295487bef topology/switches: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Yoshihiro Kaneko
f79634b3c7 base/app_manager: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Yoshihiro Kaneko
df8f807e13 ofproto: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-14 13:19:16 +09:00
Kiyonari Harigae
01bf2ca349 Added rest_qos module
This module is intended for operation in a pipeline on a flow table.
It supports setting of the queue, (Currently, only support
OpenvSwitch), packet marking, queuing, regitation to meter table,
perform this simple QoS.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-13 14:43:22 +09:00
ISHIDA Wataru
abafab9149 packet/bgp: bug fix of route target nlri class
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:57 +09:00
ISHIDA Wataru
b65d6dc315 bgp: fix bug of accessing dead socket
BGP session can be closed by sending inappropriate messages.
So touching socket by get_peername() after sending messages may cause an
exception. Though we can handle this by try..exception, I fixed to simply
call get_peername() before sending messages because session disconnection by
sending messages is an ordinary procedure and not an exception(the peer will
send notification before disconnection).

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:57 +09:00
ISHIDA Wataru
2430fc7c17 bgp: improve how to show rib
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
e3a3c7dc0c bgp: fix typo
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
4f8d7a1411 packet/bgp: enhanced route refresh support
Enhanced Route Refresh(draft-ietf-idr-bgp-enhanced-route-refresh) uses
reserved fields in a Route Refresh message as demarcation fileds.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
c560908633 packet/bgp: fix bug in serializing AS PATH path attribute
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
7c1410ccf6 bgp: add ssh client
add ssh client which has basic bash keybinds and tab complement.
to use, you have to create ssh key at first then specify the location of
the key in ryu configuration files.

configuration file will be like this.

> ryu.conf
> ==
> [DEFAULT]
> cli_ssh_hostkey=/home/user/.ssh/id_rsa

after this, run operator/ssh.py with application.py

$ ryu-manager --config-file=ryu.conf application.py operator/ssh.py

you can login by

$ ssh ryu@localhost -p 4990

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
eb488e3cb3 bgp: fix wrong module path
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
ca923a35bf packet/bgp: add helper methods to nlri class for bgp ssh client
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
1d97ac1727 bgp: don't block at start method
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
6da9cf0187 bgp: bug fix when the peer initiated the connection.
set binded ip and port properly regardless of the direction of connection

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
ISHIDA Wataru
2d00b7d424 bgp: remove unnecessary log message
update msg without MpReachNlri or MpUnReachNlri is now normal

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-10 01:14:56 +09:00
Yuichi Ito
aad58663c0 set default attributes for OFPPortMod
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
2014-05-10 00:17:12 +09:00
Yuichi Ito
bee4846bc2 sw test tool: pylint
W:546,14: Access to a protected member _send_msg of a client class (protected-access)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
2014-05-10 00:17:12 +09:00
Yuichi Ito
5e60f0250c sw test tool: Remove unused codes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
2014-05-10 00:17:12 +09:00
Yuichi Ito
f7ca84d4ce sw test tool: Reduce similar methods
- _test_flow_install()
 - _test_meter_install()

are merged as

 - _test_msg_install()

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
2014-05-10 00:17:12 +09:00
Kiyonari Harigae
882c28820f Added queue stats request
Here is added queue status request to ofctl.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-09 23:57:17 +09:00
Kiyonari Harigae
73674f4631 Added ovs-vsctl commands of QoS-related
Here is added the command of QoS-related, such as the following:

ovs-vsctl -- set port eth1 qos=@newqos \
 -- --id=@newqos create qos type=linux-htb other-config:max-rate=30000000 queues=0=@q0,1=@q1 \
 -- --id=@q0 create queue other-config:min-rate=1000000 other-config:max-rate=1000000 \
 -- --id=@q1 create queue other-config:min-rate=2000000 other-config:max-rate=2000000

Also, operation that delete QoS is supported.
Note that It supports only deletion of relationships with QoS record.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-09 23:57:16 +09:00
FUJITA Tomonori
4c72789a1c Ryu 3.9
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-05-01 17:49:39 +09:00
Yuichi Ito
56528cfd00 sw test tool: Modify lengths of pad fields for ARP
Wireshark may misunderstand a MAC frame (including ARP) whose length is 64 bytes or more, as a frame with the FCS field.
This patch fixes the issue by modifying lengths of pad fields for ARP.

This patch modifies lengths of pad fields as follows:

 - Add 18 bytes for MAC frames (including ARP, without VLAN/MPLS/PBB).
 - Add 18 bytes for MAC frames related to POP_MPLS/POP_PBB.

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:44 +09:00
Yuichi Ito
8ac3968af4 sw test tool: Revert changes of test files
This reverts commit d1b9e371dbfd130cf6685046de287bfd79d8a164.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:43 +09:00
Simon Horman
a6f5109f07 tests/integrated: Enable MPLS set-field and push MPLS tests
Enable disabled MPLS tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
55ec423e25 tests/integrated: Match on MPLS dl_type for flows with MPLS TTL actions
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above MPLS TTL actions are inconsistent if the flow
does not match on one of the MPLS dl_types.

This patch add such a match for the flows that have MPLS TTL actions.

Also enable these tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
f6e1fa4c57 tests/integrated: Match on MPLS dl_type for flows with pop MPLS actions
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above pop MPLS actions are inconsistent if the flow
does not match on one of the MPLS dl_types.

This patch add such a match for the flow that has a pop MPLS action.

Also enable the pop MPLS test, it appears to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
9e5e9ce56c tests/integrated: Match on IP dl_type for flows with set IPv6 addresses
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above the set-field actions for IPv6 addresses are
inconsistent if it the flow does not match on the IPv6 dl_type.

This patch add such a match for those that have set-field actions
for IPv6 addresses.

Also enable these tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
a88bdffab3 tests/integrated: Enable ARP tests
Enable ARP tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
d5e433ee04 tests/integrated: Match on IP dl_type for flows with set NW TTL actions
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above the set NW TTL action is inconsistent if
it the flow does not match on the IPv4 or IPv6 dl_type because
the action manipulates either the IPv4 TTL or the IPv6 hop limit.

This patch splits the testing of the set NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.

Also enable these tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:33 +09:00
Simon Horman
ec02de8d7a tests/integrated: Match on VLAN tag for flows which set VLAN tags
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above a set-field action for a VLAN tag is considered
inconsistent if it the flow does not match on a VLAN tag.

This patch add such a match for the flow that has a set-field action
for a VLAN tag.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for set-field actions for
VLAN tags.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:26 +09:00
Simon Horman
756521f0b4 tests/integrated: Match on VLAN tag for flows with pop VLAN TTL actions
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above the pop ttl action is considered inconsistent if
it the flow does not match on a VLAN tag.

This patch add such a match for the flow that has a pop VLAN action.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the pop VLAN TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:26 +09:00
Simon Horman
47856c381c tests/integrated: Match on IP dl_type for flows with dec NW TTL actions
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above the dec NW TTL action is inconsistent if
it the flow does not match on the IPv4 or IPv6 dl_type because
the action manipulates either the IPv4 TTL or the IPv6 hop limit.

This patch splits the testing of the dec NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the dec NW TTL action.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:49:26 +09:00
Simon Horman
1d1c3b8751 tests/integrated: Do not verify buffer_id of packet_in resulting from packet_out
When a packet_in message results from a packet_out message
there is no particular relationship between the buffer_ids of
the two messages.

I noticed this when using Open vSwitch's "make ryu-check".

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:41:16 +09:00
Yuichi Ito
d1b9e371db sw test tool: Modify lengths of pad fields for ARP
Wireshark may misunderstand a MAC frame (including ARP) whose length is 64 bytes or more, as a frame with the FCS field.
This patch fixes the issue by modifying lengths of pad fields for ARP.

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:10:03 +09:00
takahashi.minoru
9c5e9288cc packet lib: ipv6: support Routing header (type3)
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:41 +09:00
Yuichi Ito
0f8407a9ce sw test tool: Fix MAC addresses used in tests
IEEE 802.3-2012 (3.2.3 Address fields) says:

 b) The first bit (LSB) shall be used in the Destination Address field as an address type designation bit
    to identify the Destination Address either as an individual or as a group address. If this bit is 0, it
    shall indicate that the address field contains an individual address. If this bit is 1, it shall indicate that
    the address field contains a group address that identifies none, one or more, or all of the stations
    connected to the LAN. In the Source Address field, the first bit is reserved and set to 0.
 c) The second bit shall be used to distinguish between locally or globally administered addresses. For
    globally administered (or U, universal) addresses, the bit is set to 0. If an address is to be assigned
    locally, this bit shall be set to 1. Note that for the broadcast address, this bit is also a 1.

This patch fixes MAC addresses used in tests as follows:

 - set the first bit to 0
 - set the second bit to 1

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:34 +09:00
Simon Horman
4a38237357 tests/integrated: Use table_id greater than the current table for goto-table instruction
For a goto-table instruction use a table_id greater than the table in which
a flow will be inserted.  OpenFlow 1.2 section 5.6 stipulates that this is
required.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces the above stipulation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:24 +09:00
Simon Horman
9664f3b9e3 tests/integrated: Specify table_id for flow_mod modify tests
Use actual table ids rather than OFPTT_ALL for
flow_mod modify tests as OpenFlow 1.2 section A3.4.1
stipulates that OFPTT_ALL is only valid for flow_mod delete requests.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces the above stipulation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:17 +09:00
FUJITA Tomonori
66759d76dd bgp: fix connect timeout error
RROR 2014-04-23 11:54:59,239 hub 58 hub: uncaught exception: Traceback (most recent c\
all last):
  File "/Users/fujita/git/ryu/ryu/lib/hub.py", line 50, in _launch
    func(*args, **kwargs)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 239, in start
    self._run(*args, **kwargs)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 448, in _run
    self._connect_loop(client_factory)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 820, in _conne\
ct_loop
    bind_address=bind_addr)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 354, in _conne\
ct_tcp
    return sock
UnboundLocalError: local variable 'sock' referenced before assignment

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 07:32:06 +09:00
FUJITA Tomonori
ce1c6c0c1e bgp: add __init__.py files
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 07:32:04 +09:00
takahashi.minoru
b47fa61dd3 packet lib: ipv6: Fix to calculate AH length
RFC2402 says:

    All IPv6 extension headers, as per RFC 1883, encode the "Hdr Ext Len" field by first
    subtracting 1 (64-bit word) from the header length (measured in 64-bit words).
    AH is an IPv6 extension header.  However, since its length is measured in 32-bit words,
    the "Payload Length" is calculated by subtracting 2 (32 bit words).

This patch fixes as follows:

    return (int(size) - 1) * 8 ->
    return (int(size) + 2) * 4
                      ^ ^    ^
And, this patch also fixes a default argument of length.

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 22:22:58 +09:00
ISHIDA Wataru
57166dc485 bgp: fix pep8
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
8bda92da85 bgp: add sample configuration file
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
4488761fb5 bgp: improve log visibility
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
d8407d445d bgp: avoid the trouble of having to explicitly specify IDs in configuration
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
8b07123c91 bgp: enable to use system IP addr implicitly for binding
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
ce33b61a1f bgp: enable default label range
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
d262c1bcb6 bgp: make bgpspeaker RyuApp
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
3a4f092de5 bgp: use ryu.lib.hub instead of the direct use of eventlet
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
68c13b7fa1 bgp: clean up codes which constructs an update message
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
2eccc5da41 bgp: fix typo
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:34 +09:00
FUJITA Tomonori
128fd85c13 remove obsolete man pages (rpc_cli and neutron_ofagent_agent)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:07:22 +09:00
FUJITA Tomonori
28f6f6020a delete bin/neutron-ofagent-agent
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-21 19:06:25 +09:00
FUJITA Tomonori
78d0b08048 delete ryu/tests/bin/of-config-cli
This command is available via ryu command.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:05:47 +09:00
FUJITA Tomonori
95fa2d63d4 delete bin/rpc-cli
This command is available via ryu command.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:05:46 +09:00
YAMAMOTO Takashi
86da3d9939 document ryu command
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-20 21:00:57 +09:00
YAMAMOTO Takashi
769fb62ca9 add bin/ryu to PYLINT_INCLUDE
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-20 21:00:56 +09:00
YAMAMOTO Takashi
ce2f39a720 add bin/ryu
this new command takes a sub-command name as its first positional argument
and passes the rest of arguments to the corresponding sub-module.
for example, 'run' sub-command is an equivalent to bin/ryu-manager.

this commit does not replace the existing commands like ryu-manager.
this merely adds new ways to invoke the functionalities.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 21:00:51 +09:00
YAMAMOTO Takashi
7d1fcd7581 pip-requires: require oslo.config >= 1.2.0
specifically we want their commit de803cdf
(Change-Id: If712e1d51c1e1329093acb16ed6a84e9f0baf8c1)
for stable order of cli options.
the following sub-command commits rely on it.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
YAMAMOTO Takashi
e88529f966 allow overriding argv and progname
this will be used by the comming 'ryu' command.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
YAMAMOTO Takashi
186da7eb78 ryu.cfg: re-export some more stuff for convenience
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
Yuichi Ito
51ec3d2d7b sw test tool: Fix to compare OFPMatch using masks without byte boundary
Mask lengths without byte boundary are fixed as follows:

 - VLAN_VID, from 16 bits (2 bytes) to 12 + 1 bits
 - IPV6_EXTHDR, from 16 bits (2 bytes) to 9 bits

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-18 18:42:49 +09:00
ISHIDA Wataru
660c8e68b4 bgp: remove original bgp packet library
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
ISHIDA Wataru
9d5e66fa4e bgp: use ryu bgp packet library instead of original one
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
ISHIDA Wataru
bdad6267de bgp: add stuff for integration with bgp speaker
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
FUJITA Tomonori
a1fe3d92db Rename to CONTRIBUTING.rst
This makes the GitHub interface aware of the contribution guidelines,
so it will be displayed to contributors when they submit issues or
pull requests.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:56:59 +09:00
Yuichi Ito
f4d3c5616d of14: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:25 +09:00
Yuichi Ito
f516474c10 of13: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:23 +09:00
Yuichi Ito
97e8827681 of12: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:22 +09:00
Yuichi Ito
d083895961 sw test tool: Correct the comparison method to treat matches as the set
OF 1.3.3 spec (3 Glossary) says:

    Flow Entry: an element in a flow table used to match and process packets. It contains a set of
    match fields for matching packets, a priority for matching precedence, a set of counters to track
    packets, and a set of instructions to apply (see 5.2).

According to OF spec, the match fields are treated as the set.
This means that the order of matches which flow_stats message returns is inconsistant.
This patch corrects the comparison method of matches by sorting in a particular order before comparison.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:14 +09:00
Yuichi Ito
bff6008488 sw test tool: Fix to compare OFPMatch ignoring fields that masks are all zero bits
OF 1.3.3 spec (7.2.3.5 Flow Match Field Masking) says:

    An all-zero-bits oxm_mask is equivalent to omitting the OXM TLV entirely. An all-one-bits oxm_mask
    is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.

This patch fixes to compare OFPMatch ignoring fields that masks are all zero bits.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:13 +09:00
Yuichi Ito
02cce18108 sw test tool: Fix to compare OFPMatch ignoring masks that are all one bits
OF 1.3.3 spec (7.2.3.5 Flow Match Field Masking) says:

    An all-zero-bits oxm_mask is equivalent to omitting the OXM TLV entirely. An all-one-bits oxm_mask
    is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.

This patch fixes to compare OFPMatch ignoring masks that are all one bits.

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:12 +09:00
Hiroaki KAWAI
2d7053ac0b fix pbb itag related tests
i-tagged packets will have ETH_TYPE=0x88E7. The tests are
rewritten in the same way with MPLS.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 22:17:43 +09:00
FUJITA Tomonori
d3f8f4eb4c RyuApp: delete a key without handlers when unregistering a handler
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 09:51:26 +09:00
YAMAMOTO Takashi
92ef0bdbb5 ryu.app.ofctl: raise exceptions on openflow error messages
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
598c3c5e75 ryu.app.ofctl: implement multipart
an example:
    msg = parser.OFPPortDescStatsRequest(datapath=datapath)
    result = ofctl.api.send_msg(self, msg,
                                reply_cls=parser.OFPPortDescStatsReply,
                                reply_multi=True)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
7265edc236 ryu.app.ofctl: implement reception of reply message
an example:
    msg = parser.OFPEchoRequest(datapath=datapath)
    result = ofctl.api.send_msg(self, msg, reply_cls=parser.OFPEchoReply)
    assert isinstance(result, parser.OFPEchoReply)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
5f57cfd16a ofp_event: add a function to find Event class for given OFP class
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
a4a77546d8 RyuApp: add methods to observe/unobserve specific event dynamically
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
5b34514c99 RyuApp: allow observing events without having handlers
this will be used by ofctl app which registers handlers dynamically.
when unobserving an event cls dynamically, there might be events of
the cls left in app's event queue already.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
b75cd0c0bd RyuApp.get_handlers: restructure code and add a comment
no functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
6ccec65aaf RyuApp: add a method to unregister a handler
this method undos register_handler.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
77e82d3111 controller.handler: simplify code
and use consistent variable names.  no functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
d27deb34be controller.handler: use normal classes rather than a namedtuple
and add some comments.  no functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
97bf63e7c7 controller.handler: g/c now unused code
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:51 +09:00
Yuichi Ito
f00952b0af igmplib: Fix a problem that querier stops sending a query message
When QUERY timeout expires, a variable for flooding is overwritten unexpectedly.
So querier stops sending a query message any longer.
This patch fixes the problem.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-07 10:14:41 +09:00
FUJITA Tomonori
792c75c6a1 Ryu 3.8
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-02 11:08:05 +09:00
FUJITA Tomonori
40da85eca2 bgp: fix pep8
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
7c67afd263 bgp: enable to propagate ipv4 networks
Newly add an api network.add to add a ipv4 network to propagate.
Networks can be registered in configure file using networks direction

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
b1a3201705 bgp: improved debug message in neighbor creation
show neighbor's IP address instead of meaningless string

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
498611c32d bgp: changed default configuration value for ease of use with bgp4
changed to enable bgp4 and disable mpbgp and enhanced refresh in default

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
e772be8717 bgp: use hub.Event to wait for the core_service boot instead of sleep
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
77a6afa309 bgp: enable to show ipv4 rib
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:16 +09:00
ISHIDA Wataru
06c84f4b05 bgp: send BGP UPDATE msg in BGP4 format when nlri is ipv4
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:15 +09:00
ISHIDA Wataru
706cd11ce3 bgp: handle non-MPBGP UPDATE msg
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:15 +09:00
ISHIDA Wataru
f813ec4232 bgp: remove inappropriate assertion assuming only MPBGP (not BGP4)
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:14 +09:00
ISHIDA Wataru
f5543f9e20 bgp: fix wrong path
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:29:02 +09:00
FUJITA Tomonori
e1e89ce57f add BGP daemon feature
Currently, the BGP code can work as an daemon (IOW, not RyuApp).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 17:28:53 +09:00
Yuichi Ito
d6bbd83497 ofctl_v1_3: Fix to enable using meter flags multiply
ofctl_rest is now enabled to parse flags multiply as follows:

  curl -X POST -d '{"dpid": 1,
                    "meter_id": 1,
                    "flags": ["KBPS", "BURST"],
                    "bands": [{"type": "DROP", "rate": 1000}]}' http://localhost:8080/stats/meterentry/add

And now enabled to show flags as follows:

  curl http://localhost:8080/stats/meterconfig/1

  {
    "1": [
      {"bands": [{"burst_size": 0, "rate": 1000, "type": "DROP"}],
       "flags": ["KBPS", "BURST"], "meter_id": 1}
    ]
  }

Reported-by: cheers <cnmjbm@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-01 07:14:11 +09:00
Yuichi Ito
d0cd13a660 stplib: reduce unnecessary constant
and correct the inaccurate dispatchers.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:52 +09:00
Yuichi Ito
c8a588dc5b sw test tool: Add default test files (meter)
These test files aim to examine 'meter instruction' of FlowMod message.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:35 +09:00
Yuichi Ito
7e84cfac08 sw test tool: Add support for throughput analysis
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:29 +09:00
Yuichi Ito
1ff8957d70 sw test tool: Enable throughput analysis
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:29 +09:00
Yuichi Ito
268bd42aae sw test tool: Add support for getting throughput
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:29 +09:00
Yuichi Ito
77893716dc sw test tool: Add support for installation of flows for throughput analysis
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:17 +09:00
Yuichi Ito
de80a1755a sw test tool: Add support for deletion of flows for throughput analysis
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:17 +09:00
Yuichi Ito
610fd110fe sw test tool: Enable parsing a new 'egress' format
The format is for throughput analysis.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:17 +09:00
Yuichi Ito
897dd9c5d0 sw test tool: Enable sending packets continuously
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:06 +09:00
Yuichi Ito
477b1ce33d sw test tool: Rename STATE_UNMATCH_PKT_SEND to STATE_SEND_BARRIER
And rename _test_unmatch_packet_send() to _test_send_barrier().

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:06 +09:00
Yuichi Ito
9ef560ec47 sw test tool: Refactor packet sending processes
Methods of STATE_FLOW_MATCH_CHK and STATE_UNMATCH_PACKET_SEND have similar processes that send a packet.
This patch refactors this redundancy.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:06 +09:00
Yuichi Ito
867062f586 sw test tool: Add support for sending packets continuously
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:06 +09:00
Yuichi Ito
3b7b40d9a6 sw test tool: Enable parsing a new 'ingress' format
The format is for sending packets continuously.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:43:06 +09:00
Yuichi Ito
f9f88f4409 sw test tool: Enable parsing OFPMeterMod messages in 'prerequisite'
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:42:47 +09:00
Yuichi Ito
acdfd2347d sw test tool: Add support for confirmation of installed meter entries
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:42:47 +09:00
Yuichi Ito
35688fc753 sw test tool: Add support for installation of meter entries
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:42:47 +09:00
Yuichi Ito
50e9cdaf19 sw test tool: Add support for initialization of meter tables
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:42:47 +09:00
Yuichi Ito
ee78b87267 sw test tool: Rename STATE_INIT to STATE_INIT_FLOW
And rename _test_initialize() to _test_initialize_flow().

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-30 10:42:46 +09:00
FUJITA Tomonori
35d5104a3d remove ryu.cmd.ofa_neutron_agent from console_scripts in setup.cfg
unnecessary because neutron's setup.py creates the script for us.

Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-27 19:52:06 +09:00
FUJITA Tomonori
0d377522a8 of: set TCP_NODELAY for secure channel socket
Due to Nagle, an OF message that an application sends might be not
delivered to a switch immediately. This patch disables Nagle. This has
bad effect on throughput. I think that the latency matters for any
management channel. To avoid throughput drop, we could use TCP_CORK on
Linux but it's linux specific.

Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-26 06:12:18 +09:00
YAMAMOTO Takashi
e33a59554d vrrp tests: update comments
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:22:14 +09:00
YAMAMOTO Takashi
a19d99442f vrrp.api: request ryu.services.protocols.vrrp.manager
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:22:14 +09:00
YAMAMOTO Takashi
d70c9aed32 ryu.topology.api: request ryu.topology.switches
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:22:14 +09:00
YAMAMOTO Takashi
a9d7f1b199 test_vrrp_multi.sh: allow overriding ovs-vsctl
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:22:14 +09:00
YAMAMOTO Takashi
1c8f3b2c33 vrrp: update after ryu.topology.api change
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:22:14 +09:00
YAMAMOTO Takashi
1bdcc2b3aa rest_topology: update after ryu.topology.api change
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:21:51 +09:00
Isaku Yamahata
7de6dbdb44 topology: split out exported API from the implementation
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:21:51 +09:00
YAMAMOTO Takashi
efe84061e9 ofa_neutron_agent: no need to load ofctl.service explicitly anymore
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:21:51 +09:00
YAMAMOTO Takashi
990a7b82c9 ryu.app.ofctl.api: request ryu.app.ofctl.service
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:21:51 +09:00
YAMAMOTO Takashi
cd615a2f04 app_manager: add a function to request to load the server application
this is similar to handler.register_service but for client-server
style applications.  register_service is not appropriate for such
applications becuase normally the client does not consume
(in the sense of set_ev_cls) asynchronous events from the server.

note: this automatically load the server only if "api" module is
directly loaded from the module defining the client application.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:21:51 +09:00
YAMAMOTO Takashi
07c3aa1bf8 doc: remove a stale reference
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:05:38 +09:00
YAMAMOTO Takashi
084ed12bd4 add ryu-manager to PYLINT_INCLUDE
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 23:05:21 +09:00
ISHIDA Wataru
af7220ac34 ofctl_rest: use multistage @set_ev_cls
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 21:38:35 +09:00
ISHIDA Wataru
80ff7368fe enable multistage @set_ev_cls or @set_ev_handler
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 21:38:34 +09:00
YAMAMOTO Takashi
6212f37e2e ofproto: get rid of fragile and slow glob'ing modules
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-25 19:42:48 +09:00
Wei-Li Tang
b2ce73e16b topology/switches: duplicate datapath connections handling
The way to handle multiple connections from the same datapath I took
is mostly the same as in dpset, but it's always good to reinstall
the LDAP Packet-In flows even while switch tries to reconnect to us.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-22 21:26:45 +09:00
Simon Horman
b4e7900360 Add request forward message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:11 +09:00
Simon Horman
37f59926ae Add request forward message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:11 +09:00
Simon Horman
9128082fae of14: Add bundle add message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:10 +09:00
Simon Horman
7938d73f57 of14: Add bundle add message support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:05 +09:00
Simon Horman
5ba92e9ad2 Allow messages inside messages
Bundle Add Message and Request Forward Message, which is part of OpenFlow
1.4, encapsulates an OpenFlow message in side an OpenFlow message.

This patch prepares for this by adding a MsgInMsgBase class, a subclass of
MsgBase which allows its subclasses to include subclasses of either
MsgInMsgBase or MsgBase when when parsing classes from JSON: The MsgBase
class does not allow this.

This change has three parts:
* Remove the assertion in
  ofproto_parser.py:StringifyMixin::cls_from_jsondict_key()
  that cls is not a subclass of MsgBase.

* Pass **additional_args to various stringify.py:StringifyMixin decoder
  methods to make the datapath available when instantiating
  MsgBase subclasses.

* Override _decode_value() in MsgInMsgBase to pass **additional_args
  to decoder. The method in the parent class, StringifyMixin,
  does not pass **additional_args.

  The effect is to pass a datapath argument if
  the class is a subclass of MsgInMsgBase but not if the
  class is a direct subclass of MsgBase.

  By only making messages which allow messages inside them
  subclasses of MsgInMsgBase this allows the datapath
  argument to be passed to the decoder if and only if needed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:05 +09:00
Kiyonari Harigae
e04d1697e0 ofctl_v1_2:support whole of match fields
Hi,

I tried to support for whole of match field with ofctl_v1_2.(same as ofctl_v1_3)
Also, changed table_id of get_flow_stats method from fixed 0 to OFPTT_ALL for enable to select arbitrary table_id by client side.

Thank you.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 16:13:32 +09:00
Sriram Natarajan
6ce45939de rest_router: fix OFPSetAsync bit mask
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 14:59:44 +09:00
YAMAMOTO Takashi
81d6f1e252 ofp_event: fix a typo
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-18 13:46:03 +09:00
Wei-Li Tang
97f81e58a2 ofctl_v1_2/3: IP arbitrary bitmask support
Openflow 1.1 and later versions allow the use of IP address with
arbitrary bitmask in match fields. This adds arbitrary bitmask
support to related functions.

After applying this patch, it's no longer compatible with ACL
hybrid CIDR format (Cisco-like ACL bitmasks) because such format
exists only in some router's ACL configuration.

Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-18 13:46:01 +09:00
Yuichi Ito
8728c11e12 sw test tool: Fix a problem for disconnection
Disconnection of switches has caused a RyuInternalError because target_sw/tester_sw is set to NoneType.
This patch fixes the problem.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 22:09:12 +09:00
Simon Horman
281067bf2b of14: Add bundle control message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:28 +09:00
Simon Horman
d3e1e267f1 of14: Add bundle control message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:27 +09:00
Simon Horman
a376cc93c8 of14: Remove incorrect OFP_ASYNC_CONFIG_{PACK_STR, SIZE}
OFP_ASYNC_CONFIG_PACK_STR and OFP_ASYNC_CONFIG_SIZE are based
on the OpenFlow 1.3 implementation and specification. However,
the Openflow 1.4 specification defines a rather different structure:

struct ofp_async_config {
    struct ofp_header header; /* OFPT_GET_ASYNC_REPLY or OFPT_SET_ASYNC. */
    /* Async config Property list - 0 or more */
    struct ofp_async_config_prop_header properties[0];
};
OFP_ASSERT(sizeof(struct ofp_async_config) == 8);

In implementation terms this means that OFP_ASYNC_CONFIG_PACK_STR
is empty and OFP_ASYNC_CONFIG_SIZE is zero. In the new implementation
these values are unused so simply remove them.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:26 +09:00
Simon Horman
c0a1fd6d99 of14: Update get async reply and set async implementation to follow spec
The current get async reply and get async implementations follows that of
of_protocol and OpenFlow 1.3. However, OpenFlow 1.4 defines a rather
different format. This patch updates the implementation to follow the
OpenFlow 1.4 specification.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:24 +09:00
Simon Horman
f9888ba941 of14: Add OFPAsyncConfigProp
This will be used by a revised implementations of
get async request reply and set async

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:23 +09:00
Simon Horman
7b3c1ab9cd of14: Add table status unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:22 +09:00
Simon Horman
5ae836b713 of14: Add table status support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:21 +09:00
Simon Horman
2316f5e03b of14: Add flow monitor reply message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:21 +09:00
Simon Horman
dad67544d9 of14: Add flow monitor request unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:20 +09:00
Simon Horman
41c2d623a8 packet_data_generator: New ofproto dependency for v5 updates
Update ofproto dependency to include a merge of the mainline
v5 branch which includes:
* Bundle messages
* Flow monitor messages
* Request Forward message
* Table Status message
* Fix for length of Flow Update Full entry of Flow Monitor reply message

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:19 +09:00
Simon Horman
233c615dfd of14: Add flow monitor reply support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:06 +09:00
Simon Horman
3df9da512d of14: Add flow monitor request support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:05 +09:00
Simon Horman
fbd51b60f7 of14: Add OFPFlowUpdate
This will be used by flow monitor reply messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:04 +09:00
ISHIDA Wataru
08f7517234 dpset: absorb *args, **kwargs passed to __init__
dpset might be initialied implicitly like OFPHandler.
In that case, _CONTEXTS are passed to dpset. so we should ignore them.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:13:21 +09:00
Wei-Li Tang
06f343bb99 ofctl_v1_2/3: Convert IP fields to string with dotted decimal mask
This enables match_ip*_to_str() functions to output IP address with
dotted decimal subnet mask if the mask cannot be represented in CIDR
format.

Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:05:13 +09:00
watanabe.fumitaka
24b850f323 sw test tool: avoid test termination in initialization
The initialization error of the flow tables causes forced termination of the test,
 and has become the hindrance of execution of other tests.
This patch changes operation of the flow tables initialization error
 to avoid forced termination of the test.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:56 +09:00
Satoshi Kobayashi
e95a684aee ofctl_v1_2: Fix unsuitable log
When using type 'ALL', the log unsuitable is outputted:
Unknown type: ALL

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:45 +09:00
Satoshi Kobayashi
8fd3959d06 ofctl_v1_3: Fix unsuitable log
ofproto_v1_3.OFPGT_ALL is 0 and 0 is False on Python. When using type 'ALL', the following is set to True.

if not type_:
    LOG.debug('Unknown type: %s', group.get('type'))

Therefore, the log unsuitable is outputted:
Unknown type: ALL

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:32 +09:00
YAMAMOTO Takashi
eb07d4bf81 library_packet.rst: fix an example code
Reported by Sebastian Gebhard on ryu-devel@.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:37:46 +09:00
YAMAMOTO Takashi
13ec0df56d pyang plugin to generate of_config.generated_classes
the current version of generated_classes was written by hand.
this plugin allows it to be auto-generated from the yang module
of OF-Config if/when it's available.

unfortunately, there seems to be no yang modules usable for this
purpose publically available yet, though.
the yang module of OF-Config 1.1.1 is embedded in pdf.  besides that
it's hard to extract from the pdf, its license is unclear.
OF-Config 1.2 says that its yang module is distributed as a separate
file.  but i couldn't find it on ONF site.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:37:39 +09:00
YAMAMOTO Takashi
6394a34804 fix NX_EXPERIMENTER_ID
also, comment registry url.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:36:54 +09:00
YAMAMOTO Takashi
7b1d0eb9d6 reduce direct uses of oslo.config.cfg.CONF
no functional changes are intended.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:10 +09:00
YAMAMOTO Takashi
934fc1516f ryu.cfg: re-export some frequently used stuff for convenience
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:09 +09:00
YAMAMOTO Takashi
6756ff595c add ryu.cfg
also, make CONF accessible via RyuApp.CONF.
add a comment to explain the intention.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:08 +09:00
Wei-Li Tang
e8d7eafc6d ryu.conf: obsoleted argument used in sample configuration
ofp_listen_port was obsoleted and users should use ofp_tcp_listen_port
(or ofp_ssl_listen_port if ssl enabled) instead.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:26:09 +09:00
Wei-Li Tang
d5ec1f2079 ofctl_v1_2/3: IPv4 dotted decimal subnet mask support
This enables to_match_ip() to accept IPv4 address with dotted decimal
subnet mask or ACL hybrid CIDR.

Given 3 match field values below:

    '192.168.1.0/24'
    '192.168.1.0/255.255.255.0'
    '192.168.1.0/0.0.0.255'

These addresses are logically equivalent.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 18:06:01 +09:00
FUJITA Tomonori
5ce9e31b65 Ryu 3.7
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:18:36 +09:00
YAMAMOTO Takashi
b570fca1aa test_parser: update expected json representation
Update after experimenter data change.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
YAMAMOTO Takashi
e0ce84983e OFPPropCommonExperimenter4ByteData: change payload to bytes
Change experimenter data from a list of 32-bit words to bytes.
Discussed on ryu-devel@.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
YAMAMOTO Takashi
fb470142a6 Apply normalize_json.py
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
Simon Horman
0c83f96ae7 of14: Correct documentation of table mod flags and properties
* Document properties
* The valid flags for OpenFlow 1.4 are OFPTC_EVICTION and OFPTC_VACANCY_EVENTS

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 15:29:54 +09:00
Simon Horman
ce11165ef4 of13: Correct documentation of meter mod flags
* Flags is a bitmap of OFPMF_* values rather than a
  single OFPMF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:48:10 +09:00
Simon Horman
0dc8cb87df of13: Correct documentation of flow mod flags
* Flags is a bitmap of OFPFF_* values rather than a
  single OFPFF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:48:01 +09:00
Simon Horman
4e54354d4e of13: Correct documentation of set config flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:52 +09:00
Simon Horman
663a4c1133 of13: Correct documentation and example of get config reply flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:42 +09:00
Simon Horman
7fb985f3a1 of14: Correct documentation of flow mod flags
* Flags is a bitmap of OFPFF_* values rather than a
  single OFPFF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:29 +09:00
Simon Horman
2f5a1a96e9 of14: Correct documentation of meter mod flags
* Flags is a bitmap of OFPMF_* values rather than a
  single OFPMF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:35:14 +09:00
Simon Horman
1ea8199013 of14: Correct documentation of set config flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:34:42 +09:00
Simon Horman
aa08ed2c78 of14: Correct documentation and example of get config reply flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:34:34 +09:00
Yuichi Ito
de7af3ace7 of14: set default attributes for meter-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:28:58 +09:00
Yuichi Ito
813ae5ed60 of13: set default attributes for meter-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:28:57 +09:00
FUJITA Tomonori
caeaae639b fix load_apps() in AppManager class
fix the following bug:

http://sourceforge.net/p/ryu/mailman/message/32022286/

Dependent services are not loaded properly with '_CONTEXTS'.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:25:30 +09:00
Wei-Li Tang
1875071ce2 six.add_metaclass requires six>=1.4.0
python-six package from Ubuntu 12.04 LTS remains version 1.1.0,
which prevents ryu-manager from being started and raises exception
"AttributeError: 'module' object has no attribute 'add_metaclass'".

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:21:38 +09:00
Simon Horman
9719958863 of14: Add experimenter property to port mod reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:30:08 +09:00
Simon Horman
974e4030c3 of14: Add port mod experimenter property
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:57 +09:00
Simon Horman
6e2f80e2d7 of14: Add optical property to port mod reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:57 +09:00
Simon Horman
55b89f0bd8 of14: Add port mod optical property
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:57 +09:00
Simon Horman
77fd419441 of14: Remove _PACK_STR from port mod ethernet property
Use OFP_PORT_MOD_PROP_ETHERNET_PACK_STR in
and remove _PACK_STR from OFPPortModPropEthernet.

Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:57 +09:00
Simon Horman
ec5f96daf0 of14: Add experimenter property to port stats reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:57 +09:00
Simon Horman
cd728e3b04 of14: Add port stats experimenter property
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:56 +09:00
Simon Horman
8caa002953 of14: Add optical property to port stats reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:29:56 +09:00
Simon Horman
3634f3c652 of14: Add experimenter property to port status unit test
Signed-off-by: Simon Horman <horms@verge.net.au>

--
v3
* Correct indentation

v2
* First post
2014-02-27 22:29:56 +09:00
Kiyonari Harigae
39b78cc2c7 ofctl_v1_3:support whole of match fields
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 21:42:31 +09:00
Simon Horman
4e60ce00cb of14: Add port stats optical property
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:40 +09:00
Simon Horman
808a1bfdf7 of14: Add experimenter property to queue stats reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:40 +09:00
Simon Horman
49079b4c8e of14: Add queue stats experimenter property
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:40 +09:00
Simon Horman
1c6b6e0bf3 of14: Rename QueueProp as QueueStatsProp
This is more in keeping with the names used for
other properties as the property is ofp_queue_stats_prop
in the OF1.4 specification.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
d86c96c49b of14: Add experimenter property to table features request unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
a0fef2d6df of14: Add experimenter property to table features reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
68e07855b5 of14: Add table feature experimenter property
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
c70836e575 of14: Add table feature table sync from property
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
db3e8d470d of14: Add experimenter property to port desc reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:39 +09:00
Simon Horman
7e9180e1c5 of14: Add port desc experimenter property
This may be used in port stats and port status messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:24 +09:00
Simon Horman
948be70411 of14: Add optical property to port desc reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:24 +09:00
Simon Horman
f03ff41186 of14: Add optical property to port status unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:24 +09:00
Simon Horman
7d0cff7044 of14: Add port desc optical property
This may be used in port stats and port status messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:59:24 +09:00
Simon Horman
9f33ad8380 of14: Add action experimenter to flow mod unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:38:59 +09:00
Simon Horman
5dbe5df40e of14: Add action experimenter support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 13:38:58 +09:00
Simon Horman
a3afbf0877 of13: Add experimenter property to table features reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 09:19:00 +09:00
Simon Horman
9aafc0eb56 of13: Add experimenter property to table features request unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 09:18:59 +09:00
Simon Horman
22a7078dcb of13: Add table feature experimenter property
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 09:18:58 +09:00
YAMAMOTO Takashi
549bb3c3c9 ofproto_v1_3_parser: update OFPActionSetField docstring
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:39:35 +09:00
YAMAMOTO Takashi
826c64a5cd ofproto_v1_2_parser: update OFPActionSetField docstring
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:39:34 +09:00
YAMAMOTO Takashi
bdb2c9639a ofproto_v1_4_parser: update OFPActionSetField docstring
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:39:32 +09:00
Simon Horman
5800214d16 of14: Remove supruious comment from OFPPropBase
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:18:12 +09:00
Simon Horman
6dd0f63414 of14: Add role status unit test
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:12:23 +09:00
Simon Horman
d27be429bc packet_data_generator: of14: Add role status message
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:12:19 +09:00
Simon Horman
55a909b13e of14: Add role status support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:12:19 +09:00
Simon Horman
65480498f6 of14: Add OFPRoleProp
This will be used by role status messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:12:19 +09:00
Simon Horman
da74cda7a4 of14: Add OFPPropCommonExperimenter4ByteData
There are several different experimenter properties in OF1.4 which
are identical in structure. They have experimenter, exp_type
and data fields. The data field is an array of 4-byte words.

This patch adds OFPPropCommonExperimenter4ByteData which provides
a parser and serializer for such properties and can be inherited
by a subclass which implements one of the properties.

This patch also uses OFPPropCommonExperimenter4ByteData to implement
queue desc properties and table mod properties.

It is planned to use OFPPropCommonExperimenter4ByteData to implement
role properties.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-27 08:12:19 +09:00
Simon Horman
a9aa84de42 of14: Add queue desc reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
ef68e878e7 packet_data_generator: of14: Add queue desc reply
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
7ed214cf32 of14: Add queue desc request support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
14f20a7912 of14: Add queue desc request unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
2fecf39b7d packet_data_generator: of14: Add queue desc request
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
e0a0673d9c of14: Add queue desc request support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
ef8633753f of14: Add OFPQueueDesc
This may be used by queue desc request and reply messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:22 +09:00
Simon Horman
7c96df6023 of14: Add OFPQueueDescProp
This may be used by queue desc request and reply messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:53:10 +09:00
Simon Horman
d268e10bf6 of14: table mod with properties
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:41 +09:00
Simon Horman
5a4adf497e of14: Add properties support to flow mod
With this change the initialiser of OFPTableMod now
requires a properties argument. This is incompatible with
Ryu v3.6. If it is important to maintain compatibility
then things can be reworked a little to make the properties
argument optional.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:41 +09:00
Simon Horman
727307cabb of14: Add OFPTableModProp serialization
This will be used by at least the serialisation of
flow mod messages with properties.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:41 +09:00
Simon Horman
5b0bb7f6dd of14: Add table desc unit tests
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:41 +09:00
Simon Horman
41b11296c4 packet_data_generator: of14: Add table desc
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:41 +09:00
Simon Horman
5309a5649f of14: Add table desc request and reply message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:27 +09:00
Simon Horman
60411c3f7a of14: Add OFPTableDesc
This may be table status and table desc messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:27 +09:00
Simon Horman
96f7f51762 of14: Add OFPTableModProp
This may be table mod, table status and table desc messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:39:27 +09:00
watanabe.fumitaka
81322b7a0a sw test tool: fix missing to receive error of PacketOut
Since transaction ID of PacketOut message is not hold,
 an error message to this PacketOut is not able to be received.
This patch fixes it.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-26 23:07:58 +09:00
Rob Udechukwu
98f5c2aad0 of13: support OFPAactionExperimenter with data
The length check assert was added by FUJITA since the spec says that
lenght of data should be a multiple of 8.

Signed-off-by: Rob Udechukwu <rnudechu@ncsu.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-21 15:38:24 +09:00
FUJITA Tomonori
f3f784e01b sw test tool: fix pop_pbb action
"The Pop PBB header action does not remove the backbone VLAN
header (B-TAG)" as described in openflow spec 1.3.3.
The format of I-TAG TCI is pcp,..,I-SID,C-DA,C-SA as in
802.1Q-2011 Figure 9-3.

Change the test senario, converting

from B-MAC/I-TAG/S-TAG/C-TAG/ethertype/Data
to   C-MAC/S-TAG/C-TAG/ethertype/Data

looks more common.

Reported-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-21 15:26:55 +09:00
Simon Horman
c566ba192c of14: Document OFPRR_{METER_DELETE, EVICTION} reasons for flow removed message
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-19 20:12:57 +09:00
watanabe.fumitaka
a63daf6caf sw test tool: add test report output
Add following reports to the output of a switch test tool.
This report outputs the test item of each error type, and the number of errors.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-19 20:12:50 +09:00
Simon Horman
1250c6d3a3 ofproto: correct typo
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-19 19:00:04 +09:00
YAMAMOTO Takashi
c8b45e18b0 test_add_flow_v12_actions: fix a typo
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-17 22:40:52 +09:00
YAMAMOTO Takashi
2743eb4da5 rename neutron agent from "ofswitch" to "ofagent"
suggested by some openstack folks.
see https://review.openstack.org/#/c/71791

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-17 22:40:36 +09:00
FUJITA Tomonori
2a95c185e1 of13/14: fix OFPFMFC_TABLE_FULL typo
Reported-by: Morgan Yang <Morgan.Yang@radisys.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-02-17 22:40:18 +09:00
FUJITA Tomonori
4c63a5cf24 ofconfig: add commit and discard_changes operation support
They are necessary for switches that don't support the feature of
modifying 'running' configuration directly; instead, needs to modify
'candidate' configuration and then commit (or discard).

Also fix do_get method's comment typo.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-02-17 22:39:54 +09:00
FUJITA Tomonori
f45f534758 of_config: add OFPortStateType class
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-02-14 13:27:32 +09:00
FUJITA Tomonori
78fede3f51 topology: support OF1.2 and 1.4
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-02-13 15:04:50 +09:00
YAMAMOTO Takashi
37fed5c764 handler.register_service: comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-11 17:24:43 +09:00
YAMAMOTO Takashi
d5bb06a3f9 use six.add_metaclass
as suggested by OpenStack Style Guideline.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-11 13:56:40 +09:00
YAMAMOTO Takashi
6f59821b50 pip-requires: sort in alphabetical order
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-11 13:34:45 +09:00
FUJITA Tomonori
f3c7dcbc00 of14: set default attributes for OFPMeterMod
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-10 11:03:35 +09:00
FUJITA Tomonori
ba348e8058 of13: set default attributes for OFPMeterMod
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-10 11:03:34 +09:00
YAMAMOTO Takashi
188d68fcf8 neutron-ofswitch-agent man page
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-07 19:53:55 +09:00
YAMAMOTO Takashi
d175ca6f0d setup.cfg: add neutron-ofswitch-agent to console_scrpits
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-07 19:53:55 +09:00
YAMAMOTO Takashi
6b972762d2 run_tests.sh: add neutron-ofswitch-agent to PYLINT_INCLUDE
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-07 19:53:54 +09:00
fumihiko kakuma
a5e3693908 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>
2014-02-07 19:53:53 +09:00
YAMAMOTO Takashi
d00d1498d7 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>
2014-02-07 19:53:46 +09:00
YAMAMOTO Takashi
4d9382ce7a pbb: add a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-07 19:53:41 +09:00
YAMAMOTO Takashi
57d14a3526 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>
2014-02-07 19:53:36 +09:00
YAMAMOTO Takashi
e3d08bd587 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>
2014-02-07 19:53:32 +09:00
Wei-Li Tang
3423b2a20d 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>
2014-02-07 19:53:26 +09:00
Yuichi Ito
4030ec74b2 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>
2014-02-07 19:53:19 +09:00
Yuichi Ito
29027c2db4 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>
2014-02-07 19:53:12 +09:00
WATANABE Fumitaka
0a2a4b4008 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>
2014-02-07 19:52:35 +09:00
watanabe.fumitaka
66f825ac47 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>
2014-02-07 19:49:40 +09:00
FUJITA Tomonori
c6343de851 of12: fix InstructionWriteMetadata json decoder
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-07 08:59:38 +09:00
watanabe.fumitaka
44e9a47fce 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>
2014-02-06 17:16:49 +09:00
watanabe.fumitaka
8244d4f24b 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>
2014-02-06 17:16:48 +09:00
YAMAMOTO Takashi
8801af2974 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>
2014-02-06 15:57:52 +09:00
YAMAMOTO Takashi
c01d5d45a8 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>
2014-02-06 15:57:52 +09:00
YAMAMOTO Takashi
190abc8117 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>
2014-02-06 15:57:52 +09:00
YAMAMOTO Takashi
843e89e7dd 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>
2014-02-06 15:57:52 +09:00
YAMAMOTO Takashi
bda747804b 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>
2014-02-06 15:57:46 +09:00
YAMAMOTO Takashi
6973e84867 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>
2014-02-06 15:57:46 +09:00
YAMAMOTO Takashi
b48772504f 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>
2014-02-06 15:57:46 +09:00
Wei-Li Tang
474538af5b OFPGroupMod: Fix OFPGC_* typo in examples
OFPFC_* enumerations are declared for flow mod commands, not for groups.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-06 06:25:25 +09:00
YAMAMOTO Takashi
bcce5c4e76 test_parser: 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>
2014-02-05 21:01:17 +09:00
YAMAMOTO Takashi
c0fd8a0a95 controller: use ProtocolDesc
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-05 20:59:07 +09:00
YAMAMOTO Takashi
5467e8b4a2 ofproto_protocol: provide a class to describe an openflow version
currently OFP classes takes the Datapath object, which is too complex
for this purpose.  this class, ProtocolDesc, is intended to be
a simpler replacement for that.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-05 20:58:49 +09:00
YAMAMOTO Takashi
b857e803ca ofproto_v1_3_parser: import ofproto_v1_3 as 'ofproto'
as proposed while ago, import ofproto_v1_3 with a version agnostic name
to reduce differences between parser modules.

the name 'ofproto' was chosen to match with ofproto_v1_4_parser.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-05 13:22:59 +09:00
YAMAMOTO Takashi
5dcb10d7c3 ofproto_v1_2_parser: import ofproto_v1_2 as 'ofproto'
as proposed while ago, import ofproto_v1_2 with a version agnostic name
to reduce differences between parser modules.

the name 'ofproto' was chosen to match with ofproto_v1_4_parser.

update tests accordingly.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-05 13:22:58 +09:00
YAMAMOTO Takashi
b42dd0d7f3 ofproto_v1_0_parser: import ofproto_v1_0 as 'ofproto'
as proposed while ago, import ofproto_v1_0 with a version agnostic name
to reduce differences between parser modules.

the name 'ofproto' was chosen to match with ofproto_v1_4_parser.

update tests accordingly.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-05 13:22:57 +09:00
Simon Horman
455249b1c1 of14: Add to ofproto unit tests
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 20:54:35 +09:00
Simon Horman
9e999fad23 of14: Add port mod message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
cfc6c34e97 of14: Add queue stats request and reply message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
1309feca8e of14: Add port stats request and reply message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
d86df914c3 of14: Add generic OFPropBase class
Add generic OFPropBase class and make OFPPortProp a subclass of it.
This is to allow other properties classes to be implemented as subclasses
of OFPPropBase, simplifying their implementation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
29f7f1fa28 of14: Rename OFPPortDescPropUnknown as OFPPortPropUnknown
This corrects what appears to be a typo as
OFPPortDescPropUnknown is never called but
OFPPortPropUnknown, which does not exist, is called.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
0742b5b19f of14: Add port status message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:50 +09:00
Simon Horman
4c119f9abe of14: Add meter mod message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
0f9bdca0fa of14: Add OFPMeterBandDscpRemark and OFPMeterBandExperimenter
These will be used my meter mod message support which
is added by a subsequent patch.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
b4895e1217 of14: Move OFPMeterBand* to above OFPMeterConfigStats
This is a purely cosmetic change to move some code to
the same location it is found in the of1.3 implementation,
aiding comparison between the two codebases. It also
move the code closer to where it is used.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
5bfc8255ba of14: Add table features stats request and reply message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
03a9196e43 of14: Add _ordered_fields to .4 OFPMatch
This appears to be necessary for wire tests
to pass if matches are in an order different
from that defined by Ryu.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
c8d6444e0c of14: Fix OFPInstructionWriteMetadata JSON decode
This is in line with 4a394aae2f1a3b82
("Fix OFPInstructionWriteMetadata JSON decode") which fixes
the following for OF1.3:

CLS <class 'ryu.ofproto.ofproto_v1_3_parser.OFPInstructionWriteMetadata'>
ARG {u'metadata_mask': 18446744073709551615L, u'type': 2, u'len': 24, u'metadata': 18446744069414584320L}
KWARG {u'type_': 2, u'metadata_mask': 18446744073709551615L, u'len_': 24, u'metadata': 18446744069414584320L}
Traceback (most recent call last):
  File "a.py", line 19, in <module>
    msg = ofproto_parser.ofp_msg_from_jsondict(dp, m)
  File "/Users/fujita/git/ryu/ryu/ofproto/ofproto_parser.py", line 100, in ofp_msg_from_jsondict
    return cls.from_jsondict(v, datapath=dp)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 291, in from_jsondict
    kwargs = cls._restore_args(_mapdict_kv(decode, dict_))
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 46, in <lambda>
    _mapdict_kv = lambda f, d: dict([(k, f(k, v)) for k, v in d.items()])
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 290, in <lambda>
    decode = lambda k, x: cls._decode_value(k, x, decode_string)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 234, in _decode_value
    return cls._get_decoder(k, decode_string)(json_value)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 242, in _decode
    v = map(_decode, json_value)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 245, in _decode
    v = cls.obj_from_jsondict(json_value)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 223, in obj_from_jsondict
    return obj_cls.from_jsondict(v)
  File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 293, in from_jsondict
    return cls(**dict(kwargs, **additional_args))
TypeError: __init__() got an unexpected keyword argument 'type_'

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
1350b96078 of14: set default attributes for OFPMultipartRequest subclasses
This is in keeping with 1368fd6899722a9c ("of13: set default attributes for
OFPMultipartRequest subclasses").

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
Simon Horman
5c1ef5f239 of14: add some assertions
This is in keeping with
e08ac471d44db846 ("ofproto_v1_3_parser: put some assertions").

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
1537 changed files with 310174 additions and 33941 deletions

25
.github/workflows/tests-unit.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Unit tests
on: [push, pull_request]
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade -r pip-requirements.txt
pip install tox tox-gh-actions coveralls
bash ryu/tests/integrated/common/install_docker_test_pkg_for_github_actions.sh
- name: Test with tox
run: NOSE_VERBOSE=0 tox

View File

@ -10,6 +10,6 @@
# W0614: Unused import %s from wildcard import
# R0801: Similar lines in %s files
disable=C0111,W0511,W0142,E0602,C0103,E1101,R0903,W0614,R0801
output-format=parseable
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
reports=yes
files-output=no

11
.readthedocs.yml Normal file
View File

@ -0,0 +1,11 @@
version: 2
build:
image: latest
python:
version: 3.6
install:
- method: pip
path: .
sphinx:
configuration: doc/source/conf.py
formats: all

15
.renovaterc.json Normal file
View File

@ -0,0 +1,15 @@
{
"separateMajorMinor": false,
"schedule": [
"after 10pm every weekday",
"before 5am every weekday",
"every weekend"
],
"timezone": "Pacific/Auckland",
"extends": [
"config:base",
":prHourlyLimit1",
":preserveSemverRanges",
"docker:enableMajor"
]
}

9
.stickler.yml Normal file
View File

@ -0,0 +1,9 @@
---
linters:
flake8:
python: 3
max-line-length: 120
pep8:
python: 3
max-line-length: 120
py3k:

View File

@ -1,10 +0,0 @@
language: python
python:
- "2.6"
- "2.7"
install:
- "pip install -r tools/pip-requires -r tools/test-requires --use-mirrors"
script:
- "./run_tests.sh -N"

View File

@ -5,46 +5,59 @@ How to Get Your Change Into Ryu
Submitting a change
===================
Send patches to ryu-devel@lists.sourceforge.net. Please don't use 'pull
request' on github. We expect you to send a patch in Linux kernel
development style. If you are not familiar with it, please read the
following document:
To send patches to ryu, please make a
`pull request <https://github.com/faucetsdn/ryu>`_ on GitHub.
http://lxr.linux.no/source/Documentation/SubmittingPatches
Please check your changes with autopep8, pycodestyle(pep8) and running
unit tests to make sure that they don't break the existing features.
The following command does all for you.
Please check your changes with pep8 and run unittests to make sure
that they don't break the existing features. The following command
does both for you:
.. code-block:: bash
fujita@rose:~/git/ryu$ ./run_tests.sh
# Install dependencies of tests
$ pip install -r tools/test-requires
Of course, you are encouraged to add unittests when you add new
# Execute autopep8
# Also, it is convenient to add settings of your editor or IDE for
# applying autopep8 automatically.
$ autopep8 --recursive --in-place ryu/
# Execute unit tests and pycodestyle(pep8)
$ ./run_tests.sh
Of course, you are encouraged to add unit tests when you add new
features (it's not a must though).
Python version and libraries
============================
* Python 2.6+
As RHEL 6 adopted python 2.6, features only for 2.7+ should be avoided.
* Python 3.5, 3.6, 3.7, 3.8, 3.9:
* standard library + widely used library
Basically widely used == OpenStack adopted
As usual there are exceptions. gevents. Or python binding library for other
Ryu supports multiple Python versions. CI tests on GitHub Actions is running
on these versions.
* standard library + widely used library:
Basically widely used == OpenStack adopted.
As usual there are exceptions. Or python binding library for other
component.
Coding style guide
==================
* pep8
As python is used, PEP8 is would be hopefully mandatory for
http://www.python.org/dev/peps/pep-0008/
* pep8:
As python is used, PEP8 is would be hopefully mandatory for
https://www.python.org/dev/peps/pep-0008/
* pylint:
* pylint
Although pylint is useful for finding bugs, but pylint score not very
important for now because we're still at early development stage.
https://www.pylint.org/
* Google python style guide is very helpful
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html
* Google python style guide is very helpful:
http://google.github.io/styleguide/pyguide.html
Guidelines derived from Guido's Recommendations
* Guidelines derived from Guido's Recommendations:
============================= ================= ========
Type Public Internal
@ -62,10 +75,11 @@ Coding style guide
Local Variables lower_with_under
============================= ================= ========
* OpenStack Nova style guide
* OpenStack Nova style guide:
https://github.com/openstack/nova/blob/master/HACKING.rst
* JSON files
* JSON files:
Ryu source tree has JSON files under ryu/tests/unit/ofproto/json.
They are used by unit tests. To make patches easier to read,
they are normalized using tools/normalize_json.py. Please re-run

View File

@ -7,6 +7,7 @@ graft etc
graft tools
recursive-exclude doc/build *
recursive-exclude ryu/tests/packet_data_generator *
recursive-exclude ryu/tests/packet_data_generator2 *
global-exclude *~
global-exclude *.pyc
global-exclude .gitignore

View File

@ -1,12 +1,17 @@
**PLEASE READ: RYU NOT CURRENTLY MAINTAINED**
* The Ryu project needs new maintainers - please file an issue if you are able to assist.
* see OpenStack's os-ken (`<https://github.com/openstack/os-ken>`_) for a maintained Ryu alternative.
What's Ryu
==========
Ryu is a component-based software defined networking framework.
Ryu provides software components with well defined API that make it
Ryu provides software components with well defined API's that make it
easy for developers to create new network management and control
applications. Ryu supports various protocols for managing network
devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow,
Ryu supports fully 1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
Ryu supports fully 1.0, 1.2, 1.3, 1.4, 1.5 and Nicira Extensions.
All of the code is freely available under the Apache 2.0 license. Ryu
is fully written in Python.
@ -20,25 +25,46 @@ Installing Ryu is quite easy::
If you prefer to install Ryu from the source code::
% git clone git://github.com/osrg/ryu.git
% cd ryu; python ./setup.py install
If you want to use Ryu with `OpenStack <http://openstack.org/>`_,
please refer `detailed documents <http://ryu.readthedocs.org/en/latest/using_with_openstack.html>`_.
You can create tens of thousands of isolated virtual networks without
using VLAN. The Ryu application is included in OpenStack mainline as
of Essex release.
% git clone https://github.com/faucetsdn/ryu.git
% cd ryu; pip install .
If you want to write your Ryu application, have a look at
`Writing ryu application <http://ryu.readthedocs.org/en/latest/writing_ryu_app.html>`_ document.
`Writing ryu application <http://ryu.readthedocs.io/en/latest/writing_ryu_app.html>`_ document.
After writing your application, just type::
% ryu-manager yourapp.py
Optional Requirements
=====================
Some functions of ryu require extra packages:
- OF-Config requires lxml and ncclient
- NETCONF requires paramiko
- BGP speaker (SSH console) requires paramiko
- Zebra protocol service (database) requires SQLAlchemy
If you want to use these functions, please install the requirements::
% pip install -r tools/optional-requires
Please refer to tools/optional-requires for details.
Prerequisites
=============
If you got some error messages at the installation stage, please confirm
dependencies for building the required Python packages.
On Ubuntu(16.04 LTS or later)::
% apt install gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev
Support
=======
Ryu Official site is `<http://osrg.github.io/ryu/>`_.
Ryu Official site is `<https://ryu-sdn.org/>`_.
If you have any
questions, suggestions, and patches, the mailing list is available at

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -16,5 +16,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ryu.cmd.rpc_cli import main
from ryu.cmd.ryu_base import main
main()

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
ryu (3.10-1) trusty; urgency=low
* Initial release.
-- Ryu Project Team <ryu-devel@lists.sourceforge.net> Wed, 18 Jun 2014 14:50:23 +0900

3
debian/clean vendored Normal file
View File

@ -0,0 +1,3 @@
ryu.egg-info/*
debian/ryu-manager.8
debian/ryu.8

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

82
debian/control vendored Normal file
View File

@ -0,0 +1,82 @@
Source: ryu
Section: net
Priority: optional
Maintainer: Ryu Project Team <ryu-devel@lists.sourceforge.net>
Build-Depends: debhelper (>= 9.0.0), python-all (>= 2.6), python-sphinx
Build-Depends-Indep:
python-eventlet,
python-lxml,
python-msgpack (>= 0.4.0),
python-netaddr,
python-oslo.config (>= 1:1.2.0),
python-paramiko,
python-routes,
python-six (>= 1.4.0),
python-webob (>=1.2),
python-setuptools,
python-pip,
python-pbr
Standards-Version: 3.9.5
Homepage: https://ryu-sdn.org
Vcs-Git: git://github.com/faucetsdn/ryu.git
Vcs-Browser: https://github.com/faucetsdn/ryu
XS-Python-Version: >= 2.6
Package: python-ryu
Architecture: all
Section: python
Depends:
python-eventlet,
python-lxml,
python-msgpack (>= 0.4.0),
python-netaddr,
python-oslo.config (>= 1:1.2.0),
python-paramiko,
python-routes,
python-six (>= 1.4.0),
python-webob (>=1.2),
${misc:Depends},
${python:Depends}
Suggests: python-ryu-doc
Provides: ${python:Provides}
XB-Python-Version: ${python:Versions}
Description: Ryu is a software defined networking framework
Ryu is a component-based software defined networking framework.
Ryu provides software components with well defined API that make
it easy for developers to create new network management and control
applications. Ryu supports various protocols for managing network
devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow,
Ryu supports fully 1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
.
This package provides the Python library.
Package: ryu-bin
Architecture: all
Depends:
python-ryu,
${misc:Depends},
${python:Depends},
${shlibs:Depends}
Description: Ryu is a software defined networking framework
Ryu is a component-based software defined networking framework.
Ryu provides software components with well defined API that make
it easy for developers to create new network management and control
applications. Ryu supports various protocols for managing network
devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow,
Ryu supports fully 1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
.
This package provides the Ryu manager.
Package: python-ryu-doc
Architecture: all
Section: doc
Description: Ryu is a software defined networking framework
Ryu is a component-based software defined networking framework.
Ryu provides software components with well defined API that make
it easy for developers to create new network management and control
applications. Ryu supports various protocols for managing network
devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow,
Ryu supports fully 1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
.
This package provides the HTML documentation including the Ryu API
manual.

62
debian/copyright vendored Normal file
View File

@ -0,0 +1,62 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ryu
Source: http://github.com/faucetsdn/ryu
Files: *
Copyright: 2014 Ryu Project Team <ryu-devel@lists.sourceforge.net>
License: Apache-2.0
Files: ryu/contrib/_eventlet/*
Copyright: 2005-2006, Bob Ippolito
2007-2010, Linden Research, Inc.
2008-2010, Eventlet Contributors (see AUTHORS)
License: MIT
Files: ryu/contrib/ncclient/*
Copyright: Shikhar Bhushan <shikhar@schmizz.net>
Leonidas Poulopoulos <leopoul@noc.grnet.gr>
Ebben Aries <earies@juniper.net>
License: Apache-2.0
Files: ryu/contrib/tinyrpc/*
Copyright: 2013 Marc Brinkmann
License: MIT
Files: ryu/contrib/ovs/*
Copyright: 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
License: Apache-2.0
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems, the full text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1
debian/docs vendored Normal file
View File

@ -0,0 +1 @@
README.rst

21
debian/log.conf vendored Normal file
View File

@ -0,0 +1,21 @@
[loggers]
keys = root
[handlers]
keys = file
[formatters]
keys = simple
[logger_root]
level = INFO
handlers = file
[handler_file]
class = handlers.WatchedFileHandler
formatter = simple
args = ('/var/log/ryu/ryu.log',)
[formatter_simple]
format = %(asctime)s.%(msecs)03d %(levelname)s %(name)s %(message)s
datefmt = %Y-%m-%d %H:%M:%S

9
debian/python-ryu-doc.doc-base vendored Normal file
View File

@ -0,0 +1,9 @@
Document: python-ryu-doc
Title: Ryu User Documentation
Author: Ryu Project Team
Abstract: Ryu is a component-based software defined networking framework.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/python-ryu-doc/html/index.html
Files: /usr/share/doc/python-ryu-doc/html/*.html

2
debian/python-ryu-doc.docs vendored Normal file
View File

@ -0,0 +1,2 @@
README.rst
debian/html

1
debian/python-ryu.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/python*/dist-packages/*

35
debian/rules vendored Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
%:
dh $@ --with python2
override_dh_installman:
cd doc; \
make man; \
cp build/man/* ../debian/
dh_installman
override_dh_auto_build:
dh_auto_build
mkdir -p debian/html
cd doc; \
make html; \
cp -r build/html/* ../debian/html/
override_dh_installinit:
dh_installinit --no-start --name=ryu
override_dh_installlogrotate:
dh_installlogrotate --name=ryu
override_dh_auto_clean:
rm -rf html
dh_auto_clean

1
debian/ryu-bin.dirs vendored Normal file
View File

@ -0,0 +1 @@
/var/log/ryu

4
debian/ryu-bin.install vendored Normal file
View File

@ -0,0 +1,4 @@
usr/bin/ryu-manager usr/bin
usr/bin/ryu usr/bin
debian/ryu.conf etc/ryu
debian/log.conf etc/ryu

2
debian/ryu-bin.manpages vendored Normal file
View File

@ -0,0 +1,2 @@
debian/ryu-manager.8
debian/ryu.8

2
debian/ryu-bin.postrm vendored Normal file
View File

@ -0,0 +1,2 @@
update-rc.d -f ryu remove >/dev/null || exit $?
#DEBHELPER#

7
debian/ryu-bin.ryu.logrotate vendored Normal file
View File

@ -0,0 +1,7 @@
/var/log/ryu/ryu.log {
daily
missingok
compress
delaycompress
notifempty
}

9
debian/ryu-bin.ryu.upstart vendored Normal file
View File

@ -0,0 +1,9 @@
description "Ryu server"
start on (starting neutron-server or runlevel [2345])
stop on runlevel [!2345]
respawn
exec start-stop-daemon --start --exec /usr/bin/ryu -- \
run --config-file /etc/ryu/ryu.conf

36
debian/ryu.conf vendored Normal file
View File

@ -0,0 +1,36 @@
[DEFAULT]
log_config_file=/etc/ryu/log.conf
# app_lists = $RYU_APPS
#
# for OpenStack Neutron Ryu plugin:
# mac address based isolation
#app_lists = ryu.app.simple_isolation,ryu.app.rest
# VLAN
#app_lists=ryu.app.quantum_adapter,ryu.app.rest,ryu.app.rest_conf_switch,ryu.app.rest_quantum,ryu.app.rest_tunnel,ryu.app.simple_vlan
# GRE tunneling
#app_lists=ryu.app.gre_tunnel,ryu.app.quantum_adapter,ryu.app.rest,ryu.app.rest_conf_switch,ryu.app.rest_quantum,ryu.app.rest_tunnel,ryu.app.tunnel_port_updater
#
# wsapi_host=<hostip>
# wsapi_port=<port:8080>
# ofp_listen_host=<hostip>
# ofp_tcp_listen_port=<port:6633>
#wsapi_host = 0.0.0.0
#wsapi_port = 8080
#ofp_listen_host = 0.0.0.0
#ofp_tcp_listen_port = 6633
#
# the followings must be set according to neutron settings
# neutron_url = http://$Q_HOST:$Q_PORT
# neutron_admin_username = $Q_ADMIN_USERNAME
# neutron_admin_password = $SERVICE_PASSWORD
# neutron_admin_tenant_name = $SERVICE_TENANT_NAME
# neutron_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0
# neutron_auth_strategy = $Q_AUTH_STRATEGY
# neutron_controller_addr = tcp:$RYU_OFP_HOST:$RYU_OFP_PORT
#neutron_url = http://192.168.0.1:9696
#neutron_admin_username = admin
#neutron_admin_password = password
#neutron_admin_tenant_name = service
#neutron_admin_auth_url = http://192.168.0.1:5000/v2.0
#neutron_auth_strategy = keystone
#neutron_controller_addr = tcp:192.168.0.1:6633

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -11,5 +11,5 @@ Ryu API Reference
.. autoclass:: ryu.base.app_manager.RyuApp
:members: OFP_VERSIONS,_CONTEXTS,_EVENTS,close,context_iteritems,reply_to_request,send_event,send_event_to_observers,send_request,start
.. automodule:: ryu.controller.dpset
.. autoclass:: ryu.controller.dpset.DPSet
:members:

15
doc/source/app.rst Normal file
View File

@ -0,0 +1,15 @@
*************************
Built-in Ryu applications
*************************
Ryu has some built-in Ryu applications.
Some of them are examples.
Others provide some functionalities to other Ryu applications.
.. toctree::
:maxdepth: 1
app/ofctl.rst
app/ofctl_rest.rst
app/rest_vtep.rst
app/bgp_application.rst

View File

@ -0,0 +1,6 @@
**************************************
ryu.services.protocols.bgp.application
**************************************
.. automodule:: ryu.services.protocols.bgp.application
:members:

30
doc/source/app/ofctl.rst Normal file
View File

@ -0,0 +1,30 @@
*************
ryu.app.ofctl
*************
ryu.app.ofctl provides a convenient way to use OpenFlow messages
synchronously.
OfctlService ryu application is automatically loaded if your
Ryu application imports ofctl.api module.
Example::
import ryu.app.ofctl.api
OfctlService application internally uses OpenFlow barrier messages
to ensure message boundaries. As OpenFlow messages are asynchronous
and some of messages does not have any replies on success, barriers
are necessary for correct error handling.
api module
==========
.. automodule:: ryu.app.ofctl.api
:members:
exceptions
==========
.. automodule:: ryu.app.ofctl.exception
:members:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
*****************
ryu.app.rest_vtep
*****************
.. automodule:: ryu.app.rest_vtep
REST API
========
.. autoclass:: ryu.app.rest_vtep.RestVtepController
:members:
:member-order: bysource

144
doc/source/components.rst Normal file
View File

@ -0,0 +1,144 @@
*****************
Components of Ryu
*****************
Executables
===========
bin/ryu-manager
---------------
The main executable.
Base components
===============
ryu.base.app_manager
--------------------
.. automodule:: ryu.base.app_manager
OpenFlow controller
===================
ryu.controller.controller
-------------------------
.. automodule:: ryu.controller.controller
ryu.controller.dpset
--------------------
.. automodule:: ryu.controller.dpset
ryu.controller.ofp_event
------------------------
.. automodule:: ryu.controller.ofp_event
ryu.controller.ofp_handler
--------------------------
.. automodule:: ryu.controller.ofp_handler
OpenFlow wire protocol encoder and decoder
==========================================
ryu.ofproto.ofproto_v1_0
------------------------
.. automodule:: ryu.ofproto.ofproto_v1_0
ryu.ofproto.ofproto_v1_0_parser
-------------------------------
.. automodule:: ryu.ofproto.ofproto_v1_0_parser
ryu.ofproto.ofproto_v1_2
------------------------
.. automodule:: ryu.ofproto.ofproto_v1_2
ryu.ofproto.ofproto_v1_2_parser
-------------------------------
.. automodule:: ryu.ofproto.ofproto_v1_2_parser
ryu.ofproto.ofproto_v1_3
------------------------
.. automodule:: ryu.ofproto.ofproto_v1_3
ryu.ofproto.ofproto_v1_3_parser
-------------------------------
.. automodule:: ryu.ofproto.ofproto_v1_3_parser
ryu.ofproto.ofproto_v1_4
------------------------
.. automodule:: ryu.ofproto.ofproto_v1_4
ryu.ofproto.ofproto_v1_4_parser
-------------------------------
.. automodule:: ryu.ofproto.ofproto_v1_4_parser
ryu.ofproto.ofproto_v1_5
------------------------
.. automodule:: ryu.ofproto.ofproto_v1_5
ryu.ofproto.ofproto_v1_5_parser
-------------------------------
.. automodule:: ryu.ofproto.ofproto_v1_5_parser
Ryu applications
================
ryu.app.cbench
--------------
.. automodule:: ryu.app.cbench
ryu.app.simple_switch
---------------------
.. automodule:: ryu.app.simple_switch
ryu.topology
------------
.. automodule:: ryu.topology
Libraries
=========
ryu.lib.packet
--------------
.. automodule:: ryu.lib.packet
ryu.lib.ovs
-----------
.. automodule:: ryu.lib.ovs
ryu.lib.of_config
-----------------
.. automodule:: ryu.lib.of_config
ryu.lib.netconf
---------------
.. automodule:: ryu.lib.netconf
ryu.lib.xflow
-------------
.. automodule:: ryu.lib.xflow
Third party libraries
=====================
ryu.contrib.ovs
---------------
Open vSwitch python binding. Used by ryu.lib.ovs.
ryu.contrib.oslo.config
-----------------------
Oslo configuration library. Used for ryu-manager's command-line options
and configuration files.
ryu.contrib.ncclient
--------------------
Python library for NETCONF client. Used by ryu.lib.of_config.

View File

@ -17,6 +17,7 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('.'))
from ryu import version as ryu_version
@ -93,7 +94,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'haiku'
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -131,6 +132,7 @@ html_static_path = ['_static']
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# (Deprecated since version 1.6)
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
@ -214,9 +216,9 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'ryu', u'ryu Documentation',
[u'ryu development team'], 1),
('man/rpc_cli', 'rpc-cli', u'a simple msgpack-rpc client',
[u'ryu development team'], 1),
('man/ryu_manager', 'ryu-manager', u'ryu manager',
[u'ryu development team'], 1),
[u'Ryu development team'], 8),
('man/ryu', 'ryu', u'management for Ryu application',
[u'Ryu development team'], 8),
('man/ryu_manager', 'ryu-manager', 'management for Ryu application',
[u'Ryu development team'], 8),
]

View File

@ -6,4 +6,5 @@ Configuration
:maxdepth: 2
tls.rst
gui.rst

View File

@ -6,7 +6,9 @@ Writing Your Ryu Application
:maxdepth: 2
writing_ryu_app.rst
components.rst
ryu_app_api.rst
library.rst
ofproto_ref.rst
nicira_ext_ref.rst
api_ref.rst

2
doc/source/docutils.conf Normal file
View File

@ -0,0 +1,2 @@
[parsers]
smart_quotes: false

BIN
doc/source/gui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

33
doc/source/gui.rst Normal file
View File

@ -0,0 +1,33 @@
***************
Topology Viewer
***************
ryu.app.gui_topology.gui_topology provides topology visualization.
This depends on following ryu applications.
===================== =================================================
ryu.app.rest_topology Get node and link data.
ryu.app.ws_topology Being notified change of link up/down.
ryu.app.ofctl_rest Get flows of datapaths.
===================== =================================================
Usage
=====
Run mininet (or join your real environment)::
$ sudo mn --controller remote --topo tree,depth=3
Run GUI application::
$ PYTHONPATH=. ./bin/ryu run --observe-links ryu/app/gui_topology/gui_topology.py
Access http://<ip address of ryu host>:8080 with your web browser.
Screenshot
==========
.. image:: gui.png
:width: 640 px

View File

@ -15,7 +15,9 @@ Contents:
getting_started.rst
developing.rst
configuration.rst
using_with_openstack.rst
tests.rst
snort_integrate.rst
app.rst
Indices and tables
==================

View File

@ -9,4 +9,10 @@ Ryu provides some useful library for your network applications.
library_packet.rst
library_packet_ref.rst
library_pcap.rst
library_of_config.rst
library_bgp_speaker.rst
library_bgp_speaker_ref.rst
library_mrt.rst
library_ovsdb_manager.rst
library_ovsdb.rst

View File

@ -0,0 +1,61 @@
*******************
BGP speaker library
*******************
Introduction
============
Ryu BGP speaker library helps you to enable your code to speak BGP
protocol. The library supports IPv4, IPv4 MPLS-labeled VPN, IPv6
MPLS-labeled VPN and L2VPN EVPN address families.
Example
=======
The following simple code creates a BGP instance with AS number 64512
and Router ID 10.0.0.1. It tries to establish a bgp session with a
peer (its IP is 192.168.177.32 and the AS number is 64513). The
instance advertizes some prefixes.
.. code-block:: python
import eventlet
# BGPSpeaker needs sockets patched
eventlet.monkey_patch()
# initialize a log handler
# this is not strictly necessary but useful if you get messages like:
# No handlers could be found for logger "ryu.lib.hub"
import logging
import sys
log = logging.getLogger()
log.addHandler(logging.StreamHandler(sys.stderr))
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
def dump_remote_best_path_change(event):
print 'the best path changed:', event.remote_as, event.prefix,\
event.nexthop, event.is_withdraw
def detect_peer_down(remote_ip, remote_as):
print 'Peer down:', remote_ip, remote_as
if __name__ == "__main__":
speaker = BGPSpeaker(as_number=64512, router_id='10.0.0.1',
best_path_change_handler=dump_remote_best_path_change,
peer_down_handler=detect_peer_down)
speaker.neighbor_add('192.168.177.32', 64513)
# uncomment the below line if the speaker needs to talk with a bmp server.
# speaker.bmp_server_add('192.168.177.2', 11019)
count = 1
while True:
eventlet.sleep(30)
prefix = '10.20.' + str(count) + '.0/24'
print "add a new prefix", prefix
speaker.prefix_add(prefix)
count += 1
if count == 4:
speaker.shutdown()
break

View File

@ -0,0 +1,21 @@
*********************************
BGP speaker library API Reference
*********************************
BGPSpeaker class
================
.. autoclass:: ryu.services.protocols.bgp.bgpspeaker.BGPSpeaker
:members:
.. autoclass:: ryu.services.protocols.bgp.bgpspeaker.EventPrefix
:members:
.. autoclass:: ryu.services.protocols.bgp.info_base.base.PrefixFilter
:members:
.. autoclass:: ryu.services.protocols.bgp.info_base.base.ASPathFilter
:members:
.. autoclass:: ryu.services.protocols.bgp.info_base.base.AttributeMap
:members:

View File

@ -0,0 +1,28 @@
****************
MRT file library
****************
Introduction
============
Ryu MRT file library helps you to read/write MRT
(Multi-Threaded Routing Toolkit) Routing Information Export Format
[`RFC6396`_].
.. _RFC6396: https://tools.ietf.org/html/rfc6396
Reading MRT file
================
For loading the routing information contained in MRT files, you can use
mrtlib.Reader.
.. autoclass:: ryu.lib.mrtlib.Reader
Writing MRT file
================
For dumping the routing information which your RyuApp generated, you can use
mrtlib.Writer.
.. autoclass:: ryu.lib.mrtlib.Writer

View File

@ -0,0 +1,76 @@
*************
OVSDB library
*************
Path: ``ryu.lib.ovs``
Similar to the :doc:`library_ovsdb_manager`, this library enables your
application to speak the OVSDB protocol (RFC7047_), but differ from the
:doc:`library_ovsdb_manager`, this library will initiate connections from
controller side as ovs-vsctl_ command does.
Please make sure that your devices are listening on either the Unix domain
socket or TCP/SSL port before calling the APIs of this library.
.. code-block:: bash
# Show current configuration
$ ovs-vsctl get-manager
# Set TCP listen address
$ ovs-vsctl set-manager "ptcp:6640"
See manpage of ovs-vsctl_ command for more details.
.. _RFC7047: https://tools.ietf.org/html/rfc7047
.. _ovs-vsctl: http://openvswitch.org/support/dist-docs/ovs-vsctl.8.txt
Basic Usage
===========
1. Instantiate :py:mod:`ryu.lib.ovs.vsctl.VSCtl`.
2. Construct commands with :py:mod:`ryu.lib.ovs.vsctl.VSCtlCommand`.
The syntax is almost the same as ovs-vsctl_ command.
3. Execute commands via :py:mod:`ryu.lib.ovs.vsctl.VSCtl.run_command`.
Example
-------
.. code-block:: python
from ryu.lib.ovs import vsctl
OVSDB_ADDR = 'tcp:127.0.0.1:6640'
ovs_vsctl = vsctl.VSCtl(OVSDB_ADDR)
# Equivalent to
# $ ovs-vsctl show
command = vsctl.VSCtlCommand('show')
ovs_vsctl.run_command([command])
print(command)
# >>> VSCtlCommand(args=[],command='show',options=[],result='830d781f-c3c8-4b4f-837e-106e1b33d058\n ovs_version: "2.8.90"\n')
# Equivalent to
# $ ovs-vsctl list Port s1-eth1
command = vsctl.VSCtlCommand('list', ('Port', 's1-eth1'))
ovs_vsctl.run_command([command])
print(command)
# >>> VSCtlCommand(args=('Port', 's1-eth1'),command='list',options=[],result=[<ovs.db.idl.Row object at 0x7f525fb682e8>])
print(command.result[0].name)
# >>> s1-eth1
API Reference
=============
ryu.lib.ovs.vsctl
-----------------
.. automodule:: ryu.lib.ovs.vsctl
:members:
ryu.lib.ovs.bridge
------------------
.. automodule:: ryu.lib.ovs.bridge
:members:

View File

@ -0,0 +1,99 @@
*********************
OVSDB Manager library
*********************
Path: ``ryu.services.protocols.ovsdb``
Introduction
============
Ryu OVSDB Manager library allows your code to interact with devices
speaking the OVSDB protocol. This enables your code to perform remote
management of the devices and react to topology changes on them.
Please note this library will spawn a server listening on the port 6640 (the
IANA registered for OVSDB protocol), but does not initiate connections from
controller side.
Then, to make your devices connect to Ryu, you need to tell the controller IP
address and port to your devices.
.. code-block:: bash
# Show current configuration
$ ovs-vsctl get-manager
# Set manager (controller) address
$ ovs-vsctl set-manager "tcp:127.0.0.1:6640"
# If you want to specify IPv6 address, wrap ip with brackets
$ ovs-vsctl set-manager "tcp:[::1]:6640"
Also this library identifies the devices by "system-id" which should be unique,
persistent identifier among all devices connecting to a single controller.
Please make sure "system-id" is configured before connecting.
.. code-block:: bash
# Show current configuration
$ ovs-vsctl get Open_vSwitch . external_ids:system-id
# Set system-id manually
$ ovs-vsctl set Open_vSwitch . external_ids:system-id=<SYSTEM-ID>
Example
=======
The following logs all new OVSDB connections in "handle_new_ovsdb_connection"
and also provides the API "create_port" for creating a port on a bridge.
.. code-block:: python
import uuid
from ryu.base import app_manager
from ryu.controller.handler import set_ev_cls
from ryu.services.protocols.ovsdb import api as ovsdb
from ryu.services.protocols.ovsdb import event as ovsdb_event
class MyApp(app_manager.RyuApp):
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
def handle_new_ovsdb_connection(self, ev):
system_id = ev.system_id
address = ev.client.address
self.logger.info(
'New OVSDB connection from system-id=%s, address=%s',
system_id, address)
# Example: If device has bridge "s1", add port "s1-eth99"
if ovsdb.bridge_exists(self, system_id, "s1"):
self.create_port(system_id, "s1", "s1-eth99")
def create_port(self, system_id, bridge_name, name):
new_iface_uuid = uuid.uuid4()
new_port_uuid = uuid.uuid4()
bridge = ovsdb.row_by_name(self, system_id, bridge_name)
def _create_port(tables, insert):
iface = insert(tables['Interface'], new_iface_uuid)
iface.name = name
iface.type = 'internal'
port = insert(tables['Port'], new_port_uuid)
port.name = name
port.interfaces = [iface]
bridge.ports = bridge.ports + [port]
return new_port_uuid, new_iface_uuid
req = ovsdb_event.EventModifyRequest(system_id, _create_port)
rep = self.send_request(req)
if rep.status != 'success':
self.logger.error('Error creating port %s on bridge %s: %s',
name, bridge, rep.status)
return None
return rep.insert_uuids[new_port_uuid]

View File

@ -85,12 +85,18 @@ serialize method. You have the raw data to send. The following example
is building an arp packet.
.. code-block:: python
e = ethernet.ethernet(dst, src, ether.ETH_TYPE_8021Q)
from ryu.ofproto import ether
from ryu.lib.packet import ethernet, arp, packet
e = ethernet.ethernet(dst='ff:ff:ff:ff:ff:ff',
src='08:60:6e:7f:74:e7',
ethertype=ether.ETH_TYPE_ARP)
a = arp.arp(hwtype=1, proto=0x0800, hlen=6, plen=4, opcode=2,
src='08:60:6e:7f:74:e7', src_ip='192.0.2.1',
dst='00:00:00:00:00:00', dst_ip='192.0.2.2')
src_mac='08:60:6e:7f:74:e7', src_ip='192.0.2.1',
dst_mac='00:00:00:00:00:00', dst_ip='192.0.2.2')
p = packet.Packet()
p.add_protocol(e)
p.add_protocol(a)
p.serialize()
print repr(p.data) # the on-wire packet

View File

@ -14,103 +14,15 @@ Stream Parser class
.. automodule:: ryu.lib.packet.stream_parser
:members:
.. autoclass:: ryu.lib.packet.bgp.StreamParser
:members:
List of the sub-classes:
- :py:mod:`ryu.lib.packet.bgp.StreamParser`
Protocol Header classes
=======================
.. automodule:: ryu.lib.packet.packet_base
:members:
.. toctree::
:glob:
.. automodule:: ryu.lib.packet.ethernet
:members:
.. automodule:: ryu.lib.packet.vlan
:members:
.. automodule:: ryu.lib.packet.pbb
:members:
.. automodule:: ryu.lib.packet.mpls
:members:
.. automodule:: ryu.lib.packet.arp
:members:
.. automodule:: ryu.lib.packet.ipv4
:members:
.. automodule:: ryu.lib.packet.icmp
:members:
.. automodule:: ryu.lib.packet.ipv6
:members:
.. automodule:: ryu.lib.packet.icmpv6
:members:
.. automodule:: ryu.lib.packet.tcp
:members:
.. automodule:: ryu.lib.packet.udp
:members:
.. autoclass:: ryu.lib.packet.dhcp.dhcp
:members:
.. autoclass:: ryu.lib.packet.dhcp.options
:members:
.. autoclass:: ryu.lib.packet.dhcp.option
:members:
.. autoclass:: ryu.lib.packet.vrrp.vrrp
:members:
.. autoclass:: ryu.lib.packet.vrrp.vrrpv2
:members:
.. autoclass:: ryu.lib.packet.vrrp.vrrpv3
:members:
.. autoclass:: ryu.lib.packet.slow.slow
:members:
.. autoclass:: ryu.lib.packet.slow.lacp
:members:
.. autoclass:: ryu.lib.packet.llc.llc
:members:
.. autoclass:: ryu.lib.packet.llc.ControlFormatI
:members:
.. autoclass:: ryu.lib.packet.llc.ControlFormatS
:members:
.. autoclass:: ryu.lib.packet.llc.ControlFormatU
:members:
.. autoclass:: ryu.lib.packet.bpdu.bpdu
:members:
.. autoclass:: ryu.lib.packet.bpdu.ConfigurationBPDUs
:members:
.. autoclass:: ryu.lib.packet.bpdu.TopologyChangeNotificationBPDUs
:members:
.. autoclass:: ryu.lib.packet.bpdu.RstBPDUs
:members:
.. autoclass:: ryu.lib.packet.igmp.igmp
:members:
.. autoclass:: ryu.lib.packet.igmp.igmpv3_query
:members:
.. autoclass:: ryu.lib.packet.igmp.igmpv3_report
:members:
.. autoclass:: ryu.lib.packet.igmp.igmpv3_report_group
:members:
.. autoclass:: ryu.lib.packet.bgp.BGPMessage
:members:
.. autoclass:: ryu.lib.packet.bgp.BGPOpen
:members:
.. autoclass:: ryu.lib.packet.bgp.BGPUpdate
:members:
.. autoclass:: ryu.lib.packet.bgp.BGPKeepAlive
:members:
.. autoclass:: ryu.lib.packet.bgp.BGPNotification
:members:
.. automodule:: ryu.lib.packet.sctp
:members:
library_packet_ref/packet_base
library_packet_ref/*

View File

@ -0,0 +1,6 @@
***
ARP
***
.. automodule:: ryu.lib.packet.arp
:members:

View File

@ -0,0 +1,6 @@
*****************
Packet Base Class
*****************
.. automodule:: ryu.lib.packet.packet_base
:members:

View File

@ -0,0 +1,6 @@
***
BFD
***
.. automodule:: ryu.lib.packet.bfd
:members:

View File

@ -0,0 +1,6 @@
***
BGP
***
.. automodule:: ryu.lib.packet.bgp
:members:

View File

@ -0,0 +1,6 @@
***
BMP
***
.. automodule:: ryu.lib.packet.bmp
:members:

View File

@ -0,0 +1,6 @@
****
BPDU
****
.. automodule:: ryu.lib.packet.bpdu
:members:

View File

@ -0,0 +1,6 @@
***
CFM
***
.. automodule:: ryu.lib.packet.cfm
:members:

View File

@ -0,0 +1,6 @@
****
DHCP
****
.. automodule:: ryu.lib.packet.dhcp
:members:

View File

@ -0,0 +1,6 @@
*****
DHCP6
*****
.. automodule:: ryu.lib.packet.dhcp6
:members:

View File

@ -0,0 +1,6 @@
********
Ethernet
********
.. automodule:: ryu.lib.packet.ethernet
:members:

View File

@ -0,0 +1,6 @@
******
Geneve
******
.. automodule:: ryu.lib.packet.geneve
:members:

View File

@ -0,0 +1,6 @@
***
GRE
***
.. automodule:: ryu.lib.packet.gre
:members:

View File

@ -0,0 +1,6 @@
****
ICMP
****
.. automodule:: ryu.lib.packet.icmp
:members:

View File

@ -0,0 +1,6 @@
******
ICMPv6
******
.. automodule:: ryu.lib.packet.icmpv6
:members:

View File

@ -0,0 +1,6 @@
****
IGMP
****
.. automodule:: ryu.lib.packet.igmp
:members:

View File

@ -0,0 +1,6 @@
****
IPv4
****
.. automodule:: ryu.lib.packet.ipv4
:members:

View File

@ -0,0 +1,6 @@
****
IPv6
****
.. automodule:: ryu.lib.packet.ipv6
:members:

View File

@ -0,0 +1,6 @@
***
LLC
***
.. automodule:: ryu.lib.packet.llc
:members:

View File

@ -0,0 +1,6 @@
****
LLDP
****
.. automodule:: ryu.lib.packet.lldp
:members:

View File

@ -0,0 +1,6 @@
****
MPLS
****
.. automodule:: ryu.lib.packet.mpls
:members:

View File

@ -0,0 +1,6 @@
********
OpenFlow
********
.. automodule:: ryu.lib.packet.openflow
:members:

View File

@ -0,0 +1,6 @@
****
OSPF
****
.. automodule:: ryu.lib.packet.ospf
:members:

View File

@ -0,0 +1,6 @@
***
PBB
***
.. automodule:: ryu.lib.packet.pbb
:members:

View File

@ -0,0 +1,6 @@
****
SCTP
****
.. automodule:: ryu.lib.packet.sctp
:members:

View File

@ -0,0 +1,6 @@
****
Slow
****
.. automodule:: ryu.lib.packet.slow
:members:

View File

@ -0,0 +1,6 @@
***
TCP
***
.. automodule:: ryu.lib.packet.tcp
:members:

View File

@ -0,0 +1,6 @@
***
UDP
***
.. automodule:: ryu.lib.packet.udp
:members:

View File

@ -0,0 +1,6 @@
****
VLAN
****
.. automodule:: ryu.lib.packet.vlan
:members:

View File

@ -0,0 +1,6 @@
****
VRRP
****
.. automodule:: ryu.lib.packet.vrrp
:members:

View File

@ -0,0 +1,6 @@
*****
VXLAN
*****
.. automodule:: ryu.lib.packet.vxlan
:members:

View File

@ -0,0 +1,6 @@
*****
Zebra
*****
.. automodule:: ryu.lib.packet.zebra
:members:

View File

@ -0,0 +1,27 @@
*****************
PCAP file library
*****************
Introduction
============
Ryu PCAP file library helps you to read/write PCAP file which file
format are described in `The Wireshark Wiki`_.
.. _The Wireshark Wiki: https://wiki.wireshark.org/Development/LibpcapFileFormat
Reading PCAP file
=================
For loading the packet data containing in PCAP files, you can use
pcaplib.Reader.
.. autoclass:: ryu.lib.pcaplib.Reader
Writing PCAP file
=================
For dumping the packet data which your RyuApp received, you can use
pcaplib.Writer.
.. autoclass:: ryu.lib.pcaplib.Writer

View File

@ -1,20 +0,0 @@
:orphan:
rpc-cli manual page
===================
Synoposis
---------
**rpc-cli** [*options*]
Description
-----------
:program:`rpc-cli` is a simple msgpack-rpc client.
Options
-------
-h, --help
Author
------
Ryu development team

48
doc/source/man/ryu.rst Normal file
View File

@ -0,0 +1,48 @@
:orphan:
ryu manual page
===============
Synopsis
--------
**ryu** [-h] [--config-dir DIR] [--config-file PATH] [--version] [subcommand] ...
Description
-----------
:program:`ryu` is the executable for Ryu applications. ryu loads a sub-module
corresponding to the sub-command and run it. 'run' sub-command is an
equivalent to ryu-manager.
Ryu is a component-based software defined networking framework. Ryu
provides software components with well defined API that make it easy for
developers to create new network management and control applications.
Ryu supports various protocols for managing network devices, such as
OpenFlow, Netconf, OF-config, etc. About OpenFlow, Ryu supports fully
1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
Options
-------
subcommand
[rpc-cli|run|of-config-cli]
subcommand_args
subcommand specific arguments
-h, --help
show this help message and exit
--config-dir DIR
Path to a config directory to pull \*.conf files from.
This file set is sorted, so as to provide a predictable
parse order if individual options are over-ridden. The
set is parsed after the file(s) specified via previous
--config-file, arguments hence over-ridden options in
the directory take precedence.
--config-file PATH
Path to a config file to use. Multiple config files can
be specified, with values in later files taking
precedence. The default files used are: None
--version
show program's version number and exit

View File

@ -3,22 +3,182 @@
ryu-manager manual page
=======================
Synoposis
---------
**ryu-manager** [*options*] <ryu apps>[, <ryu apps> ...]
Synopsis
--------
**ryu-manager** [-h]
[--app-lists APP_LISTS] [--ca-certs CA_CERTS]
[--config-dir DIR] [--config-file PATH]
[--ctl-cert CTL_CERT] [--ctl-privkey CTL_PRIVKEY]
[--default-log-level DEFAULT_LOG_LEVEL] [--explicit-drop]
[--install-lldp-flow] [--log-config-file LOG_CONFIG_FILE]
[--log-dir LOG_DIR] [--log-file LOG_FILE]
[--log-file-mode LOG_FILE_MODE]
[--neutron-admin-auth-url NEUTRON_ADMIN_AUTH_URL]
[--neutron-admin-password NEUTRON_ADMIN_PASSWORD]
[--neutron-admin-tenant-name NEUTRON_ADMIN_TENANT_NAME]
[--neutron-admin-username NEUTRON_ADMIN_USERNAME]
[--neutron-auth-strategy NEUTRON_AUTH_STRATEGY]
[--neutron-controller-addr NEUTRON_CONTROLLER_ADDR]
[--neutron-url NEUTRON_URL]
[--neutron-url-timeout NEUTRON_URL_TIMEOUT]
[--noexplicit-drop] [--noinstall-lldp-flow]
[--noobserve-links] [--nouse-stderr] [--nouse-syslog]
[--noverbose] [--observe-links]
[--ofp-listen-host OFP_LISTEN_HOST]
[--ofp-ssl-listen-port OFP_SSL_LISTEN_PORT]
[--ofp-tcp-listen-port OFP_TCP_LISTEN_PORT] [--use-stderr]
[--use-syslog] [--verbose] [--version]
[--wsapi-host WSAPI_HOST] [--wsapi-port WSAPI_PORT]
[--test-switch-dir TEST-SWITCH_DIR]
[--test-switch-target TEST-SWITCH_TARGET]
[--test-switch-tester TEST-SWITCH_TESTER]
[app [app ...]]
Description
-----------
:program:`ryu-manger` is an Operating System for Software Defined Networking
:program:`ryu-manager` is the executable for Ryu applications. ryu-manager
loads Ryu applications and run it.
Ryu is a component-based software defined networking framework. Ryu
provides software components with well defined API that make it easy for
developers to create new network management and control applications.
Ryu supports various protocols for managing network devices, such as
OpenFlow, Netconf, OF-config, etc. About OpenFlow, Ryu supports fully
1.0, 1.2, 1.3, 1.4 and Nicira Extensions.
Options
-------
app
application module name to run
-h, --help
show this help message and exit
See also
--------
:manpage:`ryu-client(1)`
--app-lists APP_LISTS
application module name to run
Author
------
Ryu development team
--ca-certs CA_CERTS
CA certificates
--config-dir DIR
Path to a config directory to pull \*.conf files from.
This file set is sorted, so as to provide a
predictable parse order if individual options are
over-ridden. The set is parsed after the file(s)
specified via previous --config-file, arguments hence
over-ridden options in the directory take precedence.
--config-file PATH
Path to a config file to use. Multiple config files
can be specified, with values in later files taking
precedence. The default files used are: None
--ctl-cert CTL_CERT
controller certificate
--ctl-privkey CTL_PRIVKEY
controller private key
--default-log-level DEFAULT_LOG_LEVEL
default log level
--explicit-drop
link discovery: explicitly drop lldp packet in
--install-lldp-flow
link discovery: explicitly install flow entry to send
lldp packet to controller
--log-config-file LOG_CONFIG_FILE
Path to a logging config file to use
--log-dir LOG_DIR
log file directory
--log-file LOG_FILE
log file name
--log-file-mode LOG_FILE_MODE
default log file permission
--neutron-admin-auth-url NEUTRON_ADMIN_AUTH_URL
auth url for connecting to neutron in admin context
--neutron-admin-password NEUTRON_ADMIN_PASSWORD
password for connecting to neutron in admin context
--neutron-admin-tenant-name NEUTRON_ADMIN_TENANT_NAME
tenant name for connecting to neutron in admin context
--neutron-admin-username NEUTRON_ADMIN_USERNAME
username for connecting to neutron in admin context
--neutron-auth-strategy NEUTRON_AUTH_STRATEGY
auth strategy for connecting to neutron in admincontext
--neutron-controller-addr NEUTRON_CONTROLLER_ADDR
openflow method:address:port to set controller ofovs bridge
--neutron-url NEUTRON_URL
URL for connecting to neutron
--neutron-url-timeout NEUTRON_URL_TIMEOUT
timeout value for connecting to neutron in seconds
--noexplicit-drop
The inverse of --explicit-drop
--noinstall-lldp-flow
The inverse of --install-lldp-flow
--noobserve-links
The inverse of --observe-links
--nouse-stderr
The inverse of --use-stderr
--nouse-syslog
The inverse of --use-syslog
--noverbose
The inverse of --verbose
--observe-links
observe link discovery events.
--ofp-listen-host OFP_LISTEN_HOST
openflow listen host
--ofp-ssl-listen-port OFP_SSL_LISTEN_PORT
openflow ssl listen port
--ofp-tcp-listen-port OFP_TCP_LISTEN_PORT
openflow tcp listen port
--use-stderr
log to standard error
--use-syslog
output to syslog
--verbose
show debug output
--version
show program's version number and exit
--wsapi-host WSAPI_HOST
webapp listen host
--wsapi-port WSAPI_PORT
webapp listen port
--test-switch-dir TEST-SWITCH_DIR
test files directory
--test-switch-target TEST-SWITCH_TARGET
target sw dp-id
--test-switch-tester TEST-SWITCH_TESTER
tester sw dp-id

View File

@ -0,0 +1,69 @@
***************************
Nicira Extension Structures
***************************
.. _nx_actions_structures:
Nicira Extension Actions Structures
===================================
The followings shows the supported NXAction classes only in OpenFlow1.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. py:currentmodule:: ryu.ofproto.ofproto_v1_0_parser
.. autoclass:: NXActionSetQueue
.. autoclass:: NXActionDecTtl
.. autoclass:: NXActionPushMpls
.. autoclass:: NXActionPopMpls
.. autoclass:: NXActionSetMplsTtl
.. autoclass:: NXActionDecMplsTtl
.. autoclass:: NXActionSetMplsLabel
.. autoclass:: NXActionSetMplsTc
The followings shows the supported NXAction classes in OpenFlow1.0 or later
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. py:currentmodule:: ryu.ofproto.ofproto_v1_3_parser
.. autoclass:: NXActionPopQueue
.. autoclass:: NXActionRegLoad
.. autoclass:: NXActionRegLoad2
.. autoclass:: NXActionNote
.. autoclass:: NXActionSetTunnel
.. autoclass:: NXActionSetTunnel64
.. autoclass:: NXActionRegMove
.. autoclass:: NXActionResubmit
.. autoclass:: NXActionResubmitTable
.. autoclass:: NXActionOutputReg
.. autoclass:: NXActionOutputReg2
.. autoclass:: NXActionLearn
.. autoclass:: NXActionExit
.. autoclass:: NXActionController
.. autoclass:: NXActionController2
.. autoclass:: NXActionDecTtlCntIds
.. autoclass:: NXActionStackPush
.. autoclass:: NXActionStackPop
.. autoclass:: NXActionSample
.. autoclass:: NXActionSample2
.. autoclass:: NXActionFinTimeout
.. autoclass:: NXActionConjunction
.. autoclass:: NXActionMultipath
.. autoclass:: NXActionBundle
.. autoclass:: NXActionBundleLoad
.. autoclass:: NXActionCT
.. autoclass:: NXActionNAT
.. autoclass:: NXActionOutputTrunc
.. autoclass:: NXActionDecNshTtl
.. autoclass:: NXFlowSpecMatch
.. autoclass:: NXFlowSpecLoad
.. autoclass:: NXFlowSpecOutput
.. autofunction:: ryu.ofproto.nicira_ext.ofs_nbits
.. _nx_match_structures:
Nicira Extended Match Structures
================================
.. automodule:: ryu.ofproto.nicira_ext

View File

@ -8,5 +8,8 @@ OpenFlow protocol API Reference
:maxdepth: 3
ofproto_base.rst
ofproto_v1_0_ref.rst
ofproto_v1_2_ref.rst
ofproto_v1_3_ref.rst
ofproto_v1_4_ref.rst
ofproto_v1_5_ref.rst

View File

@ -0,0 +1,294 @@
*************************************
OpenFlow v1.0 Messages and Structures
*************************************
.. py:currentmodule:: ryu.ofproto.ofproto_v1_0_parser
Controller-to-Switch Messages
=============================
Handshake
---------
.. autoclass:: OFPFeaturesRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-5-features_request.packet.json
.. autoclass:: OFPSwitchFeatures
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json
Switch Configuration
--------------------
.. autoclass:: OFPSetConfig
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-7-ofp_set_config.packet.json
.. autoclass:: OFPGetConfigRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-8-ofp_get_config_request.packet.json
.. autoclass:: OFPGetConfigReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-9-ofp_get_config_reply.packet.json
Modify State Messages
---------------------
.. autoclass:: OFPFlowMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-2-ofp_flow_mod.packet.json
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-3-ofp_flow_mod.packet.json
.. autoclass:: OFPPortMod
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-22-ofp_port_mod.packet.json
Queue Configuration Messages
----------------------------
.. autoclass:: OFPQueueGetConfigRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-35-ofp_queue_get_config_request.packet.json
.. autoclass:: OFPQueueGetConfigReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-36-ofp_queue_get_config_reply.packet.json
Read State Messages
-------------------
.. autoclass:: OFPDescStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-24-ofp_desc_stats_request.packet.json
.. autoclass:: OFPDescStatsReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-0-ofp_desc_stats_reply.packet.json
.. autoclass:: OFPFlowStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-11-ofp_flow_stats_request.packet.json
.. autoclass:: OFPFlowStatsReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-12-ofp_flow_stats_reply.packet.json
.. autoclass:: OFPAggregateStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-25-ofp_aggregate_stats_request.packet.json
.. autoclass:: OFPAggregateStatsReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-26-ofp_aggregate_stats_reply.packet.json
.. autoclass:: OFPTableStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-27-ofp_table_stats_request.packet.json
.. autoclass:: OFPTableStatsReply
.. XXX commented out because it's too long
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-28-ofp_table_stats_reply.packet.json
.. autoclass:: OFPPortStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-29-ofp_port_stats_request.packet.json
.. autoclass:: OFPPortStatsReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-30-ofp_port_stats_reply.packet.json
.. autoclass:: OFPQueueStatsRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-37-ofp_queue_stats_request.packet.json
.. autoclass:: OFPQueueStatsReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-38-ofp_queue_stats_reply.packet.json
.. autoclass:: OFPVendorStatsRequest
.. autoclass:: OFPVendorStatsReply
Send Packet Message
-------------------
.. autoclass:: OFPPacketOut
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-1-ofp_packet_out.packet.json
Barrier Message
---------------
.. autoclass:: OFPBarrierRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-17-ofp_barrier_request.packet.json
.. autoclass:: OFPBarrierReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-18-ofp_barrier_reply.packet.json
Asynchronous Messages
=====================
Packet-In Message
-----------------
.. autoclass:: OFPPacketIn
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-4-ofp_packet_in.packet.json
Flow Removed Message
--------------------
.. autoclass:: OFPFlowRemoved
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-40-ofp_flow_removed.packet.json
Port Status Message
-------------------
.. autoclass:: OFPPortStatus
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-39-ofp_port_status.packet.json
Error Message
-------------
.. autoclass:: OFPErrorMsg
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-15-ofp_error_msg.packet.json
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-41-ofp_error_msg_vendor.packet.json
Symmetric Messages
==================
Hello
-----
.. autoclass:: OFPHello
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-10-ofp_hello.packet.json
Echo Request
------------
.. autoclass:: OFPEchoRequest
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-13-ofp_echo_request.packet.json
Echo Reply
----------
.. autoclass:: OFPEchoReply
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-14-ofp_echo_reply.packet.json
Vendor
------------
.. autoclass:: OFPVendor
.. JSON Example:
..
.. .. literalinclude:: ../../ryu/tests/unit/ofproto/json/of10/1-16-ofp_vendor.packet.json
Port Structures
===============
.. autoclass:: OFPPhyPort
Flow Match Structure
====================
.. autoclass:: OFPMatch
Action Structures
=================
.. autoclass:: OFPActionHeader
.. autoclass:: OFPAction
.. autoclass:: OFPActionOutput
.. autoclass:: OFPActionVlanVid
.. autoclass:: OFPActionVlanPcp
.. autoclass:: OFPActionStripVlan
.. autoclass:: OFPActionDlAddr
.. autoclass:: OFPActionSetDlSrc
.. autoclass:: OFPActionSetDlDst
.. autoclass:: OFPActionNwAddr
.. autoclass:: OFPActionSetNwSrc
.. autoclass:: OFPActionSetNwDst
.. autoclass:: OFPActionSetNwTos
.. autoclass:: OFPActionTpPort
.. autoclass:: OFPActionSetTpSrc
.. autoclass:: OFPActionSetTpDst
.. autoclass:: OFPActionEnqueue
.. autoclass:: OFPActionVendor

View File

@ -312,6 +312,11 @@ Experimenter
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of12/3-16-ofp_experimenter.packet.json
Port Structures
===============
.. autoclass:: OFPPort
Flow Match Structure
====================

View File

@ -235,7 +235,9 @@ Multipart Messages
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of13/4-56-ofp_table_features_reply.packet.json
See an example in:
``ryu/tests/unit/ofproto/json/of13/4-56-ofp_table_features_reply.packet.json``
Queue Configuration Messages
----------------------------
@ -394,6 +396,11 @@ Experimenter
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of13/4-16-ofp_experimenter.packet.json
Port Structures
===============
.. autoclass:: OFPPort
Flow Match Structure
====================

View File

@ -0,0 +1,530 @@
*************************************
OpenFlow v1.4 Messages and Structures
*************************************
.. py:currentmodule:: ryu.ofproto.ofproto_v1_4_parser
Controller-to-Switch Messages
=============================
Handshake
---------
.. autoclass:: OFPFeaturesRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-5-ofp_features_request.packet.json
.. autoclass:: OFPSwitchFeatures
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-6-ofp_features_reply.packet.json
Switch Configuration
--------------------
.. autoclass:: OFPSetConfig
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-7-ofp_set_config.packet.json
.. autoclass:: OFPGetConfigRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-8-ofp_get_config_request.packet.json
.. autoclass:: OFPGetConfigReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-9-ofp_get_config_reply.packet.json
Modify State Messages
---------------------
.. autoclass:: OFPTableMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-23-ofp_table_mod.packet.json
.. autoclass:: OFPFlowMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-2-ofp_flow_mod.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-3-ofp_flow_mod.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-44-ofp_flow_mod.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-58-ofp_flow_mod.packet.json
.. autoclass:: OFPGroupMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-21-ofp_group_mod.packet.json
.. autoclass:: OFPPortMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-22-ofp_port_mod.packet.json
.. autoclass:: OFPMeterMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-43-ofp_meter_mod.packet.json
Multipart Messages
------------------
.. autoclass:: OFPDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-24-ofp_desc_request.packet.json
.. autoclass:: OFPDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-0-ofp_desc_reply.packet.json
.. autoclass:: OFPFlowStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-11-ofp_flow_stats_request.packet.json
.. autoclass:: OFPFlowStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json
.. autoclass:: OFPAggregateStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-25-ofp_aggregate_stats_request.packet.json
.. autoclass:: OFPAggregateStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-26-ofp_aggregate_stats_reply.packet.json
.. autoclass:: OFPTableStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-27-ofp_table_stats_request.packet.json
.. autoclass:: OFPTableStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-28-ofp_table_stats_reply.packet.json
.. autoclass:: OFPTableDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-61-ofp_table_desc_request.packet.json
.. autoclass:: OFPTableDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-62-ofp_table_desc_reply.packet.json
.. autoclass:: OFPTableFeaturesStatsRequest
JSON Example:
See an example in:
``ryu/tests/unit/ofproto/json/of14/5-53-ofp_table_features_request.packet.json``
.. autoclass:: OFPTableFeaturesStatsReply
JSON Example:
See an example in:
``ryu/tests/unit/ofproto/json/of14/5-54-ofp_table_features_reply.packet.json``
.. autoclass:: OFPPortStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-29-ofp_port_stats_request.packet.json
.. autoclass:: OFPPortStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-30-ofp_port_stats_reply.packet.json
.. autoclass:: OFPPortDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-51-ofp_port_desc_request.packet.json
.. autoclass:: OFPPortDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-52-ofp_port_desc_reply.packet.json
.. autoclass:: OFPQueueStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-35-ofp_queue_stats_request.packet.json
.. autoclass:: OFPQueueStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-36-ofp_queue_stats_reply.packet.json
.. autoclass:: OFPQueueDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-63-ofp_queue_desc_request.packet.json
.. autoclass:: OFPQueueDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-64-ofp_queue_desc_reply.packet.json
.. autoclass:: OFPGroupStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-55-ofp_group_stats_request.packet.json
.. autoclass:: OFPGroupStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-56-ofp_group_stats_reply.packet.json
.. autoclass:: OFPGroupDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-33-ofp_group_desc_request.packet.json
.. autoclass:: OFPGroupDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-34-ofp_group_desc_reply.packet.json
.. autoclass:: OFPGroupFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-31-ofp_group_features_request.packet.json
.. autoclass:: OFPGroupFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-32-ofp_group_features_reply.packet.json
.. autoclass:: OFPMeterStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-47-ofp_meter_stats_request.packet.json
.. autoclass:: OFPMeterStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-48-ofp_meter_stats_reply.packet.json
.. autoclass:: OFPMeterConfigStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-45-ofp_meter_config_request.packet.json
.. autoclass:: OFPMeterConfigStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-46-ofp_meter_config_reply.packet.json
.. autoclass:: OFPMeterFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-49-ofp_meter_features_request.packet.json
.. autoclass:: OFPMeterFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-50-ofp_meter_features_reply.packet.json
.. autoclass:: OFPFlowMonitorRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-66-ofp_flow_monitor_request.packet.json
.. autoclass:: OFPFlowMonitorReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-67-ofp_flow_monitor_reply.packet.json
.. autoclass:: OFPExperimenterStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-59-ofp_experimenter_request.packet.json
.. autoclass:: OFPExperimenterStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-60-ofp_experimenter_reply.packet.json
Packet-Out Message
------------------
.. autoclass:: OFPPacketOut
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-1-ofp_packet_out.packet.json
Barrier Message
---------------
.. autoclass:: OFPBarrierRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-17-ofp_barrier_request.packet.json
.. autoclass:: OFPBarrierReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-18-ofp_barrier_reply.packet.json
Role Request Message
--------------------
.. autoclass:: OFPRoleRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-19-ofp_role_request.packet.json
.. autoclass:: OFPRoleReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-20-ofp_role_reply.packet.json
Bundle Messages
---------------
.. autoclass:: OFPBundleCtrlMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-69-ofp_bundle_ctrl_msg.packet.json
.. autoclass:: OFPBundleAddMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-70-ofp_bundle_add_msg.packet.json
Set Asynchronous Configuration Message
--------------------------------------
.. autoclass:: OFPSetAsync
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-42-ofp_set_async.packet.json
.. autoclass:: OFPGetAsyncRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-40-ofp_get_async_request.packet.json
.. autoclass:: OFPGetAsyncReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-41-ofp_get_async_reply.packet.json
Asynchronous Messages
=====================
Packet-In Message
-----------------
.. autoclass:: OFPPacketIn
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-4-ofp_packet_in.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-57-ofp_packet_in.packet.json
Flow Removed Message
--------------------
.. autoclass:: OFPFlowRemoved
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-38-ofp_flow_removed.packet.json
Port Status Message
-------------------
.. autoclass:: OFPPortStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-37-ofp_port_status.packet.json
Controller Role Status Message
------------------------------
.. autoclass:: OFPRoleStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-65-ofp_role_status.packet.json
Table Status Message
--------------------
.. autoclass:: OFPTableStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-68-ofp_table_status.packet.json
Request Forward Message
-----------------------
.. autoclass:: OFPRequestForward
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-71-ofp_requestforward.packet.json
Symmetric Messages
==================
Hello
-----
.. autoclass:: OFPHello
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-10-ofp_hello.packet.json
.. autoclass:: OFPHelloElemVersionBitmap
Echo Request
------------
.. autoclass:: OFPEchoRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-13-ofp_echo_request.packet.json
Echo Reply
----------
.. autoclass:: OFPEchoReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-14-ofp_echo_reply.packet.json
Error Message
-------------
.. autoclass:: OFPErrorMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-15-ofp_error_msg.packet.json
Experimenter
------------
.. autoclass:: OFPExperimenter
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of14/5-16-ofp_experimenter.packet.json
Port Structures
===============
.. autoclass:: OFPPort
Flow Match Structure
====================
.. autoclass:: OFPMatch
Flow Instruction Structures
===========================
.. autoclass:: OFPInstructionGotoTable
.. autoclass:: OFPInstructionWriteMetadata
.. autoclass:: OFPInstructionActions
.. autoclass:: OFPInstructionMeter
Action Structures
=================
.. autoclass:: OFPActionOutput
.. autoclass:: OFPActionCopyTtlOut
.. autoclass:: OFPActionCopyTtlIn
.. autoclass:: OFPActionSetMplsTtl
.. autoclass:: OFPActionDecMplsTtl
.. autoclass:: OFPActionPushVlan
.. autoclass:: OFPActionPopVlan
.. autoclass:: OFPActionPushMpls
.. autoclass:: OFPActionPopMpls
.. autoclass:: OFPActionSetQueue
.. autoclass:: OFPActionGroup
.. autoclass:: OFPActionSetNwTtl
.. autoclass:: OFPActionDecNwTtl
.. autoclass:: OFPActionSetField
.. autoclass:: OFPActionPushPbb
.. autoclass:: OFPActionPopPbb
.. autoclass:: OFPActionExperimenter

View File

@ -0,0 +1,577 @@
*************************************
OpenFlow v1.5 Messages and Structures
*************************************
.. py:currentmodule:: ryu.ofproto.ofproto_v1_5_parser
Controller-to-Switch Messages
=============================
Handshake
---------
.. autoclass:: OFPFeaturesRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-features_request.packet.json
.. autoclass:: OFPSwitchFeatures
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-features_reply.packet.json
Switch Configuration
--------------------
.. autoclass:: OFPSetConfig
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-set_config.packet.json
.. autoclass:: OFPGetConfigRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-get_config_request.packet.json
.. autoclass:: OFPGetConfigReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-get_config_reply.packet.json
Modify State Messages
---------------------
.. autoclass:: OFPTableMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_mod.packet.json
.. autoclass:: OFPFlowMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_mod.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_mod_conjunction.packet.json
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_mod_match_conj.packet.json
.. autoclass:: OFPGroupMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_mod.packet.json
.. autoclass:: OFPPortMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_mod.packet.json
.. autoclass:: OFPMeterMod
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_mod.packet.json
Multipart Messages
------------------
.. autoclass:: OFPDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-desc_request.packet.json
.. autoclass:: OFPDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-desc_reply.packet.json
.. autoclass:: OFPFlowDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_desc_request.packet.json
.. autoclass:: OFPFlowDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_desc_reply.packet.json
.. autoclass:: OFPFlowStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_stats_request.packet.json
.. autoclass:: OFPFlowStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_stats_reply.packet.json
.. autoclass:: OFPAggregateStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-aggregate_stats_request.packet.json
.. autoclass:: OFPAggregateStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-aggregate_stats_reply.packet.json
.. autoclass:: OFPPortStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_stats_request.packet.json
.. autoclass:: OFPPortStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_stats_reply.packet.json
.. autoclass:: OFPPortDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_desc_request.packet.json
.. autoclass:: OFPPortDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_desc_reply.packet.json
.. autoclass:: OFPQueueStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-queue_stats_request.packet.json
.. autoclass:: OFPQueueStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-queue_stats_reply.packet.json
.. autoclass:: OFPQueueDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-queue_desc_request.packet.json
.. autoclass:: OFPQueueDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-queue_desc_reply.packet.json
.. autoclass:: OFPGroupStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_stats_request.packet.json
.. autoclass:: OFPGroupStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_stats_reply.packet.json
.. autoclass:: OFPGroupDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_desc_request.packet.json
.. autoclass:: OFPGroupDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_desc_reply.packet.json
.. autoclass:: OFPGroupFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_features_request.packet.json
.. autoclass:: OFPGroupFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-group_features_reply.packet.json
.. autoclass:: OFPMeterStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_stats_request.packet.json
.. autoclass:: OFPMeterStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_stats_reply.packet.json
.. autoclass:: OFPMeterDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_desc_request.packet.json
.. autoclass:: OFPMeterDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_desc_reply.packet.json
.. autoclass:: OFPMeterFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_features_request.packet.json
.. autoclass:: OFPMeterFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-meter_features_reply.packet.json
.. autoclass:: OFPControllerStatusStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-controller_status_request.packet.json
.. autoclass:: OFPControllerStatusStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-controller_status_reply.packet.json
.. autoclass:: OFPTableStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_stats_request.packet.json
.. autoclass:: OFPTableStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_stats_reply.packet.json
.. autoclass:: OFPTableDescStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_desc_request.packet.json
.. autoclass:: OFPTableDescStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_desc_reply.packet.json
.. autoclass:: OFPTableFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_features_request.packet.json
.. autoclass:: OFPTableFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_features_reply.packet.json
.. autoclass:: OFPFlowMonitorRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_monitor_request.packet.json
.. autoclass:: OFPFlowMonitorReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_monitor_reply.packet.json
.. autoclass:: OFPBundleFeaturesStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-bundle_features_request.packet.json
.. autoclass:: OFPBundleFeaturesStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-bundle_features_reply.packet.json
.. autoclass:: OFPExperimenterStatsRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-experimenter_request.packet.json
.. autoclass:: OFPExperimenterStatsReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-experimenter_reply.packet.json
Packet-Out Message
------------------
.. autoclass:: OFPPacketOut
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-packet_out.packet.json
Barrier Message
---------------
.. autoclass:: OFPBarrierRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-barrier_request.packet.json
.. autoclass:: OFPBarrierReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-barrier_reply.packet.json
Role Request Message
--------------------
.. autoclass:: OFPRoleRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-role_request.packet.json
.. autoclass:: OFPRoleReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-role_reply.packet.json
Bundle Messages
---------------
.. autoclass:: OFPBundleCtrlMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-bundle_ctrl.packet.json
.. autoclass:: OFPBundleAddMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-bundle_add.packet.json
Set Asynchronous Configuration Message
--------------------------------------
.. autoclass:: OFPSetAsync
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-set_async.packet.json
.. autoclass:: OFPGetAsyncRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-get_async_request.packet.json
.. autoclass:: OFPGetAsyncReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-get_async_reply.packet.json
Asynchronous Messages
=====================
Packet-In Message
-----------------
.. autoclass:: OFPPacketIn
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-packet_in.packet.json
Flow Removed Message
--------------------
.. autoclass:: OFPFlowRemoved
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-flow_removed.packet.json
Port Status Message
-------------------
.. autoclass:: OFPPortStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-port_status.packet.json
Controller Role Status Message
------------------------------
.. autoclass:: OFPRoleStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-role_status.packet.json
Table Status Message
--------------------
.. autoclass:: OFPTableStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-table_status.packet.json
Request Forward Message
-----------------------
.. autoclass:: OFPRequestForward
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-requestforward.packet.json
Controller Status Message
-------------------------
.. autoclass:: OFPControllerStatus
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-controller_status.packet.json
Symmetric Messages
==================
Hello
-----
.. autoclass:: OFPHello
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-hello.packet.json
.. autoclass:: OFPHelloElemVersionBitmap
Echo Request
------------
.. autoclass:: OFPEchoRequest
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-echo_request.packet.json
Echo Reply
----------
.. autoclass:: OFPEchoReply
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-echo_reply.packet.json
Error Message
-------------
.. autoclass:: OFPErrorMsg
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-error_msg.packet.json
Experimenter
------------
.. autoclass:: OFPExperimenter
JSON Example:
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of15/libofproto-OFP15-error_msg_experimenter.packet.json
Port Structures
===============
.. autoclass:: OFPPort
Flow Match Structure
====================
.. autoclass:: OFPMatch
Flow Stats Structures
=====================
.. autoclass:: OFPStats
Flow Instruction Structures
===========================
.. autoclass:: OFPInstructionGotoTable
.. autoclass:: OFPInstructionWriteMetadata
.. autoclass:: OFPInstructionActions
.. autoclass:: OFPInstructionStatTrigger
Action Structures
=================
.. autoclass:: OFPActionOutput
.. autoclass:: OFPActionCopyTtlOut
.. autoclass:: OFPActionCopyTtlIn
.. autoclass:: OFPActionSetMplsTtl
.. autoclass:: OFPActionDecMplsTtl
.. autoclass:: OFPActionPushVlan
.. autoclass:: OFPActionPopVlan
.. autoclass:: OFPActionPushMpls
.. autoclass:: OFPActionPopMpls
.. autoclass:: OFPActionSetQueue
.. autoclass:: OFPActionGroup
.. autoclass:: OFPActionSetNwTtl
.. autoclass:: OFPActionDecNwTtl
.. autoclass:: OFPActionSetField
.. autoclass:: OFPActionPushPbb
.. autoclass:: OFPActionPopPbb
.. autoclass:: OFPActionCopyField
.. autoclass:: OFPActionMeter
.. autoclass:: OFPActionExperimenter
Controller Status Structure
===========================
.. autoclass:: OFPControllerStatusStats

View File

View File

@ -0,0 +1,3 @@
"""
dummy module.
"""

View File

@ -0,0 +1,7 @@
"""
dummy module.
"""
class QuantumClientException:
pass

View File

@ -0,0 +1,3 @@
"""
dummy module.
"""

View File

@ -11,7 +11,7 @@ Threads, events, and event queues
Ryu applications are single-threaded entities which implement
various functionalities in Ryu. Events are messages between them.
Ryu applications send asynchronous events each other.
Ryu applications send asynchronous events to each other.
Besides that, there are some Ryu-internal event sources which
are not Ryu applications. One of examples of such event sources
is OpenFlow controller.
@ -22,11 +22,11 @@ between Ryu applications.
Each Ryu application has a receive queue for events.
The queue is FIFO and preserves the order of events.
Each Ryu application has a thread for event processing.
The thread keep draining the receive queue by dequeueing an event
The thread keeps draining the receive queue by dequeueing an event
and calling the appropritate event handler for the event type.
Because the event handler is called in the context of
the event processing thread, it should be careful for blocking.
I.e. while an event handler is blocked, no further events for
the event processing thread, it should be careful when blocking.
While an event handler is blocked, no further events for
the Ryu application will be processed.
There are kinds of events which are used to implement synchronous
@ -82,18 +82,10 @@ For example, EventOFPPacketIn for packet-in message.
The OpenFlow controller part of Ryu automatically decodes OpenFlow messages
received from switches and send these events to Ryu applications which
expressed an interest using ryu.controller.handler.set_ev_cls.
OpenFlow event classes have at least the following attributes.
OpenFlow event classes are subclasses of the following class.
============ =============================================================
Attribute Description
============ =============================================================
msg An object which describes the corresponding OpenFlow message.
msg.datapath A ryu.controller.controller.Datapath instance which describes
an OpenFlow switch from which we received this OpenFlow message.
============ =============================================================
.. autoclass:: ryu.controller.ofp_event.EventOFPMsgBase
The msg object has some more additional members whose values are extracted
from the original OpenFlow message.
See :ref:`ofproto_ref` for more info about OpenFlow messages.
ryu.base.app_manager.RyuApp
@ -101,263 +93,87 @@ ryu.base.app_manager.RyuApp
See :ref:`api_ref`.
ryu.controller.handler.set_ev_cls(ev_cls, dispatchers=None)
===========================================================
ryu.controller.handler.set_ev_cls
=================================
A decorator for Ryu application to declare an event handler.
Decorated method will become an event handler.
ev_cls is an event class whose instances this RyuApp wants to receive.
dispatchers argument specifies one of the following negotiation phases
(or a list of them) for which events should be generated for this handler.
Note that, in case an event changes the phase, the phase before the change
is used to check the interest.
=========================================== ==================================
Negotiation phase Description
=========================================== ==================================
ryu.controller.handler.HANDSHAKE_DISPATCHER Sending and waiting for hello
message
ryu.controller.handler.CONFIG_DISPATCHER Version negotiated and sent
features-request message
ryu.controller.handler.MAIN_DISPATCHER Switch-features message received
and sent set-config message
ryu.controller.handler.DEAD_DISPATCHER Disconnect from the peer. Or
disconnecting due to some
unrecoverable errors.
=========================================== ==================================
.. autofunction:: ryu.controller.handler.set_ev_cls
ryu.controller.controller.Datapath
==================================
A class to describe an OpenFlow switch connected to this controller.
An instance has the following attributes.
====================================== =======================================
Attribute Description
====================================== =======================================
id 64-bit OpenFlow Datapath ID.
Only available for
ryu.controller.handler.MAIN_DISPATCHER
phase.
ofproto A module which exports OpenFlow
definitions, mainly constants appeared
in the specification, for the
negotiated OpenFlow version. For
example, ryu.ofproto.ofproto_v1_0 for
OpenFlow 1.0.
ofproto_parser A module which exports OpenFlow wire
message encoder and decoder for the
negotiated OpenFlow version. For
example, ryu.ofproto.ofproto_v1_0_parser
for OpenFlow 1.0.
ofproto_parser.OFPxxxx(datapath, ....) A callable to prepare an OpenFlow
message for the given switch. It can
be sent with Datapath.send_msg later.
xxxx is a name of the message. For
example OFPFlowMod for flow-mod
message. Arguemnts depend on the
message.
set_xid(self, msg) Generate an OpenFlow XID and put it
in msg.xid.
send_msg(self, msg) Queue an OpenFlow message to send to
the corresponding switch. If msg.xid
is None, set_xid is automatically
called on the message before queueing.
send_packet_out deprecated
send_flow_mod deprecated
send_flow_del deprecated
send_delete_all_flows deprecated
send_barrier Queue an OpenFlow barrier message to
send to the switch.
send_nxt_set_flow_format deprecated
is_reserved_port deprecated
====================================== =======================================
.. autoclass:: ryu.controller.controller.Datapath
ryu.controller.event.EventBase
==============================
The base of all event classes.
A Ryu application can define its own event type by creating a subclass.
.. autoclass:: ryu.controller.event.EventBase
ryu.controller.event.EventRequestBase
=====================================
The base class for synchronous request for RyuApp.send_request.
.. autoclass:: ryu.controller.event.EventRequestBase
ryu.controller.event.EventReplyBase
===================================
The base class for synchronous request reply for RyuApp.send_reply.
.. autoclass:: ryu.controller.event.EventReplyBase
ryu.controller.ofp_event.EventOFPStateChange
============================================
An event class for negotiation phase change notification.
An instance of this class is sent to observer after changing
the negotiation phase.
An instance has at least the following attributes.
.. autoclass:: ryu.controller.ofp_event.EventOFPStateChange
========= ====================================================================
Attribute Description
========= ====================================================================
datapath ryu.controller.controller.Datapath instance of the switch
========= ====================================================================
ryu.controller.ofp_event.EventOFPPortStateChange
================================================
.. autoclass:: ryu.controller.ofp_event.EventOFPPortStateChange
ryu.controller.dpset.EventDP
============================
An event class to notify connect/disconnect of a switch.
For OpenFlow switches, one can get the same notification by observing
ryu.controller.ofp_event.EventOFPStateChange.
An instance has at least the following attributes.
========= ====================================================================
Attribute Description
========= ====================================================================
dp A ryu.controller.controller.Datapath instance of the switch
enter True when the switch connected to our controller. False for
disconnect.
========= ====================================================================
.. autoclass:: ryu.controller.dpset.EventDP
ryu.controller.dpset.EventPortAdd
=================================
An event class for switch port status notification.
This event is generated when a new port is added to a switch.
For OpenFlow switches, one can get the same notification by observing
ryu.controller.ofp_event.EventOFPPortStatus.
An instance has at least the following attributes.
========= ====================================================================
Attribute Description
========= ====================================================================
dp A ryu.controller.controller.Datapath instance of the switch
port port number
========= ====================================================================
.. autoclass:: ryu.controller.dpset.EventPortAdd
ryu.controller.dpset.EventPortDelete
====================================
An event class for switch port status notification.
This event is generated when a port is removed from a switch.
For OpenFlow switches, one can get the same notification by observing
ryu.controller.ofp_event.EventOFPPortStatus.
An instance has at least the following attributes.
========= ====================================================================
Attribute Description
========= ====================================================================
dp A ryu.controller.controller.Datapath instance of the switch
port port number
========= ====================================================================
.. autoclass:: ryu.controller.dpset.EventPortDelete
ryu.controller.dpset.EventPortModify
====================================
An event class for switch port status notification.
This event is generated when some attribute of a port is changed.
For OpenFlow switches, one can get the same notification by observing
ryu.controller.ofp_event.EventOFPPortStatus.
An instance has at least the following attributes.
========= ====================================================================
Attribute Description
========= ====================================================================
dp A ryu.controller.controller.Datapath instance of the switch
port port number
========= ====================================================================
.. autoclass:: ryu.controller.dpset.EventPortModify
ryu.controller.network.EventNetworkPort
=======================================
An event class for notification of port arrival and deperture.
This event is generated when a port is introduced to or removed from a network
by the REST API.
An instance has at least the following attributes.
========== ===================================================================
Attribute Description
========== ===================================================================
network_id Network ID
dpid OpenFlow Datapath ID of the switch to which the port belongs.
port_no OpenFlow port number of the port
add_del True for adding a port. False for removing a port.
========== ===================================================================
.. autoclass:: ryu.controller.network.EventNetworkPort
ryu.controller.network.EventNetworkDel
======================================
An event class for network deletion.
This event is generated when a network is deleted by the REST API.
An instance has at least the following attributes.
========== ===================================================================
Attribute Description
========== ===================================================================
network_id Network ID
========== ===================================================================
.. autoclass:: ryu.controller.network.EventNetworkDel
ryu.controller.network.EventMacAddress
======================================
An event class for end-point MAC address registration.
This event is generated when a end-point MAC address is updated
by the REST API.
An instance has at least the following attributes.
=========== ==================================================================
Attribute Description
=========== ==================================================================
network_id Network ID
dpid OpenFlow Datapath ID of the switch to which the port belongs.
port_no OpenFlow port number of the port
mac_address The old MAC address of the port if add_del is False. Otherwise
the new MAC address.
add_del False if this event is a result of a port removal. Otherwise
True.
=========== ==================================================================
.. autoclass:: ryu.controller.network.EventMacAddress
ryu.controller.tunnels.EventTunnelKeyAdd
========================================
An event class for tunnel key registration.
This event is generated when a tunnel key is registered or updated
by the REST API.
An instance has at least the following attributes.
=========== ==================================================================
Attribute Description
=========== ==================================================================
network_id Network ID
tunnel_key Tunnel Key
=========== ==================================================================
.. autoclass:: ryu.controller.tunnels.EventTunnelKeyAdd
ryu.controller.tunnels.EventTunnelKeyDel
========================================
An event class for tunnel key registration.
This event is generated when a tunnel key is removed by the REST API.
An instance has at least the following attributes.
=========== ==================================================================
Attribute Description
=========== ==================================================================
network_id Network ID
tunnel_key Tunnel Key
=========== ==================================================================
.. autoclass:: ryu.controller.tunnels.EventTunnelKeyDel
ryu.controller.tunnels.EventTunnelPort
======================================
An event class for tunnel port registration.
This event is generated when a tunnel port is added or removed by the REST API.
An instance has at least the following attributes.
=========== ==================================================================
Attribute Description
=========== ==================================================================
dpid OpenFlow Datapath ID
port_no OpenFlow port number
remote_dpid OpenFlow port number of the tunnel peer
add_del True for adding a tunnel. False for removal.
=========== ==================================================================
.. autoclass:: ryu.controller.tunnels.EventTunnelPort

Some files were not shown because too many files have changed in this diff Show More