Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

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