You could use defaultdict(list) from collections to store your data. I assume you would want to search based on the source IP so you would keep the source IP as key.
from collections import defaultdict
testDictionary = defaultdict(list)
testDictionary["192.168.0.1"] = ["10.10.10.1", 22, 8080, 0]
if testDictionary[sourceIP]:
testDictionary[sourceIP][-1] += 1
Since you are saying that you only have a table with 100-500 entries, you could search for destination IPs also using
for sourceIP, otherHeader in testDictionary.items():
if otherHeader[0] == destinationIP:
testDictionary[sourceIP][-1] += 1
I do not know whether both the source IP and the destination IP would be unique in all the cases. For that, you can decided what to choose. The advantage of defaultdict(list) is that you can append things also without overwriting the previous values.
for sourceIP, otherHeader in testDictionary.items():
if otherHeader[0] != destinationIP:
testDictionary[sourceIP].append(["10.10.10.2", 22, 8080, 1])
else:
testDictionary[sourceIP][-1] += 1
I am not sure this is exactly what you are looking for but I have tried to understand your data type according to description.
Hope that helps.