Use symbolic names in debugging
This commit is contained in:
		
					parent
					
						
							
								764245a914
							
						
					
				
			
			
				commit
				
					
						e48abdb254
					
				
			
		
					 2 changed files with 8 additions and 33 deletions
				
			
		|  | @ -435,18 +435,7 @@ class L2Controller(object): | ||||||
|         ether_orig = "" |         ether_orig = "" | ||||||
|         orig_packet = "" |         orig_packet = "" | ||||||
| 
 | 
 | ||||||
|         if packet.type == 0x0800: |         if packet.type == 0x4242: | ||||||
|             log.debug("Received raw (untagged) IPv4 packet - BUG") |  | ||||||
|             self.debug_print_pkg(pkg) |  | ||||||
| 
 |  | ||||||
|         elif packet.type == 0x86dd: |  | ||||||
|             log.debug("Received raw (untagged) IPv6 packet - BUG") |  | ||||||
|             self.debug_print_pkg(pkg) |  | ||||||
| 
 |  | ||||||
|             log.debug("cpu = {}".format(cpu_header.__repr__())) |  | ||||||
|             log.debug("v4 reassambled={}".format(orig_packet.__repr__())) |  | ||||||
| 
 |  | ||||||
|         elif packet.type == 0x4242: |  | ||||||
|             cpu_header = CpuHeader(packet.payload) |             cpu_header = CpuHeader(packet.payload) | ||||||
| 
 | 
 | ||||||
|             # Not necessary anymore - cpu decoding works |             # Not necessary anymore - cpu decoding works | ||||||
|  | @ -462,7 +451,7 @@ class L2Controller(object): | ||||||
|                 print("Broken pkg: {}".format(pkg.__repr__())) |                 print("Broken pkg: {}".format(pkg.__repr__())) | ||||||
|                 return |                 return | ||||||
|         else: |         else: | ||||||
|             print("Broken pkg: {}".format(pkg.__repr__())) |             print("Broken / unhandled pkg: {}".format(pkg.__repr__())) | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         # Process parsed |         # Process parsed | ||||||
|  | @ -481,7 +470,7 @@ class L2Controller(object): | ||||||
|             if ICMPv6EchoRequest in orig_packet: |             if ICMPv6EchoRequest in orig_packet: | ||||||
|                 self.handle_icmp6_echo_request(orig_packet) |                 self.handle_icmp6_echo_request(orig_packet) | ||||||
|         else: |         else: | ||||||
|             log.debug("unhandled reassambled={} from table {}".format(orig_packet.__repr__(), cpu_header.table_id)) |             log.debug("unhandled reassambled={} from table {}".format(orig_packet.__repr__(), table_id_fieds[cpu_header.table_id])) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     def run_cpu_port_loop(self): |     def run_cpu_port_loop(self): | ||||||
|  |  | ||||||
|  | @ -77,7 +77,7 @@ control MyIngress(inout headers hdr, | ||||||
| 
 | 
 | ||||||
|     /* NAT46: protocol unspecific changes */ |     /* NAT46: protocol unspecific changes */ | ||||||
| 	action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) { | 	action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) { | ||||||
| 		hdr.ethernet.ethertype=TYPE_IPV6; | 		hdr.ethernet.ethertype = TYPE_IPV6; | ||||||
| 
 | 
 | ||||||
| 		hdr.ipv6.dst_addr = dst; | 		hdr.ipv6.dst_addr = dst; | ||||||
| 		hdr.ipv6.src_addr = src; | 		hdr.ipv6.src_addr = src; | ||||||
|  | @ -334,27 +334,13 @@ control MyIngress(inout headers hdr, | ||||||
| 	/********************** APPLYING TABLES ***********************************/ | 	/********************** APPLYING TABLES ***********************************/ | ||||||
|     apply { |     apply { | ||||||
|         if(hdr.ipv6.isValid()) { |         if(hdr.ipv6.isValid()) { | ||||||
|             icmp6.apply(); /* icmp6 echo, icmp6 ndp */ |             icmp6.apply();       /* icmp6 echo, icmp6 ndp */ | ||||||
|             nat64.apply(); /* translating */ |             nat64.apply();       /* translating */ | ||||||
|             v6_networks.apply(); |             v6_networks.apply(); /* egress / routing */ | ||||||
| 
 |  | ||||||
|             // if(!nat64.apply().hit) { /* v6 -> v4 */ |  | ||||||
|             //     controller_debug_table_id(TABLE_NAT64); |  | ||||||
|             // } |  | ||||||
|             // if(!v6_networks.apply().hit) { |  | ||||||
|             //     controller_debug_table_id(TABLE_V6_NETWORKS); |  | ||||||
|             // } |  | ||||||
|         } |         } | ||||||
|         if(hdr.ipv4.isValid()) { |         if(hdr.ipv4.isValid()) { | ||||||
|             nat46.apply();     /* v4->v6 */ |             nat46.apply();       /* v4->v6 */ | ||||||
|             v4_networks.apply(); /* routing, egress */ |             v4_networks.apply(); /* routing, egress */ | ||||||
| 
 |  | ||||||
|             // if(!nat46.apply().hit) {       /* v4->v6 */ |  | ||||||
|             //     controller_debug_table_id(TABLE_NAT46); |  | ||||||
|             // } |  | ||||||
|             // if(!v4_networks.apply().hit) { /* routing, egress */ |  | ||||||
|             //     controller_debug_table_id(TABLE_V4_NETWORKS); |  | ||||||
|             // } |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue