this set implements basic ryu of-wire classes <-> json conversions.
- if it needs to be more human-readable than base64,
probably explicit annotations are necessary.
- xxx: this assumes attribute names match __init__ args exactly.
("type_" vs "type")
- xxx: other of-wire versions
- xxx: unit tests
any comments?
json representation examples:
{"OFPMatch": {"dl_type": 0, "wildcards": 4194303, "nw_dst": 0, "dl_vlan_pcp":
0, "dl_src": "AAAAAAAA", "nw_proto": 0, "nw_tos": 0, "tp_dst": 0, "tp_src": 0,
"dl_dst": "AAAAAAAA", "dl_vlan": 0, "nw_src": 0, "in_port": 0}}
{"OFPPacketIn": {"reason": 0, "total_len": 64, "data":
"gAAAAAAMAAUAAAAMCABFAAAyAAAAAED/9yzAqAAowKgBKHoYWGsRCJf1GeJlfgfMMcMRx8QMi5VRUTNUUdUANg==",
"in_port": 1, "buffer_id": 6}}
{"OFPSwitchFeatures": {"datapath_id": 7, "n_tables": 2, "capabilities": 0,
"actions": 2047, "ports": {"1": {"OFPPhyPort": {"hw_addr": "GsFR/++K", "curr":
192, "name": "dmV0aDEAAAAAAAAAAAAAAA==", "supported": 0, "state": 0,
"advertised": 0, "peer": 0, "config": 0, "port_no": 1}}, "2": {"OFPPhyPort":
{"hw_addr": "zi+ih/Zw", "curr": 192, "name": "dmV0aDMAAAAAAAAAAAAAAA==",
"supported": 0, "state": 0, "advertised": 0, "peer": 0, "config": 0, "port_no":
2}}, "3": {"OFPPhyPort": {"hw_addr": "yooe83fv", "curr": 192, "name":
"dmV0aDUAAAAAAAAAAAAAAA==", "supported": 0, "state": 0, "advertised": 0,
"peer": 0, "config": 0, "port_no": 3}}, "4": {"OFPPhyPort": {"hw_addr":
"+rx3jX4L", "curr": 192, "name": "dmV0aDcAAAAAAAAAAAAAAA==", "supported": 0,
"state": 0, "advertised": 0, "peer": 0, "config": 0, "port_no": 4}}},
"n_buffers": 256}}
YAMAMOTO Takashi (2):
json representation of of-wire classes
of-wire json: adapt OF1.0
ryu/ofproto/ofproto_parser.py | 71 ++++++++++++++++++++++++++++++++++++++
ryu/ofproto/ofproto_v1_0_parser.py | 17 +++++----
2 files changed, 79 insertions(+), 9 deletions(-)
--
1.8.0.1
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel