nfs-ganesha 1.4

context.h

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 2004,2008 The Regents of the University of Michigan.
00003   All rights reserved.
00004 
00005   Redistribution and use in source and binary forms, with or without
00006   modification, are permitted provided that the following conditions
00007   are met:
00008 
00009   1. Redistributions of source code must retain the above copyright
00010      notice, this list of conditions and the following disclaimer.
00011   2. Redistributions in binary form must reproduce the above copyright
00012      notice, this list of conditions and the following disclaimer in the
00013      documentation and/or other materials provided with the distribution.
00014   3. Neither the name of the University nor the names of its
00015      contributors may be used to endorse or promote products derived
00016      from this software without specific prior written permission.
00017 
00018   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00019   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00020   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021   DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00022   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
00025   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00026   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00027   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 */
00030 
00031 #ifndef _CONTEXT_H_
00032 #define _CONTEXT_H_
00033 
00034 #include <rpc/rpc.h>
00035 
00036 /* Hopefully big enough to hold any serialized context */
00037 #define MAX_CTX_LEN 4096
00038 
00039 /* New context format flag values */
00040 #define KRB5_CTX_FLAG_INITIATOR         0x00000001
00041 #define KRB5_CTX_FLAG_CFX               0x00000002
00042 #define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY   0x00000004
00043 
00044 int serialize_context_for_kernel(gss_ctx_id_t ctx, gss_buffer_desc *buf,
00045                                  gss_OID mech, int32_t *endtime);
00046 int serialize_spkm3_ctx(gss_ctx_id_t ctx, gss_buffer_desc *buf,
00047                         int32_t *endtime);
00048 int serialize_krb5_ctx(gss_ctx_id_t ctx, gss_buffer_desc *buf,
00049                        int32_t *endtime);
00050 
00051 #endif /* _CONTEXT_H_ */