I am running simple_switch.py in ryu/app/ folder with slight modification
and the output is given below.(The first occourance of output has been
expanded to make it more readable.) I want to make the contents of sw_list
and link_list more "human readable".Is there some nice display function
that is already implemented that I can use? Or if not how do I implement
it?
The change I have made to simple_switch.py (I have added the four lines
shown in red to packet-in handler to simple switch.
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
sw_list = ryu.topology.api.get_all_switch(self)
print('sw_list {}'.format(sw_list))
link_list = ryu.topology.api.get_all_link(self)
print('link_list {}'.format(link_list))
msg = ev.msg
datapath = msg.datapath
ofproto = datapath.ofproto
sudo ryu-manager --observe-links ryu/app/simple_switch.py
loading app ryu/app/simple_switch.py
loading app ryu.topology.switches
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app ryu.topology.switches of Switches
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app ryu/app/simple_switch.py of SimpleSwitch
sw_list [<ryu.topology.switches.Switch object at 0x1be9510>,
<ryu.topology.switches.Switch object at 0x1be97d0>,
<ryu.topology.switches.Switch object at 0x1be92d0>,
<ryu.topology.switches.Switch object at 0x1be9050>,
<ryu.topology.switches.Switch object at 0x1be9150>,
<ryu.topology.switches.Switch object at 0x1be9590>]
link_list { <ryu.topology.switches.Link object at 0x1be38d0>:
1397547974.976759,
<ryu.topology.switches.Link object at 0x1be3650>:
1397547974.658834,
<ryu.topology.switches.Link object at 0x1be3790>:
1397547975.459913,
<ryu.topology.switches.Link object at 0x1be3fd0>:
1397547974.865703,
<ryu.topology.switches.Link object at 0x1be3810>:
1397547974.91675,
<ryu.topology.switches.Link object at 0x1be37d0>:
1397547975.308176
}
packet in 514 1e:24:a3:bc:08:7e 01:80:c2:00:00:0e 2
sw_list [<ryu.topology.switches.Switch object at 0x1be94d0>,
<ryu.topology.switches.Switch object at 0x1be93d0>,
<ryu.topology.switches.Switch object at 0x1be9350>,
<ryu.topology.switches.Switch object at 0x1be9890>,
<ryu.topology.switches.Switch object at 0x1be9510>,
<ryu.topology.switches.Switch object at 0x1be97d0>]
link_list {<ryu.topology.switches.Link object at 0x1be38d0>:
1397547974.976759, <ryu.topology.switches.Link object at 0x1be3650>:
1397547975.565508, <ryu.topology.switches.Link object at 0x1be3790>:
1397547975.459913, <ryu.topology.switches.Link object at 0x1be3fd0>:
1397547974.865703, <ryu.topology.switches.Link object at 0x1be3810>:
1397547974.91675, <ryu.topology.switches.Link object at 0x1be37d0>:
1397547975.308176}
packet in 516 9e:41:4c:a8:9b:20 01:80:c2:00:00:0e 2
Thanks & Regards,
Karthik.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel