/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* JNI wrapper for adt interface within libbsm
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "adt_jni.h"
#include <jni.h>
#include "../com/sun/audit/AuditSession.h" /* javah output */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
/*
* local_throw -- throw an exception.
* "why" string must be i18n'd before calling here.
*
*/
void
/* Get a String class and "new" method */
/* Create a Byte Array from message "why" */
/* Create string from byte array */
jmsg);
}
/*
* i18n the strerror return. Input is errno.
*
*/
static char *
char *locale;
char *local_text;
locale = I18N_SETUP;
return (local_text);
}
/*
* j2c_pointer
*
* convert java byte array into a C pointer
*/
int
union {
} u;
char *locale;
if (jpointer_length != sizeof (uint64_t)) {
locale = I18N_SETUP;
gettext("Bad session handle"));
return (-1);
}
&(u.buf[0]));
return (0);
}
/*
* c2j_pointer
*
* convert a C pointer into a java byte array
*/
void
union {
} u;
&(u.buf[0]));
}
/*
* adt_start_session wrapper
*
*/
/*ARGSUSED*/
int rc;
} else {
return (NULL);
}
import);
}
if (rc) {
return (NULL);
}
return (jstate);
}
/*
* adt_end_session wrapper
*/
/* ARGSUSED */
jbyteArray jstate) {
char *locale;
return;
return; /* invalid session, nothing to free */
/* presently, no errors defined, but what the heck? */
if (adt_end_session(state)) {
locale = I18N_SETUP;
gettext("Bad session handle"));
}
}
/*
* adt_dup_session wrapper
*/
/* ARGSUSED */
char *locale;
return (NULL);
locale = I18N_SETUP;
gettext("Out of memory"));
}
return (jdest);
}
/*
* adt_get_session_id wrapper
*
*/
/* ARGSUSED */
jbyteArray jstate) {
char *session_id;
return (NULL);
return (return_val);
} else
return (NULL);
}
/*
* adt_get_session_id wrapper
*/
/* ARGSUSED */
return (NULL);
return (NULL);
}
return (jbuf);
}
/* ARGSUSED */
const char *hostname;
return; /* j2c_pointer threw exception */
return; /* invalid session */
context)) {
}
}
/* ARGSUSED */
int condition;
return (0);
return (1);
}