#NEWLINE# def _packetin_to_node( self , msg , header_list ) : #NEWLINE# #INDENT# if ( len ( self . packet_buffer ) >= MAX_SUSPENDPACKETS ) : #NEWLINE# #INDENT# self . logger . info ( 'Packet is dropped, MAX_SUSPENDPACKETS exceeded.' , extra = self . sw_id ) #NEWLINE# return #NEWLINE# #UNINDENT# in_port = self . ofctl . get_packetin_inport ( msg ) #NEWLINE# src_ip = None #NEWLINE# dst_ip = header_list [ IPV4 ] . dst #NEWLINE# srcip = ip_addr_ntoa ( header_list [ IPV4 ] . src ) #NEWLINE# dstip = ip_addr_ntoa ( dst_ip ) #NEWLINE# address = self . address_data . get_data ( ip = dst_ip ) #NEWLINE# if ( address is not None ) : #NEWLINE# #INDENT# log_msg = 'Receive IP packet from [%s] to an internal host [%s].' #NEWLINE# self . logger . info ( log_msg , srcip , dstip , extra = self . sw_id ) #NEWLINE# src_ip = address . default_gw #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# route = self . routing_tbl . get_data ( dst_ip = dst_ip ) #NEWLINE# if ( route is not None ) : #NEWLINE# #INDENT# log_msg = 'Receive IP packet from [%s] to [%s].' #NEWLINE# self . logger . info ( log_msg , srcip , dstip , extra = self . sw_id ) #NEWLINE# gw_address = self . address_data . get_data ( ip = route . gateway_ip ) #NEWLINE# if ( gw_address is not None ) : #NEWLINE# #INDENT# src_ip = gw_address . default_gw #NEWLINE# dst_ip = route . gateway_ip #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( src_ip is not None ) : #NEWLINE# #INDENT# self . packet_buffer . add ( in_port , header_list , msg . data ) #NEWLINE# self . send_arp_request ( src_ip , dst_ip , in_port = in_port ) #NEWLINE# self . logger . info ( 'Send ARP request (flood)' , extra = self . sw_id )