dhcptab.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 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <jni.h>
#include <dhcp_svc_private.h>
#include <dhcp_svc_confkey.h>
#include <dhcp_symbol.h>
#include <com_sun_dhcpmgr_bridge_Bridge.h>
#include "exception.h"
#include "dd_misc.h"
#include "class_cache.h"
/*
* Validate that a symbol definition in dhcptab(4) format is valid.
*/
static boolean_t
const char *key,
const char *value) {
char **fields;
int last = 0;
if (dsymret != DSYM_SUCCESS) {
return (B_FALSE);
}
if (dsymret != DSYM_SUCCESS) {
dsymret);
}
return (dsymret == DSYM_SUCCESS);
}
/*
* Create a dt_rec from a DhcptabRecord.
*/
static dt_rec_t *
{
char *str;
/* Locate the class we need */
/* exception thrown */
return (NULL);
}
return (NULL);
}
&str)) {
/* exception thrown */
return (NULL);
}
&str)) {
/* exception thrown */
return (NULL);
}
&str)) {
/* exception thrown */
return (NULL);
}
/* exception thrown */
return (NULL);
}
if (validate) {
/* exception thrown */
return (NULL);
}
}
}
return (dtrec);
}
/*
* Create a Macro from a dt_rec.
*/
static jobject
{
/* Find the class we need */
/* exception thrown */
return (NULL);
}
/* Locate the class constructor we need */
/* exception thrown */
return (NULL);
}
}
return (dhcptabRecord);
}
/*
* Create an Array of vendor classes.
*/
static jobjectArray
int i;
/* exception thrown */
return (NULL);
}
/* Construct the array */
/* exception thrown */
return (NULL);
}
/* For each vendor, create an object and add it to the array */
break;
}
}
return (jlist);
}
/*
* Create an Option from a dt_rec.
*/
static jobject
const char *key,
const char *value,
{
char **fields;
int last = 0;
/* Find the class we need */
/* exception thrown */
return (NULL);
}
/* Locate the class constructor we need */
/* exception thrown */
return (NULL);
}
if (ret != DSYM_SUCCESS) {
/* throw exception */
return (NULL);
}
}
} else {
/* throw exception */
}
return (dhcptabRecord);
}
/*
* Retrieve an option from the dhcptab. Returns
* the record as a new instance of a Option
*/
/*ARGSUSED*/
{
char *key;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Retrieve the key argument */
/* exception thrown */
return (NULL);
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the records */
(void**)&recordList, &count);
if (rcode == DSVC_SUCCESS) {
if (count == 1) {
} else {
}
} else {
}
return (dhcptabRecord);
}
/*
* Use the current datastore to create a dhcptab table in a new datastore.
*/
/*ARGSUSED*/
{
int rcode;
int i;
/* Get the current data store configuration */
/* exception thrown */
return;
}
/* Make a "new" dsvc_datastore_t */
/* exception thrown */
return;
}
/* Open the current dhcptab */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Open the new dhcptab */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Get the records */
(void**)&recordList, &count);
if (rcode != DSVC_SUCCESS) {
return;
}
if (count != 0) {
}
/* For each row, write client record to new table */
for (i = 0; i < count; i++) {
/* Now add the record */
if (rcode != DSVC_SUCCESS) {
break;
}
}
if (originalList != NULL) {
}
}
/*
* Return all options (aka symbols) currently defined in the dhcptab.
* The options are returned as an array of Options.
*/
/*ARGSUSED*/
{
int rcode;
int i;
/* Find the Option class and its constructor */
/* exception thrown */
return (NULL);
}
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the records */
(void**)&recordList, &count);
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
if (count != 0) {
}
/* Construct the array */
/* exception thrown */
if (originalList != NULL) {
}
return (NULL);
}
/* For each option, create an object and add it to the array */
for (i = 0; i < count; i++) {
if (dhcptabRecord == NULL) {
/* exception thrown */
break;
}
break;
}
}
if (originalList != NULL) {
}
return (jlist);
}
/*
* Retrieve a macro from the dhcptab. Returns
* the record as a new instance of a Macro
*/
/*ARGSUSED*/
{
char *key;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Retrieve the key argument */
/* exception thrown */
return (NULL);
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the records */
(void**)&recordList, &count);
if (rcode == DSVC_SUCCESS) {
if (count == 1) {
} else {
}
} else {
}
return (dhcptabRecord);
}
/*
* Return all macros defined in the dhcptab. Returned as an array of
* Macro objects.
*/
/*ARGSUSED*/
{
int rcode;
int i;
/* Locate the Macro class and its constructor */
/* exception thrown */
return (NULL);
}
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the records */
(void**)&recordList, &count);
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
if (count != 0) {
}
/* Construct the array */
/* exception thrown */
if (originalList != NULL) {
}
return (NULL);
}
/* For each macro, create an object and add it to the array */
for (i = 0; i < count; i++) {
if (dhcptabRecord == NULL) {
/* exception thrown */
break;
}
break;
}
}
if (originalList != NULL) {
}
return (jlist);
}
/*
* Function to create an Option object
*/
/*ARGSUSED*/
{
char *key;
char *value;
/* Retrieve the key argument */
/* exception thrown */
return (NULL);
}
/* Retrieve the value argument */
/* exception thrown */
return (NULL);
}
return (option);
}
/*
* Function to create a new dhcptab record.
*/
/*ARGSUSED*/
{
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Now add the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Modify a dhcptab record.
*/
/*ARGSUSED*/
{
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Modify the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Delete a record from the dhcptab
*/
/*ARGSUSED*/
{
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* Open the dhcptab */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Delete the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Create the dhcptab.
*/
/*ARGSUSED*/
{
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Open the dhcptab and in the process create it */
/*
* If open was successful, then close. Otherwise, if unsuccessful
* opening table, then map error to exception.
*/
if (rcode == DSVC_SUCCESS) {
} else {
}
}
/*
* Delete the dhcptab.
*/
/*ARGSUSED*/
{
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
if (rcode != DSVC_SUCCESS) {
}
}