//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: static void sendStartServerRequest(HostOutputStream out, byte[] userBytes, byte[] encryptedPassword, int serverID) throws IOException
        internal static void sendStartServerRequest(HostOutputStream @out, sbyte[] userBytes, sbyte[] encryptedPassword, int serverID)
        {
            @out.writeInt(44 + encryptedPassword.Length);
            @out.writeByte(2);                                     // Client attributes, 2 means return job info.
            @out.writeByte(0);                                     // Server attribute.
            @out.writeShort(serverID);                             // Server ID.
            @out.writeInt(0);                                      // CS instance.
            @out.writeInt(0);                                      // Correlation ID.
            @out.writeShort(2);                                    // Template length.
            @out.writeShort(0x7002);                               // ReqRep ID.
            @out.writeByte(encryptedPassword.Length == 8 ? 1 : 3); // Password
            // encryption
            // type.
            @out.writeByte(1);                           // Send reply.
            @out.writeInt(6 + encryptedPassword.Length); // Password LL.
            @out.writeShort(0x1105);                     // Password CP. 0x1115 is other.
            @out.write(encryptedPassword);
            @out.writeInt(16);                           // User ID LL.
            @out.writeShort(0x1104);                     // User ID CP.
            @out.write(userBytes);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static void sendRunCommandRequest(HostOutputStream out, String cmd, int datastreamLevel) throws IOException
        private static void sendRunCommandRequest(HostOutputStream @out, string cmd, int datastreamLevel)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final boolean newerServer = datastreamLevel >= 10;
            bool newerServer = datastreamLevel >= 10;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final byte[] commandBytes = newerServer ? Conv.stringToUnicodeByteArray(cmd) : Conv.stringToEBCDICByteArray37(cmd);
            sbyte[] commandBytes = newerServer ? Conv.stringToUnicodeByteArray(cmd) : Conv.stringToEBCDICByteArray37(cmd);
            @out.writeInt(newerServer ? 31 + commandBytes.Length : 27 + commandBytes.Length); // Length.
            @out.writeShort(0);                                                               // Header ID.
            @out.writeShort(0xE008);                                                          // Server ID.
            @out.writeInt(0);                                                                 // CS instance.
            @out.writeInt(0);                                                                 // Correlation ID.
            @out.writeShort(1);                                                               // Template length.
            @out.writeShort(0x1002);                                                          // ReqRep ID.

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int messageOption = newerServer ? 4 : (datastreamLevel < 7 ? 0 : 2);
            int messageOption = newerServer ? 4 : (datastreamLevel < 7 ? 0 : 2);     // Always return all messages when possible.

            @out.writeByte(messageOption);

            if (newerServer)
            {
                @out.writeInt(10 + commandBytes.Length); // Command LL.
                @out.writeShort(0x1104);                 // Command CP.
                @out.writeInt(1200);                     // Command CCSID.
                @out.write(commandBytes);
            }
            else
            {
                @out.writeInt(6 + commandBytes.Length); // Command LL.
                @out.writeShort(0x1101);                // Command CP.
                @out.write(commandBytes);
            }
        }
Beispiel #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static void sendSignonInfoRequest(HostOutputStream out, SystemInfo info, byte[] userBytes, byte[] encryptedPassword) throws IOException
        private static void sendSignonInfoRequest(HostOutputStream @out, SystemInfo info, sbyte[] userBytes, sbyte[] encryptedPassword)
        {
            int total = 37 + encryptedPassword.Length + 16;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final boolean newerServer = info.getServerLevel() >= 5;
            bool newerServer = info.ServerLevel >= 5;

            if (newerServer)
            {
                total += 7;
            }

            @out.writeInt(total);                                  // Length.
            @out.writeShort(0);                                    // Header ID (almost always zero for all datastreams).
            @out.writeShort(0xE009);                               // Server ID.
            @out.writeInt(0);                                      // CS instance.
            @out.writeInt(0);                                      // Correlation ID.
            @out.writeShort(0x0001);                               // Template length.
            @out.writeShort(0x7004);                               // ReqRep ID.
            @out.writeByte(encryptedPassword.Length == 8 ? 1 : 3); // Password encryption type.
            @out.writeInt(10);                                     // Client CCSID LL.
            @out.writeShort(0x1113);                               // Client CCSID CP.
            @out.writeInt(1200);                                   // Client CCSID (big endian UTF-16).
            @out.writeInt(6 + encryptedPassword.Length);           // Password LL.
            @out.writeShort(0x1105);                               // Password CP. 0x1115 is other.
            @out.write(encryptedPassword);                         // Password.
            @out.writeInt(16);                                     // User ID LL.
            @out.writeShort(0x1104);                               // User ID CP.
            @out.write(userBytes);                                 // User ID.
            if (newerServer)
            {
                @out.writeInt(7);        // Return error messages LL.
                @out.writeShort(0x1128); // Return error messages CP.
                @out.writeByte(1);       // Return error messages.
            }
        }
Beispiel #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void sendDeleteFileRequest(HostOutputStream out, byte[] filenameUnicode) throws IOException
        private void sendDeleteFileRequest(HostOutputStream @out, sbyte[] filenameUnicode)
        {
            @out.writeInt(34 + filenameUnicode.Length); // Length.
            @out.writeShort(0);                         // Header ID.
            @out.writeShort(0xE002);                    // Server ID.
            @out.writeInt(0);                           // CS instance.
            @out.writeInt(newCorrelationID());          // Correlation ID.
            @out.writeShort(8);                         // Template length.
            @out.writeShort(0x000C);                    // ReqRep ID.
            @out.writeShort(0);                         // Chain indicator.
            @out.writeShort(1200);                      // CCSID.
            @out.writeInt(1);                           // Working dir handle.
            @out.writeInt(filenameUnicode.Length + 6);  // Filename LL.
            @out.writeShort(2);                         // Filename CP.
            @out.write(filenameUnicode);
        }
Beispiel #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static void sendExchangeAttributesRequest(HostOutputStream out, String NLV) throws IOException
        private static void sendExchangeAttributesRequest(HostOutputStream @out, string NLV)
        {
            @out.writeInt(34);       // Length.
            @out.writeShort(0);      // Header ID.
            @out.writeShort(0xE008); // Server ID.
            @out.writeInt(0);        // CS instance.
            @out.writeInt(0);        // Correlation ID.
            @out.writeShort(14);     // Template length.
            @out.writeShort(0x1001); // ReqRep ID.
            @out.writeInt(1200);     // CCSID.
            // out.write("2924".getBytes("Cp037")); // NLV.
            sbyte[] NLVbytes = Conv.stringToEBCDICByteArray37(NLV);
            @out.write(NLVbytes);
            @out.writeInt(1);     // Client version.
            @out.writeShort(0);   // Client datastream level.
        }
Beispiel #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static void sendCallProgramRequest(HostOutputStream out, String pgmLibrary, String pgmName, Parameter[] parms, int datastreamLevel) throws IOException
        private static void sendCallProgramRequest(HostOutputStream @out, string pgmLibrary, string pgmName, Parameter[] parms, int datastreamLevel)
        {
            int length = 43;

            for (int i = 0; i < parms.Length; ++i)
            {
                length += 12 + parms[i].InputLength;
            }

            @out.writeInt(length);   // Length;
            @out.writeShort(0);      // Header ID.
            @out.writeShort(0xE008); // Server ID.
            @out.writeInt(0);        // CS instance.
            @out.writeInt(0);        // Correlation ID.
            @out.writeShort(23);     // Template length.
            @out.writeShort(0x1003); // ReqRep ID.

            //    byte[] programBytes = Util.blankPadEBCDIC10(pgmName);
            //    out.write(programBytes, 0, 10);
            writePadEBCDIC10(pgmName, @out);
            //    byte[] libraryBytes = Util.blankPadEBCDIC10(pgmLibrary);
            //    out.write(libraryBytes, 0, 10);
            writePadEBCDIC10(pgmLibrary, @out);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final boolean newerServer = datastreamLevel >= 10;
            bool newerServer = datastreamLevel >= 10;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int messageOption = newerServer ? 4 : (datastreamLevel < 7 ? 0 : 2);
            int messageOption = newerServer ? 4 : (datastreamLevel < 7 ? 0 : 2);     // Always return all messages when possible.

            @out.writeByte(messageOption);

            @out.writeShort(parms.Length);     // Number of parameters.
            for (int i = 0; i < parms.Length; ++i)
            {
                @out.writeInt(12 + parms[i].InputLength); // Parameter LL.
                @out.writeShort(0x1103);                  // Parameter CP.
                @out.writeInt(parms[i].MaxLength);        // Either the input length or output length, whichever is larger.
                switch (parms[i].Type)
                {
                case Parameter.TYPE_NULL:
                    if (datastreamLevel < 6)
                    {
                        // Nulls not allowed.
                        @out.writeShort(1);         // Treat as input.
                    }
                    else
                    {
                        @out.writeShort(255);
                    }
                    break;

                case Parameter.TYPE_INPUT:
                    @out.writeShort(11);
                    @out.write(parms[i].InputData, 0, parms[i].InputLength);
                    break;

                case Parameter.TYPE_OUTPUT:
                    @out.writeShort(12);
                    break;

                case Parameter.TYPE_INPUT_OUTPUT:
                    @out.writeShort(13);
                    @out.write(parms[i].InputData, 0, parms[i].InputLength);
                    break;
                }
            }
        }