| Algorithm 2. Detection and matching |
|
INPUT: = {
, ,…,
} policy table: F = { , ,…, } OUTPUT: Event_Match 1. for each in do 2. for each in F 3. if .ip == .ip do 4. if L() in .key and L() not in .keylist do 5. .keylist.append(L()) 6. .lastpkt_time = T() 7. endif 8. if L() in .high and L() not in .highlist do 9. .highlist.append(L()) 10. lastpkt = T() 11. endif 12. endif 13. endfor 14. for each in F 15. if L(.keylist) >= L(.key)–fix and L(.highlist) >= L(.key)–high fix do 16. Event_Match [.name].append(.lastpkt_time) 17. clearall F.keylist, F.highlist, F.lastpkt_time 18. break 19. endif 20. endfor 21. for each in F 22. if T()–.lastpkt_time < .max_time 23. clear 24. clear .keylist, .highlist, .lastpkt_time 25. endif 26. endfor |