title: how to get protocol details from packets stored in a pcap file
body: <p>I want to make a switch loop (in java) whose cases are the <strong>protocol of the ip header</strong> of the packets stored in a pcap file.</p>
  
  <p>I am using jnetpcap library to access the packets. </p>
  
  <p>I know how to get ip address, port numbers etc. from the packet but I want to know <strong>whether there is a function</strong> 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.</p>
  
  <p>Thanks in advance.</p>