def ip_for_event(event):
 eth = dpid_to_str(event.dpid, True).split('|')[0].replace('-', ':')
 return EthAddr(eth)

def ip_for_event ( event ) : eth = dpid_to_str ( event . dpid , True ) . split ( '|' ) [ 0 ] . replace ( '-' , ':' ) return EthAddr ( eth )
use a switchs dpid as an ethaddr .