Lines Matching defs:iucv
30 #include <net/iucv/iucv.h>
31 #include <net/iucv/af_iucv.h>
52 #define CB_TAG(skb) ((skb)->cb) /* iucv message tag */
54 #define CB_TRGCLS(skb) ((skb)->cb + CB_TAG_LEN) /* iucv msg target class */
149 struct iucv_sock *iucv;
159 iucv = iucv_sk(sk);
160 skb_queue_purge(&iucv->send_skb_q);
161 skb_queue_purge(&iucv->backlog_skb_q);
167 if (iucv->path) {
168 err = iucv_path_sever(iucv->path, NULL);
169 iucv_path_free(iucv->path);
170 iucv->path = NULL;
193 struct iucv_sock *iucv;
202 iucv = iucv_sk(sk);
242 * iucv_msg_length() - Returns the length of an iucv message.
245 * The function returns the length of the specified iucv message @msg of data
259 * Use this function to allocate socket buffers to store iucv message data.
275 * @state: first iucv sk state
276 * @state: second iucv sk state
290 * Always returns true if the socket is not connected (no iucv path for
295 struct iucv_sock *iucv = iucv_sk(sk);
299 return (skb_queue_len(&iucv->send_skb_q) < iucv->path->msglim);
383 struct iucv_sock *iucv = iucv_sk(sk);
402 if (!skb_queue_empty(&iucv->send_skb_q)) {
416 if (iucv->path) {
417 low_nmcpy(user_data, iucv->src_name);
418 high_nmcpy(user_data, iucv->dst_name);
420 err = iucv_path_sever(iucv->path, user_data);
421 iucv_path_free(iucv->path);
422 iucv->path = NULL;
428 skb_queue_purge(&iucv->send_skb_q);
429 skb_queue_purge(&iucv->backlog_skb_q);
598 struct iucv_sock *iucv;
613 iucv = iucv_sk(sk);
618 if (iucv->path) {
624 memcpy(iucv->src_name, sa->siucv_name, 8);
627 memcpy(iucv->src_user_id, iucv_userid, 8);
642 struct iucv_sock *iucv = iucv_sk(sk);
652 memcpy(iucv->src_user_id, query_buffer, 8);
664 memcpy(&iucv->src_name, name, 8);
675 struct iucv_sock *iucv;
704 iucv = iucv_sk(sk);
706 iucv->path = iucv_path_alloc(iucv->msglimit,
708 if (!iucv->path) {
712 err = iucv_path_connect(iucv->path, &af_iucv_handler,
715 iucv_path_free(iucv->path);
716 iucv->path = NULL;
746 iucv_path_sever(iucv->path, NULL);
747 iucv_path_free(iucv->path);
748 iucv->path = NULL;
860 * iucv_send_iprm() - Send socket data in parameter list of an iucv message.
865 * Send the socket data in the parameter list in the iucv message
887 struct iucv_sock *iucv = iucv_sk(sk);
951 /* set iucv message target class */
964 /* allocate one skb for each iucv message:
976 /* wait if outstanding messages for iucv path has reached */
988 /* increment and save iucv message tag for msg_completion cbk */
989 txmsg.tag = iucv->send_tag++;
991 skb_queue_tail(&iucv->send_skb_q, skb);
993 if (((iucv->path->flags & IUCV_IPRMDATA) & iucv->flags)
995 err = iucv_send_iprm(iucv->path, &txmsg, skb);
1000 skb_unlink(skb, &iucv->send_skb_q);
1007 iucv_path_sever(iucv->path, NULL);
1008 skb_unlink(skb, &iucv->send_skb_q);
1013 err = iucv_message_send(iucv->path, &txmsg, 0, 0,
1018 memcpy(user_id, iucv->dst_user_id, 8);
1020 memcpy(appl_id, iucv->dst_name, 8);
1027 skb_unlink(skb, &iucv->send_skb_q);
1109 /* we need to fragment iucv messages for SOCK_STREAM only;
1139 struct iucv_sock *iucv = iucv_sk(sk);
1143 list_for_each_entry_safe(p, n, &iucv->message_q.list, list) {
1150 if (!skb_queue_empty(&iucv->backlog_skb_q))
1160 struct iucv_sock *iucv = iucv_sk(sk);
1166 skb_queue_empty(&iucv->backlog_skb_q) &&
1168 list_empty(&iucv->message_q.list))
1197 /* each iucv message contains a complete record */
1201 /* create control message to store iucv msg target class:
1203 * fragmentation of original iucv message. */
1227 spin_lock_bh(&iucv->message_q.lock);
1228 rskb = skb_dequeue(&iucv->backlog_skb_q);
1231 skb_queue_head(&iucv->backlog_skb_q,
1235 rskb = skb_dequeue(&iucv->backlog_skb_q);
1238 if (skb_queue_empty(&iucv->backlog_skb_q)) {
1239 if (!list_empty(&iucv->message_q.list))
1242 spin_unlock_bh(&iucv->message_q.lock);
1309 struct iucv_sock *iucv = iucv_sk(sk);
1335 err = iucv_message_send(iucv->path, &txmsg, IUCV_IPRMDATA, 0,
1395 struct iucv_sock *iucv = iucv_sk(sk);
1414 iucv->flags |= IUCV_IPRMDATA;
1416 iucv->flags &= ~IUCV_IPRMDATA;
1425 iucv->msglimit = val;
1445 struct iucv_sock *iucv = iucv_sk(sk);
1461 val = (iucv->flags & IUCV_IPRMDATA) ? 1 : 0;
1465 val = (iucv->path != NULL) ? iucv->path->msglim /* connected */
1466 : iucv->msglimit; /* default */
1482 /* Callback wrappers - called from iucv base support */
1491 struct iucv_sock *iucv, *niucv;
1498 iucv = NULL;
1507 iucv = iucv_sk(sk);
1511 if (!iucv)
1518 low_nmcpy(user_data, iucv->src_name);
1519 high_nmcpy(user_data, iucv->dst_name);
1549 memcpy(niucv->src_name, iucv->src_name, 8);
1550 memcpy(niucv->src_user_id, iucv->src_user_id, 8);
1559 niucv->msglimit = iucv->msglimit;
1560 path->msglim = iucv->msglimit;
1591 struct iucv_sock *iucv = iucv_sk(sk);
1601 spin_lock(&iucv->message_q.lock);
1603 if (!list_empty(&iucv->message_q.list) ||
1604 !skb_queue_empty(&iucv->backlog_skb_q))
1626 list_add_tail(&save_msg->list, &iucv->message_q.list);
1629 spin_unlock(&iucv->message_q.lock);