Hello all,
Could anyone tell me how to get the ipv4 address
I use the next application.
but I have an error !!
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER) def
_packet_in_handler(self, ev): # If you hit this you might want to
increase # the "miss_send_length" of your switch if
ev.msg.msg_len < ev.msg.total_len: self.logger.debug("packet
truncated: only %s of %s bytes", ev.msg.msg_len,
ev.msg.total_len) msg = ev.msg #print "type is", type(msg)
#print "msg is", msg datapath = msg.datapath ofproto =
datapath.ofproto parser = datapath.ofproto_parser in_port =
msg.match['in_port'] pkt = packet.Packet(msg.data)
#self.logger.info("packet-in %s" % (pkt,)) eth =
pkt.get_protocols(ethernet.ethernet)[0] ip = pkt.get_protocol(ipv4.ipv4)
if eth.ethertype == ether_types.ETH_TYPE_LLDP: #
ignore lldp packet return dst = eth.dst src = eth.src
ipv = ip.src
print(ipv)
EVENT ofp_event->switches EventOFPPacketInEVENT ofp_event->SimpleSwitch13
EventOFPPacketInSimpleSwitch13: Exception occurred during handler processing.
Backtrace from offending handler [_packet_in_handler] servicing event
[EventOFPPacketIn] follows.Traceback (most recent call last): File
"/home/mininet/ryu/ryu/base/app_manager.py", line 290, in _event_loop
handler(ev) File "/home/mininet/ryu/ryu/app/C2.py", line 139, in
_packet_in_handler ipv = ip.srcAttributeError: 'NoneType' object has no
attribute 'src'
Thanks
Nadim
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel