diff options
author | dfr <dfr@FreeBSD.org> | 2008-08-06 14:02:05 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-08-06 14:02:05 +0000 |
commit | ea3d7030c0c6118b636ea8909a5583b94d819e3a (patch) | |
tree | a928d209076dec713f636439ec8dc5be13863460 /include/rpc/svc.h | |
parent | 627a3ab3ef939e027409fe287f7e3c401c373003 (diff) | |
download | FreeBSD-src-ea3d7030c0c6118b636ea8909a5583b94d819e3a.zip FreeBSD-src-ea3d7030c0c6118b636ea8909a5583b94d819e3a.tar.gz |
Add an implementation of the RPCSEC_GSS authentication protocol for RPC. This
is based on an old implementation from the University of Michigan with lots of
changes and fixes by me and the addition of a Solaris-compatible API.
Sponsored by: Isilon Systems
Reviewed by: alfred
Diffstat (limited to 'include/rpc/svc.h')
-rw-r--r-- | include/rpc/svc.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/rpc/svc.h b/include/rpc/svc.h index 7ecae0c..8466ef8 100644 --- a/include/rpc/svc.h +++ b/include/rpc/svc.h @@ -127,6 +127,27 @@ typedef struct __rpc_svcxprt { } SVCXPRT; /* + * Interface to server-side authentication flavors. + */ +typedef struct __rpc_svcauth { + struct svc_auth_ops { + int (*svc_ah_wrap)(struct __rpc_svcauth *, XDR *, + xdrproc_t, caddr_t); + int (*svc_ah_unwrap)(struct __rpc_svcauth *, XDR *, + xdrproc_t, caddr_t); + } *svc_ah_ops; + void *svc_ah_private; +} SVCAUTH; + +/* + * Server transport extensions (accessed via xp_p3). + */ +typedef struct __rpc_svcxprt_ext { + int xp_flags; /* versquiet */ + SVCAUTH xp_auth; /* interface to auth methods */ +} SVCXPRT_EXT; + +/* * Service request */ struct svc_req { @@ -184,6 +205,20 @@ struct svc_req { #define SVC_CONTROL(xprt, rq, in) \ (*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in)) +#define SVC_EXT(xprt) \ + ((SVCXPRT_EXT *) xprt->xp_p3) + +#define SVC_AUTH(xprt) \ + (SVC_EXT(xprt)->xp_auth) + +/* + * Operations defined on an SVCAUTH handle + */ +#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ + ((auth)->svc_ah_ops->svc_ah_wrap(auth, xdrs, xfunc, xwhere)) +#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ + ((auth)->svc_ah_ops->svc_ah_unwrap(auth, xdrs, xfunc, xwhere)) + /* * Service registration * @@ -298,6 +333,12 @@ extern int svc_fds; #endif /* def FD_SETSIZE */ /* + * A set of null auth methods used by any authentication protocols + * that don't need to inspect or modify the message body. + */ +extern SVCAUTH _svc_auth_null; + +/* * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. */ @@ -306,6 +347,8 @@ extern void rpctest_service(void); __END_DECLS __BEGIN_DECLS +extern SVCXPRT *svc_xprt_alloc(void); +extern void svc_xprt_free(SVCXPRT *); extern void svc_getreq(int); extern void svc_getreqset(fd_set *); extern void svc_getreq_common(int); |