Hi, I am trying to parse the packets which arrive at NOX controller for following parameters: 1. Source/Destination IP address 2. Source/Destination Port number
All this information will be obtained from TCP/UDP packet along with IP header. I found in "packet" folder ethernet.py, ipv4.py, tcp.py and udp.py are doing the packet parsing and __str__() function prints the information. I am modifying the pyswitch.py code and in the function "def forward_l2_packet(dpid, inport, packet, buf, bufid):" if i simply write print packet it prints the packet if its TCP or arp etc. How can i extract information from packet in this code? Also, i would like to verify if my understanding is correct: The packet_base.py is the main class for all the packets. The ethernet.py is the first file which is called to parse any packet. Then packet is parsed and sent to Ipv4.py for parsing. IPv4.py then sees if packet is either TCP/UDP/ICMP and calls respective files for further parsing. So if i want the information of src/dst IP and port numbers then i need to parse till TCP/UDP/ICMP stage and fill it in structure and return in a function. I cant figure out how I will save each information spread across different files. -- Regards, Kavitesh Singh.
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org