Example #1
0
 public void ReplaceRule(INetfilterRule with)
 {
     using (var client = _system.GetTableAdapter(with.IpVersion))
     {
         ReplaceRule(client, with);
     }
 }
Example #2
0
 public bool DebugEquals(INetfilterRule obj, bool debug)
 {
     if (obj is IpTablesRule)
     {
         return(DebugEquals(obj as IpTablesRule, debug));
     }
     return(Equals(obj));
 }
Example #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;
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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));
            }
Example #10
0
 public int GetHashCode(INetfilterRule obj)
 {
     throw new NotImplementedException();
 }
Example #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));
 }
Example #14
0
 public void ReplaceRule(INetfilterRule with)
 {
     throw new NotImplementedException();
 }
Example #15
0
 public void ReplaceRule(INetfilterRule rule)
 {
     ReplaceRule(CastRule(rule));
 }
Example #16
0
 public void AddRule(INetfilterRule rule)
 {
     AddRule(CastRule(rule));
 }
Example #17
0
 public void InsertRule(INetfilterRule rule)
 {
     InsertRule(CastRule(rule));
 }
Example #18
0
 public void ReplaceRule(INetfilterRule with)
 {
     throw new NotImplementedException();
 }
Example #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));
 }
Example #22
0
 public void DeleteRule(INetfilterRule rule)
 {
     DeleteRule(CastRule(rule));
 }
Example #23
0
 public bool DebugEquals(INetfilterRule rule, bool debug)
 {
     throw new NotImplementedException();
 }