Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / sunrpc / svcauth.h
index 5c16a75..2fe2087 100644 (file)
@@ -26,26 +26,29 @@ struct svc_cred {
 struct svc_rqst;               /* forward decl */
 
 /* Authentication is done in the context of a domain.
- * For a server, a domain represents a group of clients using
+ *
+ * Currently, the nfs server uses the auth_domain to stand
+ * for the "client" listed in /etc/exports.
+ *
+ * More generally, a domain might represent a group of clients using
  * a common mechanism for authentication and having a common mapping
  * between local identity (uid) and network identity.  All clients
  * in a domain have similar general access rights.  Each domain can
  * contain multiple principals which will have different specific right
  * based on normal Discretionary Access Control.
  *
- * For a client, a domain represents a number of servers which all
- * use a common authentication mechanism and network identity name space.
- *
  * A domain is created by an authentication flavour module based on name
  * only.  Userspace then fills in detail on demand.
  *
- * The creation of a domain typically implies creation of one or
- * more caches for storing domain specific information.
+ * In the case of auth_unix and auth_null, the auth_domain is also
+ * associated with entries in another cache representing the mapping
+ * of ip addresses to the given client.
  */
 struct auth_domain {
-       struct  cache_head      h;
+       struct kref             ref;
+       struct hlist_node       hash;
        char                    *name;
-       int                     flavour;
+       struct auth_ops         *flavour;
 };
 
 /*
@@ -84,6 +87,9 @@ struct auth_domain {
  *
  * domain_release()
  *   This call releases a domain.
+ * set_client()
+ *   Givens a pending request (struct svc_rqst), finds and assigns
+ *   an appropriate 'auth_domain' as the client.
  */
 struct auth_ops {
        char *  name;
@@ -92,6 +98,7 @@ struct auth_ops {
        int     (*accept)(struct svc_rqst *rq, u32 *authp);
        int     (*release)(struct svc_rqst *rq);
        void    (*domain_release)(struct auth_domain *);
+       int     (*set_client)(struct svc_rqst *rq);
 };
 
 #define        SVC_GARBAGE     1
@@ -107,13 +114,14 @@ struct auth_ops {
 
 extern int     svc_authenticate(struct svc_rqst *rqstp, u32 *authp);
 extern int     svc_authorise(struct svc_rqst *rqstp);
+extern int     svc_set_client(struct svc_rqst *rqstp);
 extern int     svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops);
 extern void    svc_auth_unregister(rpc_authflavor_t flavor);
 
 extern struct auth_domain *unix_domain_find(char *name);
 extern void auth_domain_put(struct auth_domain *item);
 extern int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom);
-extern struct auth_domain *auth_domain_lookup(struct auth_domain *item, int set);
+extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new);
 extern struct auth_domain *auth_domain_find(char *name);
 extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
 extern int auth_unix_forget_old(struct auth_domain *dom);
@@ -156,8 +164,6 @@ static inline unsigned long hash_mem(char *buf, int length, int bits)
        return hash >> (BITS_PER_LONG - bits);
 }
 
-extern struct cache_detail auth_domain_cache, ip_map_cache;
-
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_SUNRPC_SVCAUTH_H_ */