| 1: procedure wildminnie(R, Ts) #R: set of rules |
| #Ts: rule table of switch s
|
| 2: W := find_common_patterns(R) #Step 1, finding patterns |
| 3: Bs := build_pattern_tree(W) #Step 2, processing patterns |
| 4: copy_to_switch_table(Bs, Ts) #Step 3, Writing prioritized rules to the switch table |
| 5: end procedure |
| 6: function find_common_patterns(R) |
| 7: W : {} #wildcard pattern set |
| 8: Gp := group_rules_by_outport(R) |
| 9: for each Gpi ∈ Gp do |
| 10:
#L(A,p,M): a set of tuples |
| 11: for REPEAT_COUNT do |
| 12: for j := 0 to |L| − 2 do |
| 13: A := L[j].A
(L[j].A ⊛ L[j+1].A) |
| 14: M := L[j].M ∪ L[j+1].M
|
| 15:
|
| 16: end for |
| 17: shuffle_set(L) |
| 18: end for |
| 19:
|
| 20: end for |
| 21: return W
|
| 22: end function |