Пример #1
0
        public String GetCommand()
        {
            String type    = IpSetTypeHelper.TypeToString(_type);
            String command = String.Format("{0} {1}", _name, type);

            if ((_type & IpSetType.Hash) == IpSetType.Hash)
            {
                command += " family " + _family;
            }
            else if ((_type & IpSetType.Bitmap) == IpSetType.Bitmap)
            {
                command += " range " + _bitmapRange;
            }
            if ((_type & IpSetType.Hash) == IpSetType.Hash)
            {
                command += String.Format(" hashsize {0} maxelem {1}", _hashSize, _maxElem);
            }
            if (_timeout > 0)
            {
                command += " timeout " + _timeout;
            }

            foreach (var co in _createOptions)
            {
                command += " " + co;
            }
            return(command);
        }
Пример #2
0
        public String GetCommand()
        {
            String type    = IpSetTypeHelper.TypeToString(_type);
            String command = String.Format("{0} {1}", _name, type);

            if (_type == IpSetType.HashIp || _type == IpSetType.HashIpPort || _type == IpSetType.HashNet || _type == IpSetType.HashNetPort)
            {
                command += " family " + _family;
            }
            else if (_type == IpSetType.BitmapPort)
            {
                command += " range 1-65535";
            }
            if (_type == IpSetType.HashIp || _type == IpSetType.HashIpPort || _type == IpSetType.HashNet || _type == IpSetType.HashNetPort)
            {
                command += String.Format(" hashsize {0} maxelem {1}", _hashSize, _maxElem);
            }
            return(command);
        }
Пример #3
0
        public String GetCommand()
        {
            String type    = IpSetTypeHelper.TypeToString(_type);
            String command = String.Format("{0} {1}", _name, type);

            if ((_type & IpSetType.Hash) == IpSetType.Hash)
            {
                command += " family " + _family;
            }
            else if ((_type & IpSetType.Bitmap) == IpSetType.Bitmap)
            {
                command += " range 1-65535";
            }
            if ((_type & IpSetType.Hash) == IpSetType.Hash)
            {
                command += String.Format(" hashsize {0} maxelem {1}", _hashSize, _maxElem);
            }
            if (_timeout > 0)
            {
                command += " timeout " + _timeout;
            }
            return(command);
        }