Module match

Module match 

Expand description

§Match

§Relations of important structs

                  FieldMatch(s)
                      |
                      v
MatchFamily -> PredicateEngine
                      |
                      v
                   Predicate

§Example

use rapimt_core::fm_ipv4_from;
use rapimt_core::prelude::{
    ipv4_to_match,
    Predicate, PredicateEngine, MatchEncoder,
    RuddyPredicateEngine, FieldMatch
};

// Initialize the engine
let engine = RuddyPredicateEngine::init(1000, 100);

// Encode
let matches1 = [fm_ipv4_from!("sip", "192.168.1.0/24"), fm_ipv4_from!("dip", "0.0.0.0/0")];
let (p1, _) = engine.encode_matches(&matches1);
let matches2 = [fm_ipv4_from!("sip", "192.168.50.1/24"), fm_ipv4_from!("dip", "0.0.0.0/0")];
let (p2, _) = engine.encode_matches(&matches2);

// Operate
let p3 = p1 & p2;

Modules§

engine
Engine module
family
Match family module
predicate
raw_match