-1

I want to store a list of IP Addresses in Java from pcap file (I am able to get all the packets information from pcap file and list of ipaddresses as well )and than compare these IP Addresses for port scanning detection. I couldn't figure out how to store the IP addresses in a list or in array .

Aj.
  • 25
  • 1
  • 4

1 Answers1

0

Just create a new ArrayList, and add elements to it

List<InetAddress> myList = new ArrayList<InetAddress>();//make a new list
myList.add(blah);//add element
myList.add(blah2);//add element
myList.add(blah3);//add alement
//Store to follow, sounds like you can do that but not the list part so i wont put that here
Alex Coleman
  • 6,611
  • 1
  • 18
  • 30