public RuleBuilder(IpTablesSystem system, String nfbpf, Dictionary<int, IpTablesRuleSet> ruleSets, FunctionRegistry functions = null) { if (functions == null) { functions = new FunctionRegistry(); } _system = system.System; _nfbpf = nfbpf; var chainsDict = ruleSets.Select((a) => new KeyValuePair<int, IpTablesChainSet>(a.Key, a.Value.Chains)) .ToDictionary((a) => a.Key, (a) => a.Value); _dcr = new DynamicChainRegister(system, chainsDict); _formatDb = new DynamicDictionary<object>(_mappings); _ruleSets = ruleSets; _interpreter = new Interpreter(); _interpreter.SetVariable("var", _mappings); functions.LoadFunctions(_interpreter); }
public Program(IAclProvider aclProvider) { _aclProvider = aclProvider; ISystemFactory system = new LocalFactory(); _system = new IpTablesSystem(system, new IPTablesBinaryAdapter(), new IpSetBinaryAdapter(system)); }
public DynamicChainRegister(IpTablesSystem system, Dictionary<int,IpTablesChainSet> chains) { _system = system; _chains = chains; }
public ModelLoad(IpTablesSystem iptables, Dictionary<int, IpTablesRuleSet> ruleSets, IpSetSets sets) { _iptables = iptables; _ruleSets = ruleSets; _sets = sets; }