I want to make a switch loop (in java) whose cases are the protocol of the ip header of the packets stored in a pcap file.
I am using jnetpcap library to access the packets.
I know how to get ip address, port numbers etc. from the packet but I want to know whether there is a function which tells me directly the protocol of the packet i.e. tcp, udp, icmp etc. One can also suggest if he/she knows any other library which has this kind of function.
Thanks in advance.