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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>