Open Virtual Terminal Path (QTVOPNVT) API


  Required Parameter Group:


  Optional Parameter Group: 1


  Optional Parameter Group: 2


  Optional Parameter Group: 3


  Default Public Authority: *USE

  Threadsafe: No

The Open Virtual Terminal Path (QTVOPNVT) API opens a path to a virtual terminal, allowing a server program to interact with an IBM® i application. The virtual terminal path remains open until it is explicitly closed or the job is ended.

When you call the QTVOPNVT API, the operating system selects or automatically configures a virtual terminal for you and indicates that the device is logically turned on. The operating system sends a message to the specified data queue to signal the server program that data is available.


Authorities and Locks

Library Authority
*USE
User Queue Authority
*CHANGE
User Queue Lock
*EXCLRD

Required Parameter Group

Virtual terminal handle
OUTPUT; CHAR(16)

A reference code created by the operating system to identify this open virtual terminal path in later calls to other virtual terminal APIs.

Keyboard language type
INPUT; CHAR(3)

The keyboard language type for the virtual terminal. To use the system value, specify blanks for this parameter. For a list of other valid values, see the Create Device Description (Display) (CRTDEVDSP) command. For details about supported languages, see the i5/OS globalization topic collection.

Character set
INPUT; BINARY(4)

The graphic character set for the virtual terminal. Valid values are a specific graphic character set number and these special values:

For details about the graphic character sets you can specify, see i5/OS globalization.

Note: The graphic character set system value is obtained from the default graphic character set and code page (QCHRID) system value.

Code page
INPUT; BINARY(4)

The code page for the virtual terminal. For details about the code pages you can specify, see i5/OS globalization. If you specified 0 or -1 for the character set parameter, you do not have to specify this parameter. When you use 0 for the character set parameter, the system value is used for this parameter. When you use -1 for the character set parameter, the code page value is derived from the keyboard language type parameter.

Note: The code page system value is obtained from the default graphic character set and code page (QCHRID) system value.

Workstation type
INPUT; BINARY(4)

The type of workstation to use. Valid values are 1 through 15. See Supported Workstation Types and Models for an explanation of the values.

Other workstation types and models are supported. You can specify these by determining their equivalents in Workstation Types and Models.

If a virtual terminal description does not yet exist for the workstation type specified, the operating system attempts to configure the workstation automatically. Automatic configuration is controlled by the Automatic virtual device configuration (QAUTOVRT) system value, which specifies the number of virtual terminals that the operating system can configure automatically. See for more information about the QAUTOVRT value.

Qualified data queue name
INPUT; CHAR(20)

The name and library of the data queue used by your application program to receive data from the operating system asynchronously. The first 10 bytes are for the data queue name; the second 10 bytes are for the library name. Allowable special values are:


Key value
INPUT; CHAR(*)

The key value to use for the data queue.

Length of key value
INPUT; BINARY(4)

The length of the key value. Valid values are 0 through 256. If you specify 0, no key is used for data queue entries.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Optional Parameter Group 1

Open operation information
INPUT; CHAR(10)

Information about the open operation. The characters and their meanings are:


Optional Parameter Group 2

Session initiation information
INPUT; CHAR(*)

Information about the initiation of the virtual terminal session. The information must be in the following format:

Number of variable length records
The total number of all of the variable length records.
Variable length records
The attributes of the session initiation that are to be performed or changed. For the specific format of the variable length record, see Format for Variable Length Record.

Optional Parameter Group 3

Open feedback information
I/O; CHAR(*)

A pointer to information about the device assigned to this virtual terminal session or the reason code when an automatic sign-on request fails. The layout of this information is described in Format for Open Feedback Information.

Length of open feedback information
INPUT; BINARY(4)

The size of the open feedback output area being supplied by the caller. The Open Feedback Information returned will be restricted such that it always returns a total number of bytes equal to or less than this parameter.


Format for Variable Length Record

The following table defines the format for the variable length records.

If the length of the data is longer than the key fields data length, the data will be truncated at the right. No message will be issued.

If the length of the data is smaller than the key field s data length, the data will be padded with blanks at the right. No message will be issued.

It is not an error to specify a key more than once. If duplicate keys are specified, the last specified value for that key is used.


Field Descriptions

Data. The data used to control the session initiation.

Key. An attribute of the session initiation. See Keys for the list of valid keys.

Length of data. The length of the data used to control the initiation.


Keys

The following table shows the valid keys for the key field area of the variable length record.



Field Descriptions

Automatic sign-on. The values needed to have a user automatically signed on once a terminal session has been established. If key 8 is not specified, automatic sign-on will not occur for this virtual terminal session; keys 3, 4, and 5 will be ignored. The automatic sign-on must be used in place of key 1 and 2 whenever the system value QPWDLVL is set to 2 or 3. When the system value QPWDLVL is set to 0 or 1, either keys 1 and 2 or key 8 may be used for automatic sign-on.

Current library. The current library to be used when using automatic sign-on. The special value *USRPRF can be used to indicate that the current library found in the user profile specified with key 1 should be used. If key 5 is not specified, *USRPRF is the default. This value is supported for both key 1 and key 8.

Initial menu. The initial menu to be used when using automatic sign-on. The special value *USRPRF can be used to indicate that the initial menu found in the user profile specified with key 1 should be used. This value is supported for both key 1 and key 8. If key 4 is not specified, *USRPRF is the default.

Initial program. The initial program to be used when using automatic sign-on. The special value *USRPRF can be used to indicate that the initial program found in the user profile specified with key 1 should be used. If key 3 is not specified, *USRPRF is the default. This value is supported for both key 1 and key 8.

IPv4 Network address. An address that is uniquely assigned to each terminal session and is used in all communications with the session. This address is associated with the virtual terminal device by the applicaion and can be accessed by any other application using the Retrieve Device Description (QDCRDEVD) API. The following format defines the layout of the network address:

  1. Size of network address

  2. Family or protocol

  3. Internet Protocol (IP)

IPv6 Network address. An address that is uniquely assigned to each terminal session and is used in all communications with the session. This address is associated with the virtual terminal device by the applicaion and can be accessed by any other application using the Retrieve Device Description (QDCRDEVD) API. The following format defines the layout of the network address:

  1. Size of network address

  2. Family or protocol

  3. Internet Protocol (IP)

Profile Token. A 32-byte Profile Token which may be used as an alternative to using key 8, or keys 1 and 2 for Automatic sign-on purposes. When key 9 is used for Automatic sign-on, keys 3, 4 and 5 will also be honored if specified. Also, if Optional parameter group 3 is specified, the Automatic sign-on response code can be used to determine the result of the Automatic sign-on request when using key 9. Profile tokens may be used for all values of the system value QPWDLVL.

User password. The user password specified for initiating this virtual terminal session in conjunction with the specified profile. If the user profile is *CURRENT, you can use the special value *NONE for the user password. If you specify a user profile other than *CURRENT or blank and do not specify a user password, an error message is returned. This value works in association with key 1 (but not with key 8). This key is supported only when system value QPWDLVL is set to 0 or 1. Note that the Automatic sign-on Reason Code value from Optional Parameter Group 3 is undefined when using keys 1 and 2 for Automatic sign-on.

User profile. The user profile specified for initiating this virtual terminal session. You can use the special value *CURRENT for the user profile. If the user profile is *CURRENT, you can use the special value *NONE for the password. This value is used in association with key 2 (but not with key 8). If key 1 is not specified, automatic sign-on will not occur for this virtual terminal session; keys 2, 3, 4, and 5 will be ignored. This key is supported only when system value QPWDLVL is set to 0 or 1. Note that the Automatitic sign-on Reason Code value from Optional Parameter Group 3 is undefined when using keys 1 and 2 for Automatic sign-on.

Virtual device name. The specific virtual device to be associated with the terminal session.

The device is created by the system, if it does not exist, when the QAUTOVRT system value allows for this.

If no value is supplied by the caller, the virtual terminal API defaults to using the virtual device selection methods.

The device description name must be a valid *VRT and must adhere to standard IBM i naming conventions.


Automatic Sign-on Key

The following table defines the format for the automatic sign-on key.



Field Descriptions

Bypass user profile. The user profile to be automatically signed on. This profile is not interchangeable with the user profile from key 1. If key 8 is used, then the profile must be part of the automatic sign-on information.

Client seed. A randomly-generated seed that was used to encrypt the password or passphrase using the encryption level (either DES-7 or SHA-1) on the system. If a zero-length seed is provided, it is assumed that a clear-text unencrypted password or passphrase is being provided.

Passphrase CCSID. The CCSID of the password or passphrase being provided for automatic sign-on.

Passphrase offset. The offset in this structure of the actual password or passphrase being provided for automatic sign-on.

Passphrase length. The number of bytes in the password or passphrase being provided.

Passphrase. The password or passphrase associated with the user profile to be automatically signed on. This field can range from 1 to 128 bytes. If your system is pre-V5R1, or has system value QPWDLVL set to 0 or 1, then the maximum size of this field is 10 bytes.

Reserved. Reserved for future use.

Server seed. A randomly-generated seed that was used to encrypt the password or passphrase using the encryption level (either DES-7 or SHA-1) on the system. If a zero-length seed is provided, it is assumed that a clear-text unencrypted password or passphrase is being provided.

Sign-on length. The total number of bytes of the automatic sign-on data provided.


Format for Open Feedback Information

The following table defines the format for the open feedback information.



Automatic Sign-on Reason Codes

The following table shows the reason codes that may be returned for automatic sign-on failure. The reason code field is undefined when using keys 1 and 2 for Automatic sign-on.



Field Descriptions

Device Name. The device name that has actually been assigned to this terminal session.

Number of bytes available. The total number of bytes of feedback information available for return. This space is provided by the caller.

Number of bytes returned. The total number of bytes of feedback information actually returned to the caller.

Reason code. Reason an automatic sign-on request has failed. For possible reason code values, see Automatic Sign-on Reason Codes.

Reserved. Reserved for future use.


Supported Workstation Types and Models

The following table details the values you can specify for the QTVOPNVT APIs workstation type parameter.



Usage Notes

  1. All 5250 workstations, except 5555 Model B01, can operate as 5251 Model 11 workstations.

  2. Selecting double-byte character set (DBCS) workstations requires the IBM i primary language to be one of the DBCS national language versions (NLVs).

Error Messages



API introduced: V2R1

[ Back to top | Virtual Terminal APIs | APIs by category ]