2209 Commits

Author SHA1 Message Date
FUJITA Tomonori
3f448ad2e4 Ryu 3.20
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.20
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>
v3.19
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>
v3.18
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