what I have to do to catch packets across the LAN? Now grabs only with my host. Code:
I have it set where I can receiving all packets from a specific port. These packets are sent from multiple IP addresses, every 30 seconds (IP a will sent data every 30 seconds, IP b will as well, etc.). From the raw data, I have isolated maybe 20 fields that I want in my table, so each IP address has 20 elements of data. I have a List of Objects for each of these elements. The List grows based on the incoming packets. Example, 1 packet comes in, the List is 21 elements, two packets, the list is now 42, etc.
I want to create a table of some sort that will populate ONLY if the IP address is unique. So, like I said, data is sent every 30 seconds. I only want the first instance of each IP address sending a packet. The rows of the table will be the elements within the List pertaining to that IP address. So, I need to create a dynamic table. Right now, however, I am having trouble only receiving the first instance of a packet from a unique IP address.
Any help is appreciated.
I have a question and i hope to find an answer here
I work on a school project to analyse packets and extract some info (ip source, ip destination, port source, port destination...)
i supposed to get max performance (the fastest way to get this info), I know that when a packet is found (by loop methode) it calculate it's state and return a PcapPacket Object containing references on where the packet is in the native memory and its headers
My question is what is the most efficient way :
1 - in the handler, decode the packet and extract the info and send it
2 - in the handler, make a copy of the packet, send it to another thread which will extract the useful info from it
3 - (if this option is possible) in the handler, make a copy of the packet but without calculating its states, then in a different thread, calculate the states and check headers and extract info
i hope i made myself clear and thank you in advance
byte array=packet.getByteArray(0,packet.size())for extract datas from packet.