patch-2.1.32 linux/include/linux/sunrpc/svcsock.h

Next file: linux/include/linux/sunrpc/types.h
Previous file: linux/include/linux/sunrpc/svcauth.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.31/linux/include/linux/sunrpc/svcsock.h linux/include/linux/sunrpc/svcsock.h
@@ -0,0 +1,58 @@
+/*
+ * linux/include/linux/sunrpc/svcsock.h
+ *
+ * RPC server socket I/O.
+ *
+ * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef SUNRPC_SVCSOCK_H
+#define SUNRPC_SVCSOCK_H
+
+#include <linux/sunrpc/svc.h>
+
+/*
+ * RPC server socket.
+ * NOTE: First two items must be prev/next.
+ */
+struct svc_sock {
+	struct svc_sock *	sk_prev;	/* list of ready sockets */
+	struct svc_sock *	sk_next;
+	struct svc_sock *	sk_list;	/* list of all sockets */
+	struct socket *		sk_sock;	/* berkeley socket layer */
+	struct sock *		sk_sk;		/* INET layer */
+
+	struct svc_serv *	sk_server;	/* service for this socket */
+	unsigned char		sk_inuse;	/* use count */
+	unsigned char		sk_busy;	/* enqueued/receiving */
+	unsigned char		sk_conn;	/* conn pending */
+	unsigned char		sk_close;	/* dead or dying */
+	int			sk_data;	/* data pending */
+	unsigned int		sk_temp : 1,	/* temp socket */
+				sk_qued : 1,	/* on serv->sk_sockets */
+				sk_dead : 1;	/* socket closed */
+	int			(*sk_recvfrom)(struct svc_rqst *rqstp);
+	int			(*sk_sendto)(struct svc_rqst *rqstp);
+
+	/* We keep the old state_change and data_ready CB's here */
+	void			(*sk_ostate)(struct sock *);
+	void			(*sk_odata)(struct sock *, int bytes);
+
+	/* private TCP part */
+	unsigned long		sk_reclen;	/* length of record */
+	int			sk_tcplen;	/* current read length */
+
+	/* Debugging */
+	struct svc_rqst *	sk_rqstp;
+};
+
+/*
+ * Function prototypes.
+ */
+int		svc_create_socket(struct svc_serv *, int, struct sockaddr_in *);
+void		svc_delete_socket(struct svc_sock *);
+int		svc_recv(struct svc_serv *, struct svc_rqst *);
+int		svc_send(struct svc_rqst *);
+void		svc_drop(struct svc_rqst *);
+
+#endif /* SUNRPC_SVCSOCK_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov