Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/ntirpc/rpc/auth_gss.h
$ cat -n /usr/include/ntirpc/rpc/auth_gss.h 1 /* 2 auth_gss.h 3 4 Copyright (c) 2000 The Regents of the University of Michigan. 5 All rights reserved. 6 7 Copyright (c) 2000 Dug Song
. 8 All rights reserved, all wrongs reversed. 9 10 Redistribution and use in source and binary forms, with or without 11 modification, are permitted provided that the following conditions 12 are met: 13 14 1. Redistributions of source code must retain the above copyright 15 notice, this list of conditions and the following disclaimer. 16 2. Redistributions in binary form must reproduce the above copyright 17 notice, this list of conditions and the following disclaimer in the 18 documentation and/or other materials provided with the distribution. 19 3. Neither the name of the University nor the names of its 20 contributors may be used to endorse or promote products derived 21 from this software without specific prior written permission. 22 23 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 24 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 30 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 35 */ 36 37 #ifndef _TIRPC_AUTH_GSS_H 38 #define _TIRPC_AUTH_GSS_H 39 40 #include
41 #include
42 43 /* RPCSEC_GSS control procedures. */ 44 typedef enum { 45 RPCSEC_GSS_DATA = 0, 46 RPCSEC_GSS_INIT = 1, 47 RPCSEC_GSS_CONTINUE_INIT = 2, 48 RPCSEC_GSS_DESTROY = 3 49 } rpc_gss_proc_t; 50 51 /* RPCSEC_GSS services. */ 52 typedef enum { 53 RPCSEC_GSS_SVC_NONE = 1, 54 RPCSEC_GSS_SVC_INTEGRITY = 2, 55 RPCSEC_GSS_SVC_PRIVACY = 3 56 } rpc_gss_svc_t; 57 58 #define RPCSEC_GSS_MAXPROC 3 59 60 #define RPCSEC_GSS_VERSION 1 61 62 /* RPCSEC_GSS security triple. */ 63 struct rpc_gss_sec { 64 gss_OID mech; /* mechanism */ 65 gss_qop_t qop; /* quality of protection */ 66 rpc_gss_svc_t svc; /* service */ 67 gss_cred_id_t cred; /* cred handle */ 68 u_int req_flags; /* req flags for init_sec_context */ 69 }; 70 71 /* Private data required for kernel implementation */ 72 struct authgss_private_data { 73 gss_ctx_id_t pd_ctx; /* Session context handle */ 74 gss_buffer_desc pd_ctx_hndl; /* Credentials context handle */ 75 u_int pd_seq_win; /* Sequence window */ 76 }; 77 78 #define g_OID_equal(o1, o2) \ 79 (((o1)->length == (o2)->length) && \ 80 ((o1)->elements != 0) && ((o2)->elements != 0) && \ 81 (memcmp((o1)->elements, (o2)->elements, (int) (o1)->length) == 0)) 82 83 /* from kerberos source, gssapi_krb5.c */ 84 extern gss_OID_desc krb5oid; 85 extern gss_OID_desc spkm3oid; 86 87 /* Credentials. */ 88 struct rpc_gss_cred { 89 u_int32_t gc_v; /* version */ 90 rpc_gss_proc_t gc_proc; /* control procedure */ 91 u_int32_t gc_seq; /* sequence number */ 92 rpc_gss_svc_t gc_svc; /* service */ 93 gss_buffer_desc gc_ctx; /* context handle */ 94 }; 95 96 /* Context creation response. */ 97 struct rpc_gss_init_res { 98 gss_buffer_desc gr_ctx; /* context handle */ 99 u_int32_t gr_major; /* major status */ 100 u_int32_t gr_minor; /* minor status */ 101 u_int32_t gr_win; /* sequence window */ 102 gss_buffer_desc gr_token; /* token */ 103 }; 104 105 /* Maximum sequence number value. */ 106 #define RPCSEC_GSS_MAXSEQ 0x80000000 107 108 typedef void (*checksum_func_t) (void *priv, void *databuf, size_t length); 109 110 /* Prototypes. */ 111 __BEGIN_DECLS 112 bool xdr_rpc_gss_cred(XDR *xdrs, struct rpc_gss_cred *p); 113 bool xdr_rpc_gss_init_args(XDR *xdrs, gss_buffer_desc *p); 114 bool xdr_rpc_gss_init_res(XDR *xdrs, struct rpc_gss_init_res *p); 115 bool xdr_rpc_gss_wrap(XDR *xdrs, xdrproc_t xdr_func, void *xdr_ptr, 116 gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_svc_t svc, 117 u_int seq); 118 bool xdr_rpc_gss_unwrap(XDR *xdrs, xdrproc_t xdr_func, void *xdr_ptr, 119 gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_svc_t svc, 120 u_int seq, checksum_func_t checksum_func, void *priv); 121 bool xdr_rpc_gss_encode(XDR *xdrs, gss_buffer_t buf, u_int maxsize); 122 bool xdr_rpc_gss_decode(XDR *xdrs, gss_buffer_t buf); 123 124 AUTH *authgss_ncreate(CLIENT *, gss_name_t, struct rpc_gss_sec *); 125 AUTH *authgss_ncreate_default(CLIENT *, char *, struct rpc_gss_sec *); 126 bool authgss_service(AUTH *auth, int svc); 127 bool authgss_get_private_data(AUTH *auth, struct authgss_private_data *); 128 129 void gss_log_status(char *m, OM_uint32 major, OM_uint32 minor); 130 void gss_log_hexdump(const u_char *buf, int len, int offset); 131 __END_DECLS 132 133 #endif /* !_TIRPC_AUTH_GSS_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™