J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | #include <jni.h> |
| 27 | #include <stdlib.h> |
| 28 | #include <string.h> |
| 29 | #include "gssapi.h" |
| 30 | |
| 31 | #ifndef _Included_NATIVE_Util |
| 32 | #define _Included_NATIVE_Util |
| 33 | #ifdef __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | extern jint getJavaTime(OM_uint32); |
| 37 | extern OM_uint32 getGSSTime(jint); |
| 38 | extern void checkStatus(JNIEnv *, jobject, OM_uint32, OM_uint32, char*); |
| 39 | extern jint checkTime(OM_uint32); |
| 40 | extern void initGSSBuffer(JNIEnv *, jbyteArray, gss_buffer_t); |
| 41 | extern void resetGSSBuffer(JNIEnv *, jbyteArray, gss_buffer_t); |
| 42 | |
| 43 | extern gss_OID newGSSOID(JNIEnv *, jobject); |
| 44 | extern void deleteGSSOID(gss_OID); |
| 45 | extern gss_OID_set newGSSOIDSet(JNIEnv *, gss_OID); |
| 46 | extern void deleteGSSOIDSet(gss_OID_set); |
| 47 | |
| 48 | extern jbyteArray getJavaBuffer(JNIEnv *, gss_buffer_t); |
| 49 | extern jstring getJavaString(JNIEnv *, gss_buffer_t); |
| 50 | extern jobject getJavaOID(JNIEnv *, gss_OID); |
| 51 | extern jobjectArray getJavaOIDArray(JNIEnv *, gss_OID_set); |
| 52 | |
| 53 | extern jstring getMinorMessage(JNIEnv *, jobject, OM_uint32); |
| 54 | extern void debug(JNIEnv *, char *); |
| 55 | extern int sameMech(JNIEnv *, gss_OID, gss_OID); |
| 56 | |
| 57 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *, void *); |
| 58 | JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *, void *); |
| 59 | |
| 60 | extern char debugBuf[]; |
| 61 | |
| 62 | extern jclass CLS_Object; |
| 63 | extern jclass CLS_GSSNameElement; |
| 64 | extern jclass CLS_GSSCredElement; |
| 65 | extern jclass CLS_NativeGSSContext; |
| 66 | extern jmethodID MID_MessageProp_getPrivacy; |
| 67 | extern jmethodID MID_MessageProp_getQOP; |
| 68 | extern jmethodID MID_MessageProp_setPrivacy; |
| 69 | extern jmethodID MID_MessageProp_setQOP; |
| 70 | extern jmethodID MID_MessageProp_setSupplementaryStates; |
| 71 | extern jmethodID MID_ChannelBinding_getInitiatorAddr; |
| 72 | extern jmethodID MID_ChannelBinding_getAcceptorAddr; |
| 73 | extern jmethodID MID_ChannelBinding_getAppData; |
| 74 | extern jmethodID MID_InetAddress_getAddr; |
| 75 | extern jmethodID MID_GSSNameElement_ctor; |
| 76 | extern jmethodID MID_GSSCredElement_ctor; |
| 77 | extern jmethodID MID_NativeGSSContext_ctor; |
| 78 | extern jfieldID FID_GSSLibStub_pMech; |
| 79 | extern jfieldID FID_NativeGSSContext_pContext; |
| 80 | extern jfieldID FID_NativeGSSContext_srcName; |
| 81 | extern jfieldID FID_NativeGSSContext_targetName; |
| 82 | extern jfieldID FID_NativeGSSContext_isInitiator; |
| 83 | extern jfieldID FID_NativeGSSContext_isEstablished; |
| 84 | extern jfieldID FID_NativeGSSContext_delegatedCred; |
| 85 | extern jfieldID FID_NativeGSSContext_flags; |
| 86 | extern jfieldID FID_NativeGSSContext_lifetime; |
| 87 | extern jfieldID FID_NativeGSSContext_actualMech; |
| 88 | #ifdef __cplusplus |
| 89 | } |
| 90 | #endif |
| 91 | #endif |