📄 iucv.c
字号:
* contains zero. * If the answer buffer is longer than the reply, this field contains * the number of bytes remaining in the buffer. * If the answer buffer is shorter than the reply, this field contains * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. * Return: b2f0_result - return code from CP * (-EINVAL) - buffer address is NULL */intiucv_reply (__u16 pathid, __u32 msgid, __u32 trgcls, int flags1, void *buffer, ulong buflen, ulong * ipbfadr2, ulong * ipbfln2f){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ipbfadr2 = (__u32) ((ulong) buffer); parm->ipbfln2f = (__u32) buflen; /* length of message */ parm->ippathid = pathid; parm->ipmsgid = msgid; parm->iptrgcls = trgcls; parm->ipflags1 = (__u8) flags1; /* priority message */ b2f0_result = b2f0(REPLY, parm); if ((b2f0_result == 0) || (b2f0_result == 5)) { if (ipbfadr2) *ipbfadr2 = parm->ipbfadr2; if (ipbfln2f) *ipbfln2f = parm->ipbfln2f; } release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_reply_array * Purpose: This function responds to the two-way messages that you * receive. You must identify completely the message to * which you wish to reply. ie, pathid, msgid, and trgcls. * The array identifies a list of addresses and lengths of * discontiguous buffers that contains the reply data. * Input: pathid - path identification number * msgid - specifies the message ID. * trgcls - specifies target class * flags1 - option for path * IPPRTY- specifies if you want to send priority message * buffer - address of array of reply buffers * buflen - total length of reply buffers * Output: ipbfadr2 - Address of buffer which IUCV is currently working on. * ipbfln2f - Contains on the the following values * If the answer buffer is the same length as the reply, this field * contains zero. * If the answer buffer is longer than the reply, this field contains * the number of bytes remaining in the buffer. * If the answer buffer is shorter than the reply, this field contains * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. * Return: b2f0_result - return code from CP * (-EINVAL) - buffer address is NULL*/intiucv_reply_array (__u16 pathid, __u32 msgid, __u32 trgcls, int flags1, iucv_array_t * buffer, ulong buflen, ulong * ipbfadr2, ulong * ipbfln2f){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ipbfadr2 = (__u32) ((ulong) buffer); parm->ipbfln2f = buflen; /* length of message */ parm->ippathid = pathid; parm->ipmsgid = msgid; parm->iptrgcls = trgcls; parm->ipflags1 = (IPANSLST | flags1); b2f0_result = b2f0(REPLY, parm); if ((b2f0_result == 0) || (b2f0_result == 5)) { if (ipbfadr2) *ipbfadr2 = parm->ipbfadr2; if (ipbfln2f) *ipbfln2f = parm->ipbfln2f; } release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_reply_prmmsg * Purpose: This function responds to the two-way messages that you * receive. You must identify completely the message to * which you wish to reply. ie, pathid, msgid, and trgcls. * Prmmsg signifies the data is moved into the * parameter list. * Input: pathid - path identification number * msgid - specifies the message ID. * trgcls - specifies target class * flags1 - option for path * IPPRTY- specifies if you want to send priority message * prmmsg - 8-bytes of data to be placed into the parameter * list. * Output: NA * Return: b2f0_result - return code from CP*/intiucv_reply_prmmsg (__u16 pathid, __u32 msgid, __u32 trgcls, int flags1, __u8 prmmsg[8]){ iparml_dpl *parm; ulong b2f0_result; iucv_debug("entering"); parm = (iparml_dpl *)grab_param(); parm->ippathid = pathid; parm->ipmsgid = msgid; parm->iptrgcls = trgcls; memcpy(parm->iprmmsg, prmmsg, sizeof (parm->iprmmsg)); parm->ipflags1 = (IPRMDATA | flags1); b2f0_result = b2f0(REPLY, parm); release_param(parm); iucv_debug("exiting"); return b2f0_result;}/** * iucv_resume: * @pathid: Path identification number * @user_data: 16-byte of user data * * This function restores communication over a quiesced path. * Returns: return code from CP */intiucv_resume (__u16 pathid, __u8 user_data[16]){ iparml_control *parm; ulong b2f0_result = 0; iucv_debug("entering"); iucv_debug("pathid = %d", pathid); parm = (iparml_control *)grab_param(); memcpy (parm->ipuser, user_data, sizeof (*user_data)); parm->ippathid = pathid; b2f0_result = b2f0(RESUME, parm); release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_send * Purpose: sends messages * Input: pathid - ushort, pathid * msgid - ulong *, id of message returned to caller * trgcls - ulong, target message class * srccls - ulong, source message class * msgtag - ulong, message tag * flags1 - Contains options for this path. * IPPRTY - Ox20 - specifies if you want to send a priority message. * buffer - pointer to buffer * buflen - ulong, length of buffer * Output: b2f0_result - return code from b2f0 call * msgid - returns message id */intiucv_send (__u16 pathid, __u32 * msgid, __u32 trgcls, __u32 srccls, __u32 msgtag, int flags1, void *buffer, ulong buflen){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ipbfadr1 = (__u32) ((ulong) buffer); parm->ippathid = pathid; parm->iptrgcls = trgcls; parm->ipbfln1f = (__u32) buflen; /* length of message */ parm->ipsrccls = srccls; parm->ipmsgtag = msgtag; parm->ipflags1 = (IPNORPY | flags1); /* one way priority message */ b2f0_result = b2f0(SEND, parm); if ((b2f0_result == 0) && (msgid)) *msgid = parm->ipmsgid; release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_send_array * Purpose: This function transmits data to another application. * The contents of buffer is the address of the array of * addresses and lengths of discontiguous buffers that hold * the message text. This is a one-way message and the * receiver will not reply to the message. * Input: pathid - path identification number * trgcls - specifies target class * srccls - specifies the source message class * msgtag - specifies a tag to be associated witht the message * flags1 - option for path * IPPRTY- specifies if you want to send priority message * buffer - address of array of send buffers * buflen - total length of send buffers * Output: msgid - specifies the message ID. * Return: b2f0_result - return code from CP * (-EINVAL) - buffer address is NULL */intiucv_send_array (__u16 pathid, __u32 * msgid, __u32 trgcls, __u32 srccls, __u32 msgtag, int flags1, iucv_array_t * buffer, ulong buflen){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ippathid = pathid; parm->iptrgcls = trgcls; parm->ipbfadr1 = (__u32) ((ulong) buffer); parm->ipbfln1f = (__u32) buflen; /* length of message */ parm->ipsrccls = srccls; parm->ipmsgtag = msgtag; parm->ipflags1 = (IPNORPY | IPBUFLST | flags1); b2f0_result = b2f0(SEND, parm); if ((b2f0_result == 0) && (msgid)) *msgid = parm->ipmsgid; release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_send_prmmsg * Purpose: This function transmits data to another application. * Prmmsg specifies that the 8-bytes of data are to be moved * into the parameter list. This is a one-way message and the * receiver will not reply to the message. * Input: pathid - path identification number * trgcls - specifies target class * srccls - specifies the source message class * msgtag - specifies a tag to be associated with the message * flags1 - option for path * IPPRTY- specifies if you want to send priority message * prmmsg - 8-bytes of data to be placed into parameter list * Output: msgid - specifies the message ID. * Return: b2f0_result - return code from CP*/intiucv_send_prmmsg (__u16 pathid, __u32 * msgid, __u32 trgcls, __u32 srccls, __u32 msgtag, int flags1, __u8 prmmsg[8]){ iparml_dpl *parm; ulong b2f0_result; iucv_debug("entering"); parm = (iparml_dpl *)grab_param(); parm->ippathid = pathid; parm->iptrgcls = trgcls; parm->ipsrccls = srccls; parm->ipmsgtag = msgtag; parm->ipflags1 = (IPRMDATA | IPNORPY | flags1); memcpy(parm->iprmmsg, prmmsg, sizeof(parm->iprmmsg)); b2f0_result = b2f0(SEND, parm); if ((b2f0_result == 0) && (msgid)) *msgid = parm->ipmsgid; release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_send2way * Purpose: This function transmits data to another application. * Data to be transmitted is in a buffer. The receiver * of the send is expected to reply to the message and * a buffer is provided into which IUCV moves the reply * to this message. * Input: pathid - path identification number * trgcls - specifies target class * srccls - specifies the source message class * msgtag - specifies a tag associated with the message * flags1 - option for path * IPPRTY- specifies if you want to send priority message * buffer - address of send buffer * buflen - length of send buffer * ansbuf - address of buffer to reply with * anslen - length of buffer to reply with * Output: msgid - specifies the message ID. * Return: b2f0_result - return code from CP * (-EINVAL) - buffer or ansbuf address is NULL */intiucv_send2way (__u16 pathid, __u32 * msgid, __u32 trgcls, __u32 srccls, __u32 msgtag, int flags1, void *buffer, ulong buflen, void *ansbuf, ulong anslen){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer || !ansbuf) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ippathid = pathid; parm->iptrgcls = trgcls; parm->ipbfadr1 = (__u32) ((ulong) buffer); parm->ipbfln1f = (__u32) buflen; /* length of message */ parm->ipbfadr2 = (__u32) ((ulong) ansbuf); parm->ipbfln2f = (__u32) anslen; parm->ipsrccls = srccls; parm->ipmsgtag = msgtag; parm->ipflags1 = flags1; /* priority message */ b2f0_result = b2f0(SEND, parm); if ((b2f0_result == 0) && (msgid)) *msgid = parm->ipmsgid; release_param(parm); iucv_debug("exiting"); return b2f0_result;}/* * Name: iucv_send2way_array * Purpose: This function transmits data to another application. * The contents of buffer is the address of the array of * addresses and lengths of discontiguous buffers that hold * the message text. The receiver of the send is expected to * reply to the message and a buffer is provided into which * IUCV moves the reply to this message. * Input: pathid - path identification number * trgcls - specifies target class * srccls - specifies the source message class * msgtag - spcifies a tag to be associated with the message * flags1 - option for path * IPPRTY- specifies if you want to send priority message * buffer - address of array of send buffers * buflen - total length of send buffers * ansbuf - address of buffer to reply with * anslen - length of buffer to reply with * Output: msgid - specifies the message ID. * Return: b2f0_result - return code from CP * (-EINVAL) - buffer address is NULL */intiucv_send2way_array (__u16 pathid, __u32 * msgid, __u32 trgcls, __u32 srccls, __u32 msgtag, int flags1, iucv_array_t * buffer, ulong buflen, iucv_array_t * ansbuf, ulong anslen){ iparml_db *parm; ulong b2f0_result; iucv_debug("entering"); if (!buffer || !ansbuf) return -EINVAL; parm = (iparml_db *)grab_param(); parm->ippathid = pathid; parm->iptrgcls = trgcls; parm->ipbfadr1 = (__u32) ((ulong) buffer); parm->ipbfln1f = (__u32) buflen; /* length of message */ parm->ipbfadr2 = (__u32) ((ulong) ansbuf); parm->ipbfln2f = (__u32) anslen; parm->ipsrccls = srccls; parm->ipmsgtag = msgtag; parm->ipflags1 = (IPBUFLST | IPANSLST | flags1); b2f0_result = b2f0(SEND, parm); if ((b2f0_result == 0) && (msgid)) *msgid = parm->ipmsgid; release_param(parm); iucv_debug("exiting"); return b2f0_result;}/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -