Exemplo n.º 1
0
 public void ReplaceRule(INetfilterRule with)
 {
     using (var client = _system.GetTableAdapter(with.IpVersion))
     {
         ReplaceRule(client, with);
     }
 }
Exemplo n.º 2
0
 public bool DebugEquals(INetfilterRule obj, bool debug)
 {
     if (obj is IpTablesRule)
     {
         return(DebugEquals(obj as IpTablesRule, debug));
     }
     return(Equals(obj));
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 5
0
        public void ReplaceRule(INetfilterRule with)
        {
            var withCast = with as IpTablesRule;

            if (withCast == null)
            {
                throw new IpTablesNetException("Comparing different Netfilter rule types, unsupported");
            }
            ReplaceRule(withCast);
        }
Exemplo n.º 6
0
        void INetfilterChain.AddRule(INetfilterRule rule)
        {
            var ruleCast = rule as NfTablesRule;

            if (ruleCast == null)
            {
                throw new IpTablesNetException("Rule is of the wrong type");
            }

            AddRule(ruleCast);
        }
Exemplo n.º 7
0
        private IpTablesRule CastRule(INetfilterRule rule)
        {
            IpTablesRule castRule = rule as IpTablesRule;

            if (castRule == null)
            {
                throw new IpTablesNetException("Invalid rule type, not iptables");
            }

            return(castRule);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
            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));
            }
Exemplo n.º 10
0
 public int GetHashCode(INetfilterRule obj)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 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));
 }
Exemplo n.º 14
0
 public void ReplaceRule(INetfilterRule with)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
 public void ReplaceRule(INetfilterRule rule)
 {
     ReplaceRule(CastRule(rule));
 }
Exemplo n.º 16
0
 public void AddRule(INetfilterRule rule)
 {
     AddRule(CastRule(rule));
 }
Exemplo n.º 17
0
 public void InsertRule(INetfilterRule rule)
 {
     InsertRule(CastRule(rule));
 }
Exemplo n.º 18
0
 public void ReplaceRule(INetfilterRule with)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 19
0
 public override bool Equals(INetfilterRule x, INetfilterRule y)
 {
     return(Equals((IpTablesRule)x, (IpTablesRule)y));
 }
 public void AddRule(INetfilterRule rule)
 {
     AddRule(CastRule(rule));
 }
 public void ReplaceRule(INetfilterRule rule)
 {
     ReplaceRule(CastRule(rule));
 }
Exemplo n.º 22
0
 public void DeleteRule(INetfilterRule rule)
 {
     DeleteRule(CastRule(rule));
 }
Exemplo n.º 23
0
 public bool DebugEquals(INetfilterRule rule, bool debug)
 {
     throw new NotImplementedException();
 }