-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
34 lines (25 loc) · 1.15 KB
/
README
File metadata and controls
34 lines (25 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Use the HHH class with your switch . . .
""" simulates HHH algorithm module for one run
output: list of TCAM rules to monitor (stored in nextTCAMList)
input: Dict of counts for those TCAM rules (process(Dict))
can access: HHH() to initialize, process(), nextTCAMList,
nextMonitorHHHes, HHHReport after each process,
Btw you only need to do
import HHH
h = HHH.HHH() #initialize
result = h.start()
nextTCAMList = result[0] # this is a list
monitoredHHHes = result[1] # also a list
repeat:
#get TCAMCounts using nextTCAMList
# TCAMCounts is a Counter() with all the
# prefixes in TCAMList, set them to 0
# explicitly if that prefix didn't match
# any packets
# You can make a Counter from a dict
# with just c = Counter(dict)
result = h.run(TCAMCounts, monitoredHHHes)
nextTCAMList = result[0]
monitoredHHHes = result[1]
HHHReport = result[2] # this is a dict
"""