gtpc1m7c | Transmission Control Protocol/Internet Protocol |
ISO-C only |
---|
The claw_query function is not available in the TARGET(TPF) C library. |
The claw_query function gets information about the status of active CLAW adapters or logical links.
Format
#include <claw.h> int claw_query(unsigned int adapter_id, enum query_level query_lvl, union query_return *buffer_addr);
Following is the buffer returned for query level 1:
Table 10. CLAW Query Level 1 Buffer
Offset | Length | Name | Description |
---|---|---|---|
0 | 4 | CLAW_Q1_ADAPID | Returned adapter ID |
Following is the buffer returned for query level 2:
Table 11. CLAW Query Level 2 Buffer
Offset | Length | Name | Description |
---|---|---|---|
0 | 8 | CLAW_Q2_HOSTNAME | Host system name |
8 | 8 | CLAW_Q2_WSNAME | Workstation system name |
10 | 4 | CLAW_Q2_MSENT | Total messages sent |
14 | 4 | CLAW_Q2_MRECV | Total messages received |
18 | 4 | CLAW_Q2_BSENTHI | Total bytes sent (high-order fullword) |
1C | 4 | CLAW_Q2_BSENTLO | Total bytes sent (low-order fullword) |
20 | 4 | CLAW_Q2_BRECVHI | Total bytes received (high-order fullword) |
24 | 4 | CLAW_Q2_BRECVLO | Total bytes received (low-order fullword) |
28 | 4 | CLAW_Q2_TIME | Time of last STAT |
2C | 4 | CLAW_Q2_PATHS | Number of open paths |
30 | 4 | CLAW_Q2_STATUS | Status bits (not used) |
34 | 4 | CLAW_Q2_READPAGES | Pages allocated for reads |
38 | 4 | CLAW_Q2_WRITEPAGES | Pages allocated for writes |
3C | 4 | CLAW_Q2_READDEV | SDA (Must be an even number) |
40 | 4 | CLAW_Q2_RESERVE | IBM Reserved |
Following is the buffer returned for query level 3:
Table 12. CLAW Query Level 3 Buffer
Offset | Length | Name | Description |
---|---|---|---|
0 | 8 | CLAW_Q3_HOSTAPPL | Host application |
8 | 8 | CLAW_Q3_WSAPPL | Workstation application |
10 | 4 | CLAW_Q3_MSENT | Total messages sent |
14 | 4 | CLAW_Q3_MRECV | Total messages received |
18 | 4 | CLAW_Q3_BSENTHI | Total bytes sent (high-order fullword) |
1C | 4 | CLAW_Q3_BSENTLO | Total bytes sent (low-order fullword) |
20 | 4 | CLAW_Q3_BRECVHI | Total bytes received (high-order fullword) |
24 | 4 | CLAW_Q3_BRECVLO | Total bytes received (low-order fullword) |
28 | 4 | CLAW_Q3_TIME | Time of last STAT |
2C | 4 | CLAW_Q3_PATHID | Path ID |
30 | 1 | CLAW_Q3_STATUS | Status bits |
CLAW_Q3_CLPTSFRE | X'00'-Path is free | ||
CLAW_Q3_CLPTSHO | X'01'-Host connect pending | ||
CLAW_Q3_CLPTSWCO | X'02'-Workstation connect pending | ||
CLAW_Q3_CLTSACT | X'03'-Path is connected pending | ||
31 | 3 | CLAW_Q3_MISC | IBM reserved |
34 | 4 | CLAW_Q3_PENDSENDS | Active send request |
38 | 4 | CLAW_Q3_PENDRECVS | Receive request active |
Normal Return
Return code 0 indicates that the function was successful.
Error Return
Following is a list of return codes that can be returned to the program that calls the claw_query function. See CLAW Return Codes for a complete list of the return codes.
RC_CLAW_INVALID_FUNCTION
RC_CLAW_NOT_INITED
RC_CLAW_ADAPTER_NOT_OPEN
RC_CLAW_BAD_QUERY_TYPE
Programming Considerations
Following are the programming considerations for CLAW query levels 1 and 3. There are no programming considerations for CLAW query level 2.
QTYPE_LEVEL1
QTYPE_LEVEL3
If logical path 1 is not active for the corresponding adapter ID (that is, CLPTSFRE in CLAW_Q3_STATUS is on), no other fields in the structure are valid.
Examples
The following example returns the information about active CLAW adapters.
include <claw.h> unsigned int adapter_id; union query_return buffer; int claw_rc; /* Set up adapter_id with the value returned from the claw_openadapter function */ claw_rc = claw_query(adapter_id,QTYPE_LEVEL2,&buffer); /*normal processing path */
·
·
·
Related Information