Minor refactoring
This commit is contained in:
parent
694de50bc0
commit
8f28ae0e9c
|
@ -68,6 +68,9 @@
|
||||||
(define (firewall-actions acs limit)
|
(define (firewall-actions acs limit)
|
||||||
(filter-map (lambda (ac) (firewall-action ac limit)) (clean-actions acs)))
|
(filter-map (lambda (ac) (firewall-action ac limit)) (clean-actions acs)))
|
||||||
|
|
||||||
|
(define (limit-trie limit trie)
|
||||||
|
(trie-intersect trie limit #:combiner (lambda (v1 v2) (trie-success v1))))
|
||||||
|
|
||||||
(define (firewall-action ac limit)
|
(define (firewall-action ac limit)
|
||||||
(match ac
|
(match ac
|
||||||
[#f #f]
|
[#f #f]
|
||||||
|
@ -75,8 +78,7 @@
|
||||||
(and (trie-lookup limit c #f) ;; todo: handle wildcard as a value
|
(and (trie-lookup limit c #f) ;; todo: handle wildcard as a value
|
||||||
(message c))]
|
(message c))]
|
||||||
[(patch a d)
|
[(patch a d)
|
||||||
(patch (trie-intersect a limit #:combiner (lambda (v1 v2) (trie-success v1)))
|
(patch (limit-trie limit a) (limit-trie limit d))]
|
||||||
(trie-intersect d limit #:combiner (lambda (v1 v2) (trie-success v1))))]
|
|
||||||
[(? spawn? s)
|
[(? spawn? s)
|
||||||
(spawn-firewall limit s)]
|
(spawn-firewall limit s)]
|
||||||
[_
|
[_
|
||||||
|
|
Loading…
Reference in New Issue