示例#1
0
        public int Feed(CommandParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionSourcePortLong:
            case OptionSourcePortShort:
                SourcePort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationPortLong:
            case OptionDestinationPortShort:
                DestinationPort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationTcpFlags:
                TcpFlags = new ValueOrNot <TcpFlagMatch>(TcpFlagMatch.Parse(parser.GetNextArg(), parser.GetNextArg(2)), not);
                return(2);

            case OptionSyn:
                TcpFlags = new ValueOrNot <TcpFlagMatch>(TcpFlagMatch.Syn, not);
                return(0);

            case OptionTcpOption:
                TcpOption.Set(not, int.Parse(parser.GetNextArg()));
                return(1);
            }

            return(0);
        }
示例#2
0
        int IIpTablesModuleInternal.Feed(RuleParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionSourcePortLong:
            case OptionSourcePortShort:
                SourcePort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationPortLong:
            case OptionDestinationPortShort:
                DestinationPort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationTcpFlags:
                TcpFlags = TcpFlagMatch.Parse(parser.GetNextArg(), parser.GetNextArg(2));
                return(2);

            case OptionSyn:
                TcpFlags = not ? TcpFlagMatch.NotSyn : TcpFlagMatch.Syn;
                return(0);

            case OptionTcpOption:
                TcpOption.Set(not, int.Parse(parser.GetNextArg()));
                return(1);
            }

            return(0);
        }
示例#3
0
        public int Feed(CommandParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionMarkLong:
                var s = parser.GetNextArg().Split(new char[] { '/' });
                Mark.Set(not, FlexibleInt32.Parse(s[0]));
                if (s.Length != 1)
                {
                    Mask = FlexibleInt32.Parse(s[1]);
                }
                return(1);
            }

            return(0);
        }
        int IIpTablesModuleInternal.Feed(RuleParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionMarkLong:
                var s = parser.GetNextArg().Split(new char[] { '/' });
                Mark.Set(not, FlexibleInt.Parse(s[0]));
                if (s.Length != 1)
                {
                    Mask = FlexibleInt.Parse(s[1]);
                }
                return(1);
            }

            return(0);
        }
示例#5
0
        int IIpTablesModuleInternal.Feed(RuleParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionSourcePortLong:
            case OptionSourcePortShort:
                SourcePort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationPortLong:
            case OptionDestinationPortShort:
                DestinationPort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);
            }

            return(0);
        }
示例#6
0
        public int Feed(CommandParser parser, bool not)
        {
            switch (parser.GetCurrentArg())
            {
            case OptionSourcePortLong:
            case OptionSourcePortShort:
                SourcePort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);

            case OptionDestinationPortLong:
            case OptionDestinationPortShort:
                DestinationPort.Set(not, PortOrRange.Parse(parser.GetNextArg(), ':'));
                return(1);
            }

            return(0);
        }