|
|
NetIPC 3000/XL Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 NetIPC IntrinsicsCommon Parameters |
|
The flags, opt, data, and result parameters are common to many NetIPC intrinsics. Remote Process Management intrinsics also use these parameters, with the exception of the data parameter. The following discussion of these parameters may help to clarify the more condensed information given under each intrinsic. The flags parameter is a bit representation, 32 bits long, of various options. Normally an option is invoked if the appropriate bit is on (that is, set equal to 1). Borrowing Pascal-type syntax, we shall use flags [0] to refer to the high order bit in the parameter, flags [31] to refer to the low order bit, and a similar designation to refer to each of the bits in between. Bits which are not defined for a given intrinsic must be off (zero). The opt parameter, which denotes various options, contains an integer code for each option along with associated information. It is not necessary to know the internal structure of this parameter in order to use it. Several opt parameter manipulation intrinsics have been provided to enable you to add option information without concerning yourself with the parameter's structure. However, a knowledge of the structure of the opt parameter can help you to determine an appropriate size for the array. The opt parameter must be defined as a byte array or as a record structured in the manner described below. If your program is written in a language which supports dynamically allocated arrays, the OPTOVERHEAD intrinsic may be used to determine the size of the array. The opt parameter consists of these fields as shown in Figure 3-1 “OPT Parameter Structure”.
If the parameter is declared as a simple byte array, it must be large enough to contain 4 bytes for the first two fixed-length fields, 8 bytes for each option entry, plus the actual data. That is:
Figure 3-2 “Option Entry Structure.” shows the structure of an option entry. The data parameter is defined as a byte array. It can be in one of two formats: either holding the actual data or in a vectored format. In the case of vectored data, the data parameter does not contain actual data but rather the addresses from or to which the data will be gathered or distributed. The addresses of the data are represented by data location descriptors. For all intrinsics supporting vectored data, a maximum of two data location descriptors is permitted. For vectored data, the parameter must be a record structured as described below. The format of a compatibility mode data location descriptor is different than a native mode data location descriptor as shown in Figure 3-3 “Data Location Descriptor — Vectored Data”. Combining a compatibility mode vector with a native mode vector in the same NetIPC call is not supported. In compatibility mode, the data location descriptor is eight bytes long and consists of four 2-byte fields. If the vector points to the stack, that is, type = 0, the value you input into the Data Segment Table (DST) is zero (DST = 0). A compatibility mode data location descriptor consists of the following fields:
In native mode, the data location descriptor is 12-bytes long. It contains two 2-byte fields and a 64-bit native mode address. The DST field is unnecessary because DSTs do not exist in native mode. The three fields in the native mode vectored data descriptor are:
Example:
In both compatibility and native mode, the dlen parameter indicates the full length of the data parameter. If the data are vectored, dlen must give the total length of each data location descriptor, not the length of the actual data buffer. For example, the length of a single or double vectored descriptor would be 8 or 16 bytes in compatibility mode; and 12 or 24 bytes for native mode. If a NetIPC (or Remote Process Management) intrinsic call is successful, the result parameter returns a value of zero. Otherwise the value returned represents a NetIPC error code (SOCKERR). NetIPC error messages are listed in Appendix A “IPC Interpreter (IPCINT)”of this manual. You can also obtain the corresponding error message by calling IPCERRMSG.
|
|