2 * Copyright 2006 IBM Corporation
3 * IUCV protocol stack for Linux on zSeries
5 * Author(s): Jennifer Hunt <jenhunt@us.ibm.com>
12 #include <asm/types.h>
13 #include <asm/byteorder.h>
14 #include <linux/list.h>
15 #include <linux/poll.h>
16 #include <linux/socket.h>
20 #define PF_IUCV AF_IUCV
23 /* Connection and socket states */
35 #define IUCV_QUEUELEN_DEFAULT 65535
36 #define IUCV_CONN_TIMEOUT (HZ * 40)
37 #define IUCV_DISCONN_TIMEOUT (HZ * 2)
38 #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
39 #define IUCV_BUFSIZE_DEFAULT 32768
41 /* IUCV socket address */
42 struct sockaddr_iucv {
43 sa_family_t siucv_family;
44 unsigned short siucv_port; /* Reserved */
45 unsigned int siucv_addr; /* Reserved */
46 char siucv_nodeid[8]; /* Reserved */
47 char siucv_user_id[8]; /* Guest User Id */
48 char siucv_name[8]; /* Application Name */
52 /* Common socket structures and functions */
54 struct iucv_path *path;
55 struct iucv_message msg;
56 struct list_head list;
60 #define iucv_sk(__sk) ((struct iucv_sock *) __sk)
68 struct list_head accept_q;
69 spinlock_t accept_q_lock;
71 struct iucv_path *path;
72 struct sk_buff_head send_skb_q;
73 struct sk_buff_head backlog_skb_q;
74 struct sock_msg_q message_q;
75 unsigned int send_tag;
78 struct iucv_sock_list {
79 struct hlist_head head;
81 atomic_t autobind_name;
84 unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
86 void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
87 void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
88 int iucv_sock_wait_state(struct sock *sk, int state, int state2,
90 int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo);
91 void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
92 void iucv_accept_unlink(struct sock *sk);
93 struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock);