exception.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdarg.h>
#include <dhcp_svc_private.h>
#include <dhcp_symbol.h>
#include <libintl.h>
#include <jni.h>
#include "dd_misc.h"
#include "exception.h"
/*
* Note: These must match exactly with the message ids defined in the
* bridge ResourceBundle.properties file.
*/
#define DSVC_EXISTS_EX "dsvc_exists_exception"
#define DSVC_ACCESS_EX "dsvc_access_exception"
#define DSVC_CREDENTIAL_EX "dsvc_credential_exception"
#define DSVC_NO_ENT_EX "dsvc_no_ent_exception"
#define DSVC_BUSY_EX "dsvc_busy_exception"
#define DSVC_INVALID_ARGS_EX "dsvc_invalid_args_exception"
#define DSVC_INTERNAL_EX "dsvc_internal_exception"
#define DSVC_UNAVAILABLE_EX "dsvc_unavailable_exception"
#define DSVC_COLLISION_EX "dsvc_collision_exception"
#define DSVC_UNSUPPORTED_EX "dsvc_unsupported_exception"
#define DSVC_NO_MEMORY_EX "dsvc_no_memory_exception"
#define DSVC_NO_RESOURCES_EX "dsvc_no_resources_exception"
#define DSVC_BAD_RESOURCE_EX "dsvc_bad_resource_exception"
#define DSVC_BAD_PATH_EX "dsvc_bad_path_exception"
#define DSVC_MOD_VERSION_EX "dsvc_mod_version_exception"
#define DSVC_MOD_ERR_EX "dsvc_mod_err_exception"
#define DSVC_MOD_LOAD_ERR_EX "dsvc_mod_load_err_exception"
#define DSVC_MOD_UNLOAD_ERR_EX "dsvc_mod_unload_err_exception"
#define DSVC_MOD_CFG_ERR_EX "dsvc_mod_cfg_err_exception"
#define DSVC_SYNCH_ERR_EX "dsvc_synch_err_exception"
#define DSVC_NO_LOCKMGR_EX "dsvc_no_lockmgr_exception"
#define DSVC_NO_LOCATION_EX "dsvc_no_location_exception"
#define DSVC_NO_TABLE_EX "dsvc_no_table_exception"
#define DSVC_TABLE_EXISTS_EX "dsvc_table_exists_exception"
#define DSVC_BAD_CONVER_EX "dsvc_bad_conver_exception"
#define DSVC_INTERNAL_ERROR "dsvc_internal_error"
#define DSYM_CODE_OUT_OF_RANGE_EX "dsym_code_out_of_range_exception"
#define DSYM_EXCEEDS_CLASS_SIZE_EX "dsym_exceeds_class_size_exception"
#define DSYM_EXCEEDS_MAX_CLASS_SIZE_EX "dsym_exceeds_max_class_size_exception"
#define DSYM_INTERNAL_EX "dsym_internal_exception"
#define DSYM_INVALID_CAT_EX "dsym_invalid_cat_exception"
#define DSYM_INVALID_TYPE_EX "dsym_invalid_type_exception"
#define DSYM_NO_MEMORY_EX "dsym_no_memory_exception"
#define DSYM_TOO_FEW_FIELDS_EX "dsym_too_few_fields_exception"
#define DSYM_SYNTAX_EX "dsym_syntax_exception"
#define DSYM_TOO_MANY_FIELDS_EX "dsym_too_many_fields_exception"
#define DSYM_VALUE_OUT_OF_RANGE_EX "dsym_value_out_of_range_exception"
static void
int nargs, ...)
{
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* exception thrown */
return;
}
}
/* The arguments (if any) are arguments to the message */
if (nargs != 0) {
int i;
/* exception thrown */
return;
}
/* exception thrown */
return;
}
for (i = 0; i < nargs; i++) {
char *arg;
break;
}
/* exception thrown */
break;
}
break;
}
}
}
/* exception thrown */
return;
}
/* finally! */
}
}
/* Throw an exception indicating record or file exists */
static void
{
}
/* Throw an exception indicating a table already exists */
static void
{
}
/* Throw an exception indicating a table does not exist */
static void
{
}
/* Throw a generic bridge exception with a specified message */
void
{
}
/* Throw an exception as a result of an remove_dd() error */
void
{
switch (rcode) {
case DSVC_NO_TABLE:
break;
default:
}
}
/* Throw an exception as a result of an open_dd() error */
void
{
switch (rcode) {
case DSVC_TABLE_EXISTS:
break;
case DSVC_NO_TABLE:
break;
default:
}
}
/* Throw an exception as a result of an add_dd_entry() error */
void
{
switch (rcode) {
case DSVC_EXISTS:
break;
default:
}
}
/* Throw an exception as a result of an delete_dd_entry() error */
void
{
switch (rcode) {
case DSVC_NOENT:
break;
default:
}
}
/* Throw an exception as a result of an modify_dd_entry() error */
void
const char *new)
{
switch (rcode) {
case DSVC_EXISTS:
break;
case DSVC_NOENT:
break;
default:
}
}
/* Throw an out of memory exception */
void
{
}
/* Throw an exception indicating that there is no DHCP config file */
void
{
}
/* Throw an exception indicating record or file does not exist */
void
{
}
/* Throw an exception indicating an invalid resource */
void
{
}
/* Throw an exception indicating an invalid path */
void
{
}
/* Throw an exception indicating that the service is not currently running */
void
{
}
/* Throw exception for a libdhcpsvc error that requires no special treatment */
void
{
const char *msgid;
switch (rcode) {
case DSVC_SUCCESS:
break;
case DSVC_EXISTS:
break;
case DSVC_ACCESS:
break;
case DSVC_NO_CRED:
break;
case DSVC_NOENT:
break;
case DSVC_BUSY:
break;
case DSVC_INVAL:
break;
case DSVC_INTERNAL:
break;
case DSVC_UNAVAILABLE:
break;
case DSVC_COLLISION:
break;
case DSVC_UNSUPPORTED:
break;
case DSVC_NO_MEMORY:
break;
case DSVC_NO_RESOURCES:
break;
case DSVC_BAD_RESOURCE:
break;
case DSVC_BAD_PATH:
break;
case DSVC_MODULE_VERSION:
break;
case DSVC_MODULE_ERR:
break;
case DSVC_MODULE_LOAD_ERR:
break;
case DSVC_MODULE_UNLOAD_ERR:
break;
case DSVC_MODULE_CFG_ERR:
break;
case DSVC_SYNCH_ERR:
break;
case DSVC_NO_LOCKMGR:
break;
case DSVC_NO_LOCATION:
break;
case DSVC_BAD_CONVER:
break;
default:
}
}
/* Determine whether an exception is a defaults file doesn't exist exception */
{
e != NULL) {
}
}
return (result);
}
/* Throw a symbol parsing error */
/* ARGSUSED [one day we should use the `key' argument in messages] */
void
{
const char *dsym_exception = "com/sun/dhcpmgr/bridge/DsymException";
switch (rcode) {
case DSYM_SUCCESS:
break;
case DSYM_SYNTAX_ERROR:
break;
case DSYM_CODE_OUT_OF_RANGE:
break;
case DSYM_VALUE_OUT_OF_RANGE:
break;
case DSYM_INVALID_CAT:
break;
case DSYM_INVALID_TYPE:
break;
case DSYM_EXCEEDS_CLASS_SIZE:
break;
break;
case DSYM_NO_MEMORY:
break;
default:
}
}
/* Throw a symbol init parsing error */
void
{
const char *dsym_exception = "com/sun/dhcpmgr/bridge/DsymException";
switch (rcode) {
case DSYM_SUCCESS:
break;
case DSYM_NULL_FIELD:
break;
case DSYM_TOO_MANY_FIELDS:
break;
case DSYM_NO_MEMORY:
break;
default:
}
}
/* Throw an exception indicating an error in wordexp */
void
{
}