public void ReplaceRule(INetfilterRule with) { using (var client = _system.GetTableAdapter(with.IpVersion)) { ReplaceRule(client, with); } }
public bool DebugEquals(INetfilterRule obj, bool debug) { if (obj is IpTablesRule) { return(DebugEquals(obj as IpTablesRule, debug)); } return(Equals(obj)); }
void INetfilterChain.AddRule(INetfilterRule rule) { var ruleCast = rule as NfTablesRule; if(ruleCast == null) throw new IpTablesNetException("Rule is of the wrong type"); AddRule(ruleCast); }
private NfTablesRule CastRule(INetfilterRule rule) { NfTablesRule castRule = rule as NfTablesRule; if (castRule == null) throw new IpTablesNetException("Invalid rule type, not nftables"); return castRule; }
public void ReplaceRule(INetfilterRule with) { var withCast = with as IpTablesRule; if (withCast == null) { throw new IpTablesNetException("Comparing different Netfilter rule types, unsupported"); } ReplaceRule(withCast); }
void INetfilterChain.AddRule(INetfilterRule rule) { var ruleCast = rule as NfTablesRule; if (ruleCast == null) { throw new IpTablesNetException("Rule is of the wrong type"); } AddRule(ruleCast); }
private IpTablesRule CastRule(INetfilterRule rule) { IpTablesRule castRule = rule as IpTablesRule; if (castRule == null) { throw new IpTablesNetException("Invalid rule type, not iptables"); } return(castRule); }
public void AddRule(INetfilterRule rule) { var ruleCast = rule as IpTablesRule; if (ruleCast == null) { throw new IpTablesNetException("Invalid rule type for this chain"); } Rules.Add(ruleCast); }
public virtual bool Equals(INetfilterRule x, INetfilterRule y) { if (x.GetType() != y.GetType()) { return(false); } var xI = (IpTablesRule)x; return(Equals(xI, y as IpTablesRule)); }
public int GetHashCode(INetfilterRule obj) { throw new NotImplementedException(); }
public bool DebugEquals(INetfilterRule rule, bool debug) { throw new NotImplementedException(); }
public void DeleteRule(INetfilterRule rule) { DeleteRule(CastRule(rule)); }
public void InsertRule(INetfilterRule rule) { InsertRule(CastRule(rule)); }
public void ReplaceRule(INetfilterRule with) { throw new NotImplementedException(); }
public void ReplaceRule(INetfilterRule rule) { ReplaceRule(CastRule(rule)); }
public void AddRule(INetfilterRule rule) { AddRule(CastRule(rule)); }
public override bool Equals(INetfilterRule x, INetfilterRule y) { return(Equals((IpTablesRule)x, (IpTablesRule)y)); }