]> err.no Git - linux-2.6/blobdiff - include/linux/sunrpc/svcsock.h
[PATCH] knfsd: SUNRPC: Cache remote peer's address in svc_sock
[linux-2.6] / include / linux / sunrpc / svcsock.h
index 4c296152cbfa71ecdb52efb98e2586454a9b1e30..cccea0a0feb48e83923cc10df72cd1b26133f244 100644 (file)
@@ -54,13 +54,19 @@ struct svc_sock {
        int                     sk_reclen;      /* length of record */
        int                     sk_tcplen;      /* current read length */
        time_t                  sk_lastrecv;    /* time of last received request */
+
+       /* cache of various info for TCP sockets */
+       void                    *sk_info_authunix;
+
+       struct sockaddr_storage sk_remote;      /* remote peer's address */
+       int                     sk_remotelen;   /* length of address */
 };
 
 /*
  * Function prototypes.
  */
-int            svc_makesock(struct svc_serv *, int, unsigned short);
-void           svc_delete_socket(struct svc_sock *);
+int            svc_makesock(struct svc_serv *, int, unsigned short, int flags);
+void           svc_close_socket(struct svc_sock *);
 int            svc_recv(struct svc_rqst *, long);
 int            svc_send(struct svc_rqst *);
 void           svc_drop(struct svc_rqst *);
@@ -71,4 +77,11 @@ int          svc_addsock(struct svc_serv *serv,
                            char *name_return,
                            int *proto);
 
+/*
+ * svc_makesock socket characteristics
+ */
+#define SVC_SOCK_DEFAULTS      (0U)
+#define SVC_SOCK_ANONYMOUS     (1U << 0)       /* don't register with pmap */
+#define SVC_SOCK_TEMPORARY     (1U << 1)       /* flag socket as temporary */
+
 #endif /* SUNRPC_SVCSOCK_H */