def AaNetRule.matches
import bend-osdev-apparmor@0.1.0.0/rule_network.bend as RuleNetworkimport Base
155def AaNetRule.matches(r: AaNetRule, q: AaNetQuery) -> Bool:
156 match r:
157 case AaNetRule{qu, d, ty, pr}:
158 match q:
159 case AaNetQuery{qd, qt, qp}:
160 Bool.and(AaNet.opt_eq(d, qd), Bool.and(AaNet.opt_eq(ty, qt), AaNet.opt_eq(pr, qp)))