Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/security/jgss/wrapper/NativeUtil.h
38918 views
/*1* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include <jni.h>26#include <stdlib.h>27#include <string.h>28#include "gssapi.h"2930#ifndef _Included_NATIVE_Util31#define _Included_NATIVE_Util32#ifdef __cplusplus33extern "C" {34#endif35extern jint getJavaTime(OM_uint32);36extern OM_uint32 getGSSTime(jint);37extern void checkStatus(JNIEnv *, jobject, OM_uint32, OM_uint32, char*);38extern jint checkTime(OM_uint32);39extern void throwOutOfMemoryError(JNIEnv *, const char*);40extern void initGSSBuffer(JNIEnv *, jbyteArray, gss_buffer_t);41extern void resetGSSBuffer(gss_buffer_t);4243extern gss_OID newGSSOID(JNIEnv *, jobject);44extern void deleteGSSOID(gss_OID);45extern gss_OID_set newGSSOIDSet(gss_OID);46extern void deleteGSSOIDSet(gss_OID_set);4748extern jbyteArray getJavaBuffer(JNIEnv *, gss_buffer_t);49extern jstring getJavaString(JNIEnv *, gss_buffer_t);50extern jobject getJavaOID(JNIEnv *, gss_OID);51extern jobjectArray getJavaOIDArray(JNIEnv *, gss_OID_set);5253extern jstring getMinorMessage(JNIEnv *, jobject, OM_uint32);54extern int sameMech(gss_OID, gss_OID);5556JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *, void *);57JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *, void *);5859extern int JGSS_DEBUG;6061extern jclass CLS_Object;62extern jclass CLS_GSSNameElement;63extern jclass CLS_GSSCredElement;64extern jclass CLS_NativeGSSContext;65extern jmethodID MID_MessageProp_getPrivacy;66extern jmethodID MID_MessageProp_getQOP;67extern jmethodID MID_MessageProp_setPrivacy;68extern jmethodID MID_MessageProp_setQOP;69extern jmethodID MID_MessageProp_setSupplementaryStates;70extern jmethodID MID_ChannelBinding_getInitiatorAddr;71extern jmethodID MID_ChannelBinding_getAcceptorAddr;72extern jmethodID MID_ChannelBinding_getAppData;73extern jmethodID MID_InetAddress_getAddr;74extern jmethodID MID_GSSNameElement_ctor;75extern jmethodID MID_GSSCredElement_ctor;76extern jmethodID MID_NativeGSSContext_ctor;77extern jfieldID FID_GSSLibStub_pMech;78extern jfieldID FID_NativeGSSContext_pContext;79extern jfieldID FID_NativeGSSContext_srcName;80extern jfieldID FID_NativeGSSContext_targetName;81extern jfieldID FID_NativeGSSContext_isInitiator;82extern jfieldID FID_NativeGSSContext_isEstablished;83extern jfieldID FID_NativeGSSContext_delegatedCred;84extern jfieldID FID_NativeGSSContext_flags;85extern jfieldID FID_NativeGSSContext_lifetime;86extern jfieldID FID_NativeGSSContext_actualMech;87#define TRACE0(s) { if (JGSS_DEBUG) { puts(s); fflush(stdout); }}88#define TRACE1(s, p1) { if (JGSS_DEBUG) { printf(s"\n", p1); fflush(stdout); }}89#define TRACE2(s, p1, p2) { if (JGSS_DEBUG) { printf(s"\n", p1, p2); fflush(stdout); }}90#define TRACE3(s, p1, p2, p3) { if (JGSS_DEBUG) { printf(s"\n", p1, p2, p3); fflush(stdout); }}919293#ifdef __cplusplus94}95#endif96#endif979899