You need to overlay the Packet object on the correct type of package that I think.
So something like:
TCPPacket p = (TCPPacket)packet;
int destPort = p.dst_port;
int srcPort = p.src_port;
InetAddress destIp = p.dst_ip;
InetAddress srcIp = p.src_ip;
source
share