Dears,
I am getting an error when I want to get the *vlan id* of packets.
In fact, I am using the following code I found here
<http://ryu-zhdoc.readthedocs.org/en/latest/library_packet.html>
pkt = packet.Packet(array.array('B', ev.msg.data))
for p in pkt:
print p.protocol_name, p
if p.protocol_name == 'vlan':
print 'vid = ', p.vid
However I get the following error:
switch= Switch<dpid=52235646558, Port<dpid=52235646558, port_no=2, LIVE> >
ethernet
ethernet(dst='01:00:0c:cc:cc:cd',ethertype=50,src='68:bd:ab:80:2b:94')
llc
llc(control=ControlFormatU(modifier_function1=0,modifier_function2=0,pf_bit=0),dsap_addr=170,ssap_addr=170)
hub: uncaught exception: Traceback (most recent call last):
File "/home/ubuntu/ryu/ryu/lib/hub.py", line 52, in _launch
func(*args, **kwargs)
File "/home/ubuntu/ryu/ryu/base/app_manager.py", line 459, in _event_loop
handler(ev)
File "/home/ubuntu/Documents/simpleSwitchv2.py", line 125, in
_packet_in_handler
print p.protocol_name, p
AttributeError: 'array.array' object has no attribute 'protocol_name'
Please advise how to fix this error.
Thanks in advance.
Kind regards
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel