|
Purpose Use this
function when an application program or object is sending a CMIP response.
MIBSendCmipResponse queues responses to CMIP services associated with
requests that were previously received by the application program
from CMIP services.
Declarations The
following declarations indicate the order of the parameters for this
function. typedef int MIBSendCmipResponse_t(
int, /* link identifier - input */
unsigned int, /* invoke identifier - input */
unsigned int, /* last in chain - input */
unsigned int, /* success - input */
unsigned int, /* argument type - input */
const char *, /* argument - input */
const void *, /* local identifier input */
const char *, /* source - input */
const char *, /* association handle - input */
unsigned int *); /* returned invoke identifier -
output */
Parameters - link identifier
- Specifies
the link identifier returned by the MIBConnect function.
- invoke identifier
- This
is the invoke identifier of the request which is being responded to
with this API call.
- last in chain
- This
indicates to CMIP services whether this message is the last response
that is generated by this application program for this request. This
allows CMIP services to construct the correct message (linked reply
or response). A nonzero value indicates that the response is the last
in a chain of responses (RORSapdu or ROERapdu). A zero value indicates
that the response is not the last in a chain of responses (ROIVapdu—linked
reply).
- success
- This
indicates whether the response is positive or negative. This indicates
to CMIP services how to interpret the next parameter. A nonzero value
indicates that the response represents a positive, successful response.
A zero value indicates that the response is negative.
Note: If the
last in chain parameter is zero, the success parameter must be nonzero.
A linked reply cannot be sent as an error.
- argument type
- For
linked-replies (messages with the last in chain parameter set to zero),
this should be two, the CMIP operation value for a linked-reply.
For
RORSapdu messages, this should be the CMIP operation value of the
operation being responded to.
For ROERapdu messages, this should
be the CMIP error value.
The operation values and error values
are given in ACYIDCMS.
- argument
- This
null-terminated string contains the bulk of the CMIP string which
is built by CMIP services, on behalf of the application program, for
this API function.
For ROIVapdu messages (when the last in chain
parameter is zero), this string is used for the value of the argument
parameter.
For RORSapdu messages (when the last in chain parameter
is nonzero and the success parameter is nonzero), this string is used
for the value of the result parameter.
For ROERapdu messages
(when the last in chain parameter is nonzero and the success parameter
is zero), this string is used for the value of the parameter.
- local identifier
- Pointer
to the local identifier of the object that is responding. Specify
the same identifier as the one specified in the request.
- source
- The
distinguished name of the originator of the request. This can be used
to override the source of the message. This is used to resolve any
appearance of the MIB variable distinguished name. Specify
NULL if you do not choose to specify a value.
- association handle
- This
is the association identifier of the association that is to be used
to send the response. It is required and must be the same as the association
handle that was received on the message that is being answered.
- returned invoke identifier
- Specifies
the invoke identifier. The invoke identifier is used to correlate
this request with a response that arrives subsequently. This will
be filled in only for linked replies. For linked replies, the last
in chain parameter is zero.
Return codes - 0
- The function was successful.
- MB_ERR_ALLOC
- An error occurred allocating storage. If MB_ERR_ALLOC is received
by the application program from an API function and there is a corresponding
REQS record in the VIT with a nonzero return code, the LPBUF pool
is not large enough and should be increased.
- MB_ERR_ARGUMENT_MISSING
- The argument parameter was not provided.
- MB_ERR_ARGUMENT_TYPE_MISSING
- An argument type parameter was not provided.
- MB_ERR_ARGUMENT_TYPE_INVALID
- An incorrect argument type parameter was provided.
- MB_ERR_ASSOC_HANDLE_MISSING
- The association handle parameter was not provided.
- MB_ERR_CMIP_SERVICES_INACTIVE
- CMIP services is inactive.
If using common storage area storage,
the read queue exit routine stops functioning.
If using data
space storage, messages are not put on the data space.
- MB_WARN_DATA_SPACE_FULL
- If using a data space and the data space is out of storage, this
warning is returned to remind the application program that no messages
will be returned to this application program. This message will still
be routed to CMIP services.
- MB_ERR_DEST_TYPE_INVALID
- An incorrect destination type parameter was passed.
- MB_WARN_EXIT_FAILURE
- If using common storage area storage and the application program
has indicated that it has had an unrecoverable error when returning
to the read queue exit routine, this warning is returned to remind
the application program that no messages will be returned to the application
program. This message will still be routed to CMIP services.
- MB_ERR_INVALID_LINK_ID
- The value specified on the link identifier parameter does not
refer to a valid connection.
- MB_ERR_INVOKEID_MISSING
- The invoke identifier parameter was not provided.
- MB_ERR_LAST_IN_CHAIN_MISSING
- The last in chain parameter was not provided.
- MB_ERR_LOCAL_ID_MISSING
- A local identifier was not provided.
- MB_ERR_MAX_OUTSTANDING
- The value specified for the maximum outstanding requests parameter
is not valid.
- MB_ERR_SUCCESS_MISSING
- The success argument parameter was not provided.
- MB_ERR_TRANSMIT
- An apparent error occurred. Either there is a logic error in VTAM®, or the MIBDisconnect function
has been issued, but it has not completed.
- MB_ERR_VTAM_INACTIVE
- VTAM is inactive.
Example of function in an application program The
following example shows how the MIBSendCmipResponse function can be
coded in an application program. #include "acyaphdh"
#define FALSE 0
#define TRUE 1
extern void *MyLocalId_ptr;
int rc;
int LinkId;
unsigned int InvokeId;
MIBSendCmipResponse_t *MIBSendCmipResponse;
/*******************************/
/* Send accessDenied ROERapdu. */
/*******************************/
rc = MIBSendCmipResponse(LinkId,
InvokeId, /* the invoke identifier from the request */
TRUE, /* last in chain (not linked reply) */
FALSE, /* not successful (i.e., ROERapdu) */
7,
"(invokeID 1179660, error-value 2)",
MyLocalId_ptr,
NULL,
"a1", /* association handle of the request
being answered */
NULL); /* no new invoke identifier since
last-in-chain is TRUE */
|