auth_gss.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * linux/include/linux/sunrpc/auth_gss.h
  3. *
  4. * Declarations for RPCSEC_GSS
  5. *
  6. * Dug Song <dugsong@monkey.org>
  7. * Andy Adamson <andros@umich.edu>
  8. * Bruce Fields <bfields@umich.edu>
  9. * Copyright (c) 2000 The Regents of the University of Michigan
  10. */
  11. #ifndef _LINUX_SUNRPC_AUTH_GSS_H
  12. #define _LINUX_SUNRPC_AUTH_GSS_H
  13. #ifdef __KERNEL__
  14. #include <linux/sunrpc/auth.h>
  15. #include <linux/sunrpc/svc.h>
  16. #include <linux/sunrpc/gss_api.h>
  17. #define RPC_GSS_VERSION 1
  18. #define MAXSEQ 0x80000000 /* maximum legal sequence number, from rfc 2203 */
  19. enum rpc_gss_proc {
  20. RPC_GSS_PROC_DATA = 0,
  21. RPC_GSS_PROC_INIT = 1,
  22. RPC_GSS_PROC_CONTINUE_INIT = 2,
  23. RPC_GSS_PROC_DESTROY = 3
  24. };
  25. enum rpc_gss_svc {
  26. RPC_GSS_SVC_NONE = 1,
  27. RPC_GSS_SVC_INTEGRITY = 2,
  28. RPC_GSS_SVC_PRIVACY = 3
  29. };
  30. /* on-the-wire gss cred: */
  31. struct rpc_gss_wire_cred {
  32. u32 gc_v; /* version */
  33. u32 gc_proc; /* control procedure */
  34. u32 gc_seq; /* sequence number */
  35. u32 gc_svc; /* service */
  36. struct xdr_netobj gc_ctx; /* context handle */
  37. };
  38. /* on-the-wire gss verifier: */
  39. struct rpc_gss_wire_verf {
  40. u32 gv_flavor;
  41. struct xdr_netobj gv_verf;
  42. };
  43. /* return from gss NULL PROC init sec context */
  44. struct rpc_gss_init_res {
  45. struct xdr_netobj gr_ctx; /* context handle */
  46. u32 gr_major; /* major status */
  47. u32 gr_minor; /* minor status */
  48. u32 gr_win; /* sequence window */
  49. struct xdr_netobj gr_token; /* token */
  50. };
  51. /* The gss_cl_ctx struct holds all the information the rpcsec_gss client
  52. * code needs to know about a single security context. In particular,
  53. * gc_gss_ctx is the context handle that is used to do gss-api calls, while
  54. * gc_wire_ctx is the context handle that is used to identify the context on
  55. * the wire when communicating with a server. */
  56. struct gss_cl_ctx {
  57. atomic_t count;
  58. enum rpc_gss_proc gc_proc;
  59. u32 gc_seq;
  60. spinlock_t gc_seq_lock;
  61. struct gss_ctx *gc_gss_ctx;
  62. struct xdr_netobj gc_wire_ctx;
  63. struct xdr_netobj gc_acceptor;
  64. u32 gc_win;
  65. unsigned long gc_expiry;
  66. struct rcu_head gc_rcu;
  67. };
  68. struct gss_upcall_msg;
  69. struct gss_cred {
  70. struct rpc_cred gc_base;
  71. enum rpc_gss_svc gc_service;
  72. struct gss_cl_ctx __rcu *gc_ctx;
  73. struct gss_upcall_msg *gc_upcall;
  74. const char *gc_principal;
  75. unsigned long gc_upcall_timestamp;
  76. };
  77. #endif /* __KERNEL__ */
  78. #endif /* _LINUX_SUNRPC_AUTH_GSS_H */