Age | Commit message (Collapse) | Author |
|
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The hook raises an AttributeError exception on Windows because
of recent changes in the pbr project. This fix solves the issue.
This is adapted from https://review.openstack.org/#/c/42170/
Since ryu didn't depend on pyudev, I think it no longer needs
a removal here.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this application provides the simple example of IGMP snooping.
the module "igmplib" mainly offers 2 functions:
- listening on in the IGMP conversation between multicast routers and hosts
- emulating of the querier function of multicast servers
the former operates a switch as a snooping switch and controls transmission of an unnecessary multicasting packet.
the latter realizes the IGMP conversation in the environment without multicast routers.
the module "simple_switch_igmp" is a variation of "simple_switch".
the switch receives the "EventPacketIn" event instead of the "EventOFPPacketIn" event from the module "igmplib" in order to except IGMP.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
rest_firewall outputs packet blocking log.
However it was not output about DENY rules,
it outputted only table-miss packets.
This patch improves it.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch implements the match conditions using IPv6.
NOTE: OpenFlow1.0 does not support IPv6.
e.g. using ofctl_rest)
curl -X POST -d '{"dpid": 1,
"match": {"eth_type": 34525,
"ipv6_src": "fe08:2001::/64",
"ipv6_dst": "ff02::1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
this patch gets match field names to support OXM field names.
NOTE: OpenFlow1.0 does not support OXM field names.
the compatibility is as follows:
dl_src eth_src
dl_dst eth_dst
dl_type eth_type
dl_vlan vlan_vid
nw_src ipv4_src
nw_dst ipv4_dst
nw_proto ip_proto
tp_src tcp_src or udp_src
tp_dst tcp_dst or udp_dst
for example, the following commands for ofctl_rest install the same flow entry.
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2048,
"nw_src": "192.168.1.1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
curl -X POST -d '{"dpid": 1,
"match": {"eth_type": 2048,
"ipv4_src": 192.168.1.1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
this patch makes ofctl_rest enable use of OpenFlow1.2.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
for convenience of api consumers, allows both of of-config style
element names (eg. logical-switches) and python style attribute
names (eg. logical_switches).
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
totally untested as i have no access to switches which support
the operation.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
the placement (ryu/tests/bin) was suggested by FUJITA Tomonori.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
tweak method to take of_config.classes classes instead of xml.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
some python classes for a set of OF-Config 1.1.1 types.
the goal is to allow programmers use OF-Config without direct
XML manipulations.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
will be used for OF-Config stuff.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
when oxm length is not what we expect, explicitly raise an exception
with descriptive message like the following.
Exception: Unexpected OXM payload length 3 for ipv6_flabel (expected 4)
This often happens if you are using LINC and IPv6.
https://github.com/FlowForwarding/of_protocol/pull/57
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Changes v2 -> v3:
- correct the following description
this patch implements a REST API for OFPMeterConfigStats.
e.g., when you send a MeterMod message as:
curl -X POST -d '{"dpid": 1,
"meter_id": 1,
"flags": "KBPS",
"bands": [{"type": "DROP", "rate": 1000},
{"type": "REMARK", "rate": 2000},
{"type": "EXPERIMENTER", "rate": 3000}
]}' http://localhost:8080/stats/meterentry/add
and you do the following command:
curl http://localhost:8080/stats/meterconfig/1
then you will get the configuration as:
{"1": [{"bands": [{"burst_size": 0, "rate": 1000, "type": "DROP"},
{"prec_level": 0, "burst_size": 0, "rate": 2000, "type": "REMARK"},
{"burst_size": 0, "rate": 3000, "experimenter": 0, "type": "EXPERIMENTER"}],
"flags": "KBPS",
"meter_id": 1}]}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
also use the default priority for FlowMod.
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
- add the insufficient handlers
- correct the using instance
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Support meter in FlowMod instructions and support MeterMod, MeterStats, MeterFeatures.
see following examples.
FlowMod with the meter instruction:
flow = {'match': {},
'actions': [{'type': 'METER',
'meter_id': 1}]
curl -X POST -d '{"dpid": 1, "match": {}, "actions": [{"type": "METER", "meter_id": 1}]}' http://localhost:8080/stats/flowentry/add
MeterMod:
meter = {'meter_id': 1,
'flags': 'KBPS',
'bands': [{'type': 'DROP',
'rate': 1000}]}
curl -X POST -d '{"dpid": 1, "meter_id": 1, "flags": "KBPS", "bands": [{"type": "DROP", "rate": 1000}]}' http://localhost:8080/stats/meterentry/add
NOTE: flags: 'KBPS', 'PKTPS', 'BURST', 'STATS'
type: 'DROP', 'REMARK', 'EXPERIMENTER'
MeterStats:
curl http://localhost:8080/stats/meter/1
MetetFeatures:
curl http://localhost:8080/stats/meterfeatures/1
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Support metadata in FlowMod instructions and match.
both a decimal number and a hexadecimal number are able to use in 'metadata' and 'metadata_mask'.
all the following examples express the same flow entry.
flow = {'match': {'metadata': '12345/4095'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': '12345',
'metadata_mask': '4095'}]}
flow = {'match': {'metadata': '12345/4095'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': 12345,
'metadata_mask': 4095}]}
flow = {'match': {'metadata': '0x3039/0xfff'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': '0x3039',
'metadata_mask': '0xfff'}]}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
feeding bytearray to struct.unpack() crashes on some environment.
(depends on the interpreter versions? i'm not sure.)
this fixes the following crash in the unit test.
the crash was seen on travis-ci, too.
https://travis-ci.org/osrg/ryu/jobs/15578909
https://s3.amazonaws.com/archive.travis-ci.org/jobs/15578909/log.txt
======================================================================
ERROR: test_hello (packet.test_ospf.Test_ospf)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/yamamoto/git/ryu/ryu/tests/unit/packet/test_ospf.py", line 68, in test_hello
msg2, cls, rest = ospf.OSPFMessage.parser(binmsg)
File "/Users/yamamoto/git/ryu/ryu/lib/packet/ospf.py", line 443, in parser
kwargs = subcls.parser(binmsg)
File "/Users/yamamoto/git/ryu/ryu/lib/packet/ospf.py", line 501, in parser
n = addrconv.ipv4.bin_to_text(n)
File "/Users/yamamoto/git/ryu/ryu/lib/addrconv.py", line 30, in bin_to_text
return str(self._addr(self._strat.packed_to_int(bin),
File "/Users/yamamoto/git/ryu/.venv/lib/python2.7/site-packages/netaddr/strategy/ipv4.py", line 196, in packed_to_int
return _struct.unpack('>I', packed_int)[0]
error: unpack requires a string argument of length 4
----------------------------------------------------------------------
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
rest_firewall had used the max_len value of flow_mod message which ofctl_v1_x specified.
in response to change ofctl_v1_x, rest_firewall gets to use the specified max_len explicitly.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes the max_len of flow_mod message more flexible.
before applying this patch:
ofctl_v1_0: 128 bytes for packet_in (fixed size) and none for others (fixed)
ofctl_v1_2: 128 bytes for packet_in (fixed size) and 0 for others (fixed size)
ofctl_v1_3: 0 for all by default (flexible)
ofctl_v1_3 will send 0 byte length data in a packet_in message if max_len is not specified.
after applying this patch:
all version: MAX_LEN for all by default (flexible)
NOTE: MAX_LEN is 65535 for OF1.0, and is OFPCML_MAX for OF1.2/1.3.
max_len is omissible by every ofctl.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes some json members of several packet libraries human-readable.
ex) ethernet.ethernet
before applying this patch:
{'ethernet': {'ethertype': 2048, 'dst': 'ZmY6ZmY6ZmY6ZmY6ZmY6ZmY=', 'src': 'MDA6MDA6MDA6MDA6MDA6MDA='}}
after applying this patch:
{'ethernet': {'ethertype': 2048, 'dst': u'ff:ff:ff:ff:ff:ff', 'src': u'00:00:00:00:00:00'}}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
What this patch implements:
This patch implements a script that provides the simple test environment that includes 2 switches and 2 links for the test tool as follows:
+-----------+
+----------| target sw | The OpenFlow switch to be tested (Open vSwitch)
| +-----------+
+------------+ (1) (2)
| controller | | |
+------------+ (1) (2)
| +-----------+
+----------| tester sw | OpenFlow Switch (Open vSwitch)
+-----------+
(X) : port number
How to run:
Do the following command:
sudo ryu/tests/switch/run_mininet.py
And then, run the test tool at another terminal:
ryu-manager ryu/tests/switch/tester.py
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
What this patch implements:
This patch implements the test files for the test tool.
These test files aim to examine 'match' of FlowMod message.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
What this patch implements:
This patch implements the test files for the test tool.
These test files aim to examine 'set-field action' of FlowMod message.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
What this patch implements:
This patch implements the test files for the test tool.
These test files aim to examine 'action' excluding 'set-field' of FlowMod message.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
What this patch implements:
This patch implements a tool which performs OpenFlow conformance testing.
The tool can:
- install various flow entries of OpenFlow 1.3 as follows:
* all 'action' except SET_QUEUE and GROUP
* all 'match' except IN_PHY_PORT
- confirm whether the datapath works correctly according to the installed flow entries.
Required test environment:
The tool requires the test environment that includes 2 switches and 2 links as follows:
+-----------+
+----------| target sw | The OpenFlow switch to be tested
| +-----------+
+------------+ (1) (2)
| controller | | |
+------------+ (1) (2)
| +-----------+
+----------| tester sw | OpenFlow Switch
+-----------+
(X) : port number
How does the tool work:
The tool will:
- install the flow entries into the target switch.
- transmit a packet from the tester switch to the target switch.
* According to the installed flow entries, the target switch outputs a packet towards the tester switch.
* The tester switch sends a PacketIn message to the tool.
- examine the packet that is included in the PacketIn message and output the result.
* The tool supports also the table-miss examinations.
The tool processes test files in the specified directory sequentially.
By forming the result, you can create the list as:
http://osrg.github.io/ryu-certification/switch/ovs.html
http://osrg.github.io/ryu-certification/switch/LINC.html
http://osrg.github.io/ryu-certification/switch/ofsoftswitch13.html
Required test file format:
[
"test name",
{
test pattern #01
},
{
test pattern #02
}, ...
]
Each test pattern has the following internal format:
{
"description": description of this test pattern,
"prerequisite": [
FlowMod messages used by this test pattern
],
"tests": [
"ingress": inbound packet data,
"egress": outbound packet data,
"PACKET-IN": packet data sent by PacketIn message,
"table-miss": table id in which table-miss occurs
]
}
The extensions of the test files have to be '.json'.
How to run:
Do the following command:
ryu-manager ryu/tests/switch/tester.py
The following options can be used:
- --test-switch-target (target sw dp-id)
- --test-switch-tester (tester sw dp-id)
- --test-switch-dir (test files directory)
ex)
ryu-manager --test-switch-target 0000000000000005 --test-switch-dir /home/ryu/tests ryu/tests/switch/tester.py
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
I'm resending the patches which appease pep8
fletcher checksum function for OSPF LSA checksum.
refer to RFC1008.
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
the length of opt_header has to be a multiple of 8.
wrong:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| nxt | size | (opt)type=1 | (opt)len=6 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (opt)data='\x00\x00\x00\x00\x00\x00' (6 octet) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
right:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| nxt | size | (opt)type=1 | (opt)len=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (opt)data='\x00\x00\x00\x00' (4 octet) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch adds tests that examine reversibility about json for all packet library.
the test codes are written as:
jsondict = msg1.to_jsondict()
msg2 = cls.from_jsondict(jsondict['msg'])
eq_(str(msg1), str(msg2))
TODO: make VRRP reversible.
since VRRP has an unusual construction method, VRRP is not reversible about json.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
to_jsondict() JSON-izes public member variables of the object.
from_jsondict() calls the constructor using JSON members as the arguments.
LACP has the public member that is not required for the constructor, so TypeError occurs in from_jsondict().
this patch suppresses the output of to_jsondict() by changing unnecessary public members into protected members.
examination code:
from ryu.lib.packet import slow
msg1 = slow.lacp()
print msg1
jsondict = msg1.to_jsondict()
msg2 = slow.lacp.from_jsondict(jsondict['lacp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
lacp(actor_key=0,actor_length=20,actor_port=0,actor_port_priority=0,actor_state=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,actor_tag=1,collector_length=16,collector_max_delay=0,collector_tag=3,partner_key=0,partner_length=20,partner_port=0,partner_port_priority=0,partner_state=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,partner_tag=2,subtype=1,terminator_length=0,terminator_tag=0,version=1)
CLS <class 'ryu.lib.packet.slow.lacp'>
ARG {'actor_state_distributing': 0, 'actor_length': 20, 'actor_system': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'collector_max_delay': 0, 'terminator_length': 0, 'collector_length': 16, 'partner_state_synchronization': 0, 'partner_state_timeout': 0, 'partner_state_distributing': 0, 'partner_state_collecting': 0, 'actor_state_synchronization': 0, 'actor_state_expired': 0, 'actor_state_defaulted': 0, 'partner_state_expired': 0, 'partner_state': 0, 'partner_system_priority': 0, 'actor_state_aggregation': 0, 'version': 1, 'partner_port': 0, 'partner_length': 20, 'collector_tag': 3, 'partner_state_defaulted': 0, 'actor_state_timeout': 0, 'actor_port_priority': 0, 'partner_state_activity': 0, 'actor_state_activity': 0, 'terminator_tag': 0, 'actor_system_priority': 0, 'actor_key': 0, 'partner_system': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'partner_tag': 2, 'actor_state': 0, 'actor_port': 0, 'partner_state_aggregation': 0, 'partner_port_priority': 0, 'actor_tag': 1, 'subtype': 1, 'partner_key': 0, 'actor_state
_collecting': 0}
KWARG {'actor_state_distributing': 0, 'actor_length': 20, 'actor_system': '00:00:00:00:00:00', 'collector_max_delay': 0, 'terminator_length': 0, 'collector_length': 16, 'partner_state_synchronization': 0, 'partner_state_timeout': 0, 'partner_state_distributing': 0, 'partner_state_collecting': 0, 'actor_state_synchronization': 0, 'actor_state_expired': 0, 'actor_state_defaulted': 0, 'partner_state_expired': 0, 'partner_state': 0, 'partner_system_priority': 0, 'actor_state_aggregation': 0, 'version': 1, 'partner_port': 0, 'partner_length': 20, 'collector_tag': 3, 'partner_state_defaulted': 0, 'actor_state_timeout': 0, 'actor_port_priority': 0, 'partner_state_activity': 0, 'actor_state_activity': 0, 'terminator_tag': 0, 'actor_system_priority': 0, 'actor_key': 0, 'partner_system': '00:00:00:00:00:00', 'partner_tag': 2, 'actor_state': 0, 'actor_port': 0, 'partner_state_aggregation': 0, 'partner_port_priority': 0, 'actor_tag': 1, 'subtype': 1, 'partner_key': 0, 'actor_state_collecting'
: 0}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
TypeError: __init__() got an unexpected keyword argument 'actor_length'
after applying this patch:
lacp(actor_key=0,actor_port=0,actor_port_priority=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,collector_max_delay=0,partner_key=0,partner_port=0,partner_port_priority=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,version=1)
lacp(actor_key=0,actor_port=0,actor_port_priority=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,collector_max_delay=0,partner_key=0,partner_port=0,partner_port_priority=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,version=1)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although SCTP is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'param' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import sctp
msg1 = sctp.sctp(chunks=[sctp.chunk_init(params=[sctp.param_cookie_preserve()])])
print msg1
jsondict = msg1.to_jsondict()
msg2 = sctp.sctp.from_jsondict(jsondict['sctp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 291, in from_jsondict
kwargs = cls._restore_args(_mapdict_kv(decode, dict_))
File "/usr/local/lib/python2.7/dist-packages/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 "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 290, in <lambda>
decode = lambda k, x: cls._decode_value(k, x, decode_string)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 234, in _decode_value
return cls._get_decoder(k, decode_string)(json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 242, in _decode
v = map(_decode, json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 245, in _decode
v = cls.obj_from_jsondict(json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 223, in obj_from_jsondict
return obj_cls.from_jsondict(v)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/sctp.py", line 273, in __init__
assert isinstance(one, param)
AssertionError
after applying this patch:
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although LLDP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import lldp
msg1 = lldp.lldp([lldp.ChassisID(subtype=lldp.ChassisID.SUB_MAC_ADDRESS, chassis_id='\x00\x00\x00\x00\x00\x00')])
print msg1
jsondict = msg1.to_jsondict()
msg2 = lldp.lldp.from_jsondict(jsondict['lldp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
lldp(tlvs=[{'ChassisID': {'subtype': 4, 'typelen': 519, 'chassis_id': '\x00\x00\x00\x00\x00\x00', 'len': 7}}])
False
after applying this patch:
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although LLDP is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'control' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import llc
msg1 = llc.llc(dsap_addr=66, ssap_addr=66, control=llc.ControlFormatI())
print msg1
jsondict = msg1.to_jsondict()
msg2 = llc.llc.from_jsondict(jsondict['llc'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/llc.py", line 140, in __init__
assert getattr(control, 'TYPE', None) in self._CTR_TYPES
AssertionError
after applying this patch:
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although IPv6 is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'ext_hdrs' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import ipv6
msg1 = ipv6.ipv6(ext_hdrs=[ipv6.hop_opts()])
print msg1
jsondict = msg1.to_jsondict()
msg2 = ipv6.ipv6.from_jsondict(jsondict['ipv6'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/ipv6.py", line 86, in __init__
assert isinstance(ext_hdr, header)
AssertionError
after applying this patch:
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although ICMPv6 is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import icmpv6
msg1 = icmpv6.icmpv6(data=icmpv6.nd_neighbor())
print msg1
jsondict = msg1.to_jsondict()
msg2 = icmpv6.icmpv6.from_jsondict(jsondict['icmpv6'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
icmpv6(code=0,csum=0,data={'nd_neighbor': {'res': 0, 'dst': '::', 'option': None}},type_=0)
False
after applying this patch:
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although ICMP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import icmp
msg1 = icmp.icmp(data=icmp.echo())
print msg1
jsondict = msg1.to_jsondict()
msg2 = icmp.icmp.from_jsondict(jsondict['icmp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
icmp(code=0,csum=0,data={'echo': {'data': None, 'id': 0, 'seq': 0}},type=8)
False
after applying this patch:
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although DHCP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import dhcp
msg1 = dhcp.dhcp(op=dhcp.DHCP_BOOT_REQUEST, chaddr='00:00:00:00:00:00', options=dhcp.options())
print msg1
jsondict = msg1.to_jsondict()
msg2 = dhcp.dhcp.from_jsondict(jsondict['dhcp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0')
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options={'options': {'option_list': [], 'magic_cookie': '99.130.83.99', 'options_len': 0}},secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0')
False
after applying this patch:
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0')
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0')
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|