auth_gss.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * linux/include/linux/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. * $Id$
  12. */
  13. #ifndef _LINUX_SUNRPC_AUTH_GSS_H
  14. #define _LINUX_SUNRPC_AUTH_GSS_H
  15. #ifdef __KERNEL__
  16. #include <linux/sunrpc/auth.h>
  17. #include <linux/sunrpc/svc.h>
  18. #include <linux/sunrpc/gss_api.h>
  19. #define RPC_GSS_VERSION 1
  20. #define MAXSEQ 0x80000000 /* maximum legal sequence number, from rfc 2203 */
  21. enum rpc_gss_proc {
  22. RPC_GSS_PROC_DATA = 0,
  23. RPC_GSS_PROC_INIT = 1,
  24. RPC_GSS_PROC_CONTINUE_INIT = 2,
  25. RPC_GSS_PROC_DESTROY = 3
  26. };
  27. enum rpc_gss_svc {
  28. RPC_GSS_SVC_NONE = 1,
  29. RPC_GSS_SVC_INTEGRITY = 2,
  30. RPC_GSS_SVC_PRIVACY = 3
  31. };
  32. /* on-the-wire gss cred: */
  33. struct rpc_gss_wire_cred {
  34. u32 gc_v; /* version */
  35. u32 gc_proc; /* control procedure */
  36. u32 gc_seq; /* sequence number */
  37. u32 gc_svc; /* service */
  38. struct xdr_netobj gc_ctx; /* context handle */
  39. };
  40. /* on-the-wire gss verifier: */
  41. struct rpc_gss_wire_verf {
  42. u32 gv_flavor;
  43. struct xdr_netobj gv_verf;
  44. };
  45. /* return from gss NULL PROC init sec context */
  46. struct rpc_gss_init_res {
  47. struct xdr_netobj gr_ctx; /* context handle */
  48. u32 gr_major; /* major status */
  49. u32 gr_minor; /* minor status */
  50. u32 gr_win; /* sequence window */
  51. struct xdr_netobj gr_token; /* token */
  52. };
  53. /* The gss_cl_ctx struct holds all the information the rpcsec_gss client
  54. * code needs to know about a single security context. In particular,
  55. * gc_gss_ctx is the context handle that is used to do gss-api calls, while
  56. * gc_wire_ctx is the context handle that is used to identify the context on
  57. * the wire when communicating with a server. */
  58. struct gss_cl_ctx {
  59. atomic_t count;
  60. enum rpc_gss_proc gc_proc;
  61. u32 gc_seq;
  62. spinlock_t gc_seq_lock;
  63. struct gss_ctx *gc_gss_ctx;
  64. struct xdr_netobj gc_wire_ctx;
  65. u32 gc_win;
  66. unsigned long gc_expiry;
  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 *gc_ctx;
  73. struct gss_upcall_msg *gc_upcall;
  74. };
  75. #define gc_uid gc_base.cr_uid
  76. #define gc_count gc_base.cr_count
  77. #define gc_flags gc_base.cr_flags
  78. #define gc_expire gc_base.cr_expire
  79. void print_hexl(u32 *p, u_int length, u_int offset);
  80. #endif /* __KERNEL__ */
  81. #endif /* _LINUX_SUNRPC_AUTH_GSS_H */