summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2013-12-12packet lib: dhcp: fix reversibility about jsonYuichi Ito
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>
2013-12-12packet lib: bpdu: fix reversibility about jsonYuichi Ito
to_jsondict() JSON-izes public member variables of the object. from_jsondict() calls the constructor using JSON members as the arguments. BPDU 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 bpdu msg1 = bpdu.RstBPDUs() print msg1 jsondict = msg1.to_jsondict() msg2 = bpdu.RstBPDUs.from_jsondict(jsondict['RstBPDUs']) print msg2 print str(msg1) == str(msg2) before applying this patch: RstBPDUs(bpdu_type=2,bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,protocol_id=0,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0,version_1_length=0,version_id=2) CLS <class 'ryu.lib.packet.bpdu.RstBPDUs'> ARG {'max_age': 20, 'bpdu_type': 2, 'bridge_mac_address': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'hello_time': 2, 'protocol_id': 0, 'bridge_priority': 32768, 'message_age': 0, 'version_id': 2, 'port_priority': 128, 'flags': 0, 'root_priority': 32768, 'version_1_length': 0, 'root_path_cost': 0, 'port_number': 0, 'root_mac_address': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'root_system_id_extension': 0, 'forward_delay': 15, 'bridge_system_id_extension': 0} KWARG {'max_age': 20, 'bpdu_type': 2, 'bridge_mac_address': '00:00:00:00:00:00', 'hello_time': 2, 'protocol_id': 0, 'bridge_priority': 32768, 'message_age': 0, 'version_id': 2, 'port_priority': 128, 'flags': 0, 'root_priority': 32768, 'version_1_length': 0, 'root_path_cost': 0, 'port_number': 0, 'root_mac_address': '00:00:00:00:00:00', 'root_system_id_extension': 0, 'forward_delay': 15, 'bridge_system_id_extension': 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 'bpdu_type' after applying this patch: RstBPDUs(bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0) RstBPDUs(bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0) True Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-12packet lib: bgp: fix reversibility about jsonYuichi Ito
although BGP 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 bgp msg1 = bgp.BGPUpdate(withdrawn_routes=[bgp.BGPWithdrawnRoute(length=0, addr='192.168.0.1')]) print msg1 jsondict = msg1.to_jsondict() msg2 = bgp.BGPUpdate.from_jsondict(jsondict['BGPUpdate']) print msg2 print str(msg1) == str(msg2) before applying this patch: BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None) BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[{'BGPWithdrawnRoute': {'length': 0, 'addr': '192.168.0.1'}}],withdrawn_routes_len=None) False after applying this patch: BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None) BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None) True Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-12packet lib: packet_base: add a method which makes '_class_prefixes' easy to useYuichi Ito
the variable '_class_prefixes' of stringify.StringifyMixin is used to help the method 'from_jsondict()' to create the class instance. '_class_prefixes' requires a list of the class names. some classes have another list of the class names already. this patch adds a method which makes '_class_prefixes' by using the existing list. before applying this patch: (e.g. ryu.lib.packet.ipv6) # append the name to another list @ipv6.register_header_type(inet.IPPROTO_HOPOPTS) class hop_opts(opt_header): ... @ipv6.register_header_type(inet.IPPROTO_DSTOPTS) class dst_opts(opt_header): .... # append the name again ipv6._class_prefixes = ['hop_opts', 'dst_opts', ...] after applying this patch: (e.g. ryu.lib.packet.ipv6) # append the name to another list @ipv6.register_header_type(inet.IPPROTO_HOPOPTS) class hop_opts(opt_header): ... @ipv6.register_header_type(inet.IPPROTO_DSTOPTS) class dst_opts(opt_header): .... # create the new list from another list ipv6.set_classes(ipv6._IPV6_EXT_HEADER_TYPE) Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-11stplib: support OF 1.2/1.3watanabe.fumitaka
ryu/lib/stplib.py : Support OpenFlow 1.2/1.3 ryu/app/simple_switch_stp.py : Correspondence to parameter change of stplib.EventPortStateChange Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-07stplib: Reduction of the number of threadswatanabe.fumitaka
The number of threads was reduced for the simplification of processing. There was three sending BPDU threads before. - send Config BPDU thread - send TopologyChange BPDU thread - send TopologyChangeNotification BPDU thread They were unified to one thread. - send BPDU thread Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-05add OpenFlow 1.4 definitionsFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-04packet lib: igmp: support default parametersYuichi Ito
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-03Ryu 3.4FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-12-02vrrp: handle interface failureFUJITA Tomonori
handle temporary interface failure. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29rpc-cli man pageYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29a simple command line msgpack-rpc clientYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29add rpc.Client.peek_notificationYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29msgpack-rpc: unit testsYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29rpc: prefix closed_by_peer with _ as it's privateYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29rpc: If the socket is closed by peer, endpoint stop the serve.yuta-hamada
If client does socket.close() the serve will be non-wait looping. So must stop the serve of endpoint that received 0 byte packet. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29msgpack-rpc fixes and improvementsYAMAMOTO Takashi
- make create_request returns msgid - fix msgid wrap around - rename classes - convenient transport classes for socket-like - update requirements - copyright notice, comments, and assertions Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29msgpack rpc helperFUJITA Tomonori
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>
2013-11-29test_parser: expected json for onf_flow_monitor_requestYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29packet_data: regen for onf_flow_monitor_requestYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29packet_data_generator: add a case for onf_flow_monitor_requestYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29packet_data_generator: update of_protocol for onf_flow_monitor_requestYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29of13: implement ONFFlowMonitorStatsRequestYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29ofproto_parser.StringifyMixin: add "ONF" to the list of class prefixesYAMAMOTO Takashi
for ONF experimenter extensions. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29of13: EXT-187 definitionsYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-29of13 OFPExperimenterStatsRequest: api tweakYAMAMOTO Takashi
change the api to be consist with other OFPxxxStatsRequest classes. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27of13: add a bunch of ONFERR_ constants from OF Extensions for 1.3.XYAMAMOTO Takashi
EXT-230, 231, 232, 236, 237, 260, 264. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27of13 OFPTableFeaturesStatsRequest: remove an unused argumentYAMAMOTO Takashi
and while i'm here, document arguments. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27unit test: test ryu.cmd.managerYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27vrrp: declare event.py to be dependent for manager.pyFUJITA Tomonori
So if you start RyuApp using event.py, manager.py will be started. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27vrrp: add statistics supportFUJITA Tomonori
Supports statistics that Commercial routers provides. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27Add support for admin_state (role)Anantha Ramaiah
Signed-off-by: Anantha Ramaiah <ananth@ntti3.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27fix vrrp utilsFUJITA Tomonori
Maybe better to split api stuff from topology/switches.py but had better move utils.py out of vrrp directory. For now, adopt it for the current code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27register monitor_linux and monitor_openflow for VRRPInterfaceMonitor classFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27vrrp: use sysfs instead of ioctl to get ifindexFUJITA Tomonori
sysfs is architecture independent. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27rest_firewall: support OF 1.3Yuichi Ito
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27ofctl_v1_3: support some actionsYuichi Ito
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-27ofctl_v1_3: correct the output result of get_flow_stats()Yuichi Ito
the previous version of ofctl_v1_3 was inconsistent with ofctl_v1_0 and ofctl_v1_2 in the output result of get_flow_stats(). - ofctl_v1_0/ofctl_v1_2 'match': { 'dl_type': 2048, 'nw_dst': '10.0.2.0/24' } - ofctl_v1_3 'match': { 'OFPMatch': { 'type': 1, 'length': 22, 'oxm_fields': [ { 'OXMTlv': { 'field': 'eth_type', 'mask': None, 'value': 2048 } }, { 'OXMTlv': { 'field': 'ipv4_dst', 'mask': '255.255.255.0', 'value': '10.0.2.0' } } ] } } this patch changes the output of ofctl_v 1_3 like other libraries. Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-25rest_router: support OF 1.3Yuichi Ito
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-25ofp: use RyuApp start() to return Greenlet threadFUJITA Tomonori
starts OFP like other applications. Kill the original way to start OFP (start_service). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2013-11-25allow RyuApp start() method returns Greenlet threadFUJITA Tomonori
This enables an application to continue. Without this, ryu-manager finishes right after running applications. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-25Revert "doc: update tls example"FUJITA Tomonori
This reverts commit 01dcd0c9bca69d1195504621dda5467e1dfc3c26.
2013-11-25run OFP if no application is specifiedFUJITA Tomonori
Keep the old behavior. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-22fix the regression due to e45f382e51c9a3d57a6d8c01cec9e70f7ca364fdFUJITA Tomonori
OFcontroller is not started due to: e45f382e51c9a3d57a6d8c01cec9e70f7ca364fd Author: Isaku Yamahata <yamahata@valinux.co.jp> Date: Fri Nov 22 16:45:59 2013 +0900 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-22a script to set up an environment for test_vrrp_multi.pyYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-22a script to set up an environment for test_vrrp_linux_multi.pyYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-22test apps for VRRP serviceIsaku Yamahata
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>
2013-11-22vrrp serviceIsaku Yamahata
services.protocols.vrrp utils: util functions for vrrp service event: VRRP related events and classes monitor: interface monitor router: VRRP router manager: a class that manages VRRP routers api: API for VRRP service dumper: vrrp event dumper (a sample application) the directory structure (services.protocols.vrrp) was suggested by FUJITA Tomonori. 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>
2013-11-22packet.vrrp: some convenient routinesYAMAMOTO Takashi
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-11-22base/app_manager: context might be RyuAppIsaku Yamahata
The class used for context might be RyuApp. So methods of RyuApp needs to be called. Reported-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp> 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>