Package org.jscsi.target.settings.entry

Examples of org.jscsi.target.settings.entry.StringEntry


            // the target must reply with TargetPortalGroupTag and should
            // append TargetAlias
            boolean normalSession = TextKeyword.NORMAL.equals(((StringEntry) getEntry(TextKeyword.SESSION_TYPE)).getStringValue());
            if (normalSession) {
                // check if proposed TargetName is correct
                final StringEntry targetNameEntry = (StringEntry) getEntry(TextKeyword.TARGET_NAME);
                final String targetName = targetNameEntry.getStringValue();
                if (targetName == null || // not declared
                !target.isValidTargetName(targetName)) // wrong name
                everythingOkay = false;

                // send TargetAlias
View Full Code Here


    protected void initializeEntries () {

        /*
         * Determines type and use of the data digest.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.DATA_DIGEST),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        new String[] { TextKeyword.NONE },// supportedValues,
        TextKeyword.NONE));// defaultValue

        /*
         * Determines type and use of the header digest.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.HEADER_DIGEST),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        new String[] { TextKeyword.NONE },// supportedValues,
        TextKeyword.NONE));// defaultValue

        /*
         * Turns the target-to-initiator markers on or off.
         */
        entries.add(new BooleanEntry(new KeySet(TextKeyword.IF_MARKER),// keySet
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        false,// negotiationValue
        BooleanResultFunction.AND,// resultFunction
        false));// defaultValue

        /*
         * Interval value (in 4-byte words) for target-to-initiator markers. The interval is measured from the end of
         * one marker to the beginning of the next one. The offer can have only a range; the response can have only a
         * single value (picked from the offered range) or Reject. Will always be Irrelevant.
         */
        entries.add(new NumericalRangeEntry(new KeySet(TextKeyword.IF_MARK_INT),// keySet
        Use.LOPNS,// use
        NegotiationStatus.IRRELEVANT,// negotiationStatus
        2048,// negotiationValue
        NumericalValueRange.create(1, 65535),// protocolValueRange
        2048));// defaultValue

        /*
         * The maximum amount of data that either the initiator or the target can receive in any iSCSI PDU. Zero (don't
         * care) can be used. I&T can specify (declare) the Max they can receive. This is a connection- and direction-
         * specific parameter. The actual value used by the target will be min(This value, MaxBurstLength) for data-in
         * and solicited data-out data. Min(This value, FirstBurstLength) for unsolicited data.
         */
        entries.add(new NumericalEntry(new KeySet(TextKeyword.MAX_RECV_DATA_SEGMENT_LENGTH),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.LOPNS_AND_FFP,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        8192,// negotiationValue (default value, will be used if I sends
             // 0)
        NumericalValueRange.create(512, 16777215),// protocolValueRange
        // 512 to 2^24 - 1
        NumericalResultFunction.MIN,// resultFunction
        8192,// defaultValue, 8K
        true));// zeroMeansDontCare

        /*
         * Turns the initiator-to-target markers on or off.
         */
        entries.add(new BooleanEntry(new KeySet(TextKeyword.OF_MARKER),// keySet
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        false,// negotiationValue
        BooleanResultFunction.AND,// resultFunction
        false));// defaultValue

        /*
         * Interval value (in 4-byte words) for initiator-to-target markers. The interval is measured from the end of
         * one marker to the beginning of the next one. The offer can have only a range; the response can have only a
         * single value (picked from the offered range) or Reject. Will always be Irrelevant.
         */
        entries.add(new NumericalRangeEntry(new KeySet(TextKeyword.OF_MARK_INT),// keySet
        Use.LOPNS,// use
        NegotiationStatus.IRRELEVANT,// negotiationStatus
        2048,// negotiationValue
        NumericalValueRange.create(1, 65535),// protocolValueRange
        2048));// defaultValue

        /*
         * This entry is not used for Settings initialization, TargetName has a session-wide scope. This entry
         * intercepts the TargetName parameter the initiator has to declare at the beginning of normal sessions.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.TARGET_NAME),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.INITIAL,// use
        NegotiationStatus.NOT_NEGOTIATED,// negotiationStatus
        null,// supportedValues, anything goes
        null));// defaultValue
View Full Code Here

        true));// defaultValue

        /*
         * Sent to the target in the login PDU.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.INITIATOR_ALIAS),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.INITIAL_AND_FFP,// use
        NegotiationStatus.NOT_NEGOTIATED,// negotiationStatus
        null,// supportedValues, anything goes
        null));// defaultValue

        /*
         * Must be sent on first login request per connection.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.INITIATOR_NAME),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.INITIAL,// use
        NegotiationStatus.NOT_NEGOTIATED,// negotiationStatus
        null,// supportedValues, anything goes
        null));// defaultValue

        /*
         * Maximum SCSI data payload in bytes for data-in or for a solicited data-out sequence. Zero (don't care) can be
         * used.
         */
        entries.add(new NumericalEntry(new KeySet(TextKeyword.MAX_BURST_LENGTH),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LEADING_LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        262144,// negotiationValue (default value)
        NumericalValueRange.create(512, 16777215),// protocolValueRange
        // 512 to 2^24 - 1
        NumericalResultFunction.MIN,// resultFunction
        262144,// defaultValue, 256K
        true));// zeroMeansDontCare

        /*
         * The initiator and target negotiate the maximum number of connections that can be requested or are acceptable.
         */
        entries.add(new NumericalEntry(new KeySet(TextKeyword.MAX_CONNECTIONS),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LEADING_LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        1,// negotiationValue (default value)
        NumericalValueRange.create(1, 65535),// protocolValueRange
        NumericalResultFunction.MIN,// resultFunction
        1,// defaultValue
        false));// zeroMeansDontCare

        /*
         * The maximum number of outstanding R2Ts.
         */
        entries.add(new NumericalEntry(new KeySet(TextKeyword.MAX_OUTSTANDING_R_2_T),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LEADING_LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        1,// negotiationValue (default value)
        NumericalValueRange.create(1, 65535),// protocolValueRange
        NumericalResultFunction.MIN,// resultFunction
        1,// defaultValue
        false));// zeroMeansDontCare

        /*
         * The session type (Normal or Discovery).
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.SESSION_TYPE),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.INITIAL,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        null,// supportedValues, no checking
        TextKeyword.NORMAL));// defaultValue
View Full Code Here

TOP

Related Classes of org.jscsi.target.settings.entry.StringEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.