Exemplo n.º 1
0
        public void Accept(String line, IpTablesSystem iptables)
        {
            String[] split = ArgumentHelper.SplitArguments(line);

            if (split.Length == 0)
            {
                return;
            }

            var command = split[0];

            switch (command)
            {
            case "create":
                var set = IpSetSet.Parse(split, iptables, 1);
                AddSet(set);
                break;

            case "add":
                IpSetEntry.Parse(split, this, 1);
                break;
            }
        }
Exemplo n.º 2
0
        public void Accept(String line, IpTablesSystem iptables)
        {
            String[] split = line.Split(new char[] { ' ' });

            if (split.Length == 0)
            {
                return;
            }

            var command = split[0];
            var options = String.Join(" ", split.Skip(1).ToArray());

            switch (command)
            {
            case "create":
                var set = IpSetSet.Parse(options, iptables);
                AddSet(set);
                break;

            case "add":
                IpSetEntry.Parse(options, this);
                break;
            }
        }