network.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 (c) 1999-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include <dhcp_svc_private.h>
#include <dhcp_svc_confkey.h>
#include <libinetutil.h>
#include <libintl.h>
#include <stdlib.h>
#include <ctype.h>
#include <malloc.h>
#include <netdb.h>
#include <jni.h>
#include <com_sun_dhcpmgr_bridge_Bridge.h>
#include "exception.h"
#include "dd_misc.h"
#include "class_cache.h"
/*
* Create a dn_rec from a DhcpClientRecord.
*/
static dn_rec_t *
{
char *str;
unsigned int cid_len;
/* Locate the class we need */
/* exception thrown */
return (NULL);
}
return (NULL);
}
/*
* Get the cid and the cid_len.
*/
&str)) {
/* exception thrown */
return (NULL);
}
return (NULL);
}
/*
* Get the flags.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the client IP.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the server IP.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the expiration.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the signature.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the macro.
*/
&str)) {
/* exception thrown */
return (NULL);
}
/*
* Get the comment.
*/
&str)) {
/* exception thrown */
return (NULL);
}
return (dnrec);
}
/*
* Create a DhcpClientRecord from a dn_rec.
*/
static jobject
{
int err;
/* Find the class */
/* exception thrown */
return (NULL);
}
/* Locate the constructor we need */
/* exception thrown */
return (NULL);
}
&cid_len);
if (err != 0) {
return (NULL);
}
sizeof (ascii_comment));
return (dhcpClientRecord);
}
/*
* Given a network name, find it's IP address.
*/
static boolean_t
int i;
int count;
count += 8;
else
break;
}
}
return (result);
}
/*
* Create a Network object for a network IP address.
*/
static jobject
const char *network)
{
/* Locate the class and methods we need */
/* exception thrown */
return (NULL);
}
/* exception thrown */
return (NULL);
}
/* exception thrown */
return (NULL);
}
return (net);
}
/*
* Get the Network object for the network argument.
*/
/*ARGSUSED*/
{
char *net;
/* Retrieve the net argument */
/* exception thrown */
return (NULL);
}
/*
* If net looks like an IP address, assume it is,
* otherwise go get its IP
*/
}
} else {
}
/* If we could not find an IP for net, then return NULL object */
return (NULL);
}
/* Create a Network object */
/* exception thrown */
return (NULL);
}
/* free up resources */
/* return the object */
return (netObj);
}
/*
* List the networks currently under DHCP management. Return as an array
* of Network objects including the subnet mask for each network.
*/
/*ARGSUSED*/
{
int rcode;
int i;
/* Locate the class. */
/* exception thrown */
return (NULL);
}
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Get the list of network tables */
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Construct the array */
/* exception thrown */
for (i = 0; i < count; i++) {
}
return (NULL);
}
/* For each network, create an object and add it to the array */
for (i = 0; i < count; i++) {
/* exception thrown */
break;
}
break;
}
}
/*
* Free the list now.
*/
for (i = 0; i < count; i++) {
}
return (jlist);
}
/*
* Use the current datastore to create a network table in a new datastore.
*/
/*ARGSUSED*/
{
char *net;
int rcode;
int i;
/* Get the current data store configuration */
/* exception thrown */
return;
}
/* Make a "new" dsvc_datastore_t */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
/* Open the current network table */
if (rcode != DSVC_SUCCESS) {
return;
}
/* Open the new network table */
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) {
}
}
/*
* Retrieve all of the records in a particular network table. Returns an
* array of DhcpClientRecord.
*/
/*ARGSUSED*/
{
int i;
char *net;
int rcode;
/* Locate the class and constructor we need */
/* exception thrown */
return (NULL);
}
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Retrieve the net argument */
/* exception thrown */
return (NULL);
}
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the records */
(void**)&recordList, &count);
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Save original pointer so we can free it correctly at end */
/* Construct the array */
/* exception thrown */
if (originalList != NULL) {
}
return (NULL);
}
/* For each client, create an object and add it to the array */
for (i = 0; i < count; i++) {
if (dhcpClientRecord == NULL) {
/* exception thrown */
break;
}
break;
}
}
if (originalList != NULL) {
}
return (jlist);
}
/*
* Create a client record
*/
/*ARGSUSED*/
{
char *net;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
net, DSVC_WRITE);
if (rcode != DSVC_SUCCESS) {
return;
}
/* Now add the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Modify a client record. Supply both old and new record and table in
* which they're to be modified.
*/
/*ARGSUSED*/
{
char *net;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
/* exception thrown */
return;
}
net, DSVC_WRITE);
if (rcode != DSVC_SUCCESS) {
return;
}
/* Modify the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Delete a client record
*/
/*ARGSUSED*/
{
char *net;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
/* exception thrown */
return;
}
net, DSVC_WRITE);
if (rcode != DSVC_SUCCESS) {
return;
}
/* Delete the record */
if (rcode != DSVC_SUCCESS) {
}
}
/*
* Retrieve a client record
*/
/*ARGSUSED*/
{
char *net;
char *addr;
int rcode;
/* Find the class and method we need */
/* exception thrown */
return (NULL);
}
/* Locate the method id we need */
if (dcr_getcip == NULL) {
/* exception thrown */
return (NULL);
}
/* Get the address from the record */
/* exception thrown */
return (NULL);
}
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return (NULL);
}
/* Retrieve the net argument */
/* exception thrown */
return (NULL);
}
/* Convert the address to a native string */
/* exception thrown */
return (NULL);
}
if (rcode != DSVC_SUCCESS) {
return (NULL);
}
/* Get the record */
(void **)&recordList, &count);
if (rcode == DSVC_SUCCESS) {
if (count == 1) {
} else {
}
} else {
}
return (dhcpClientRecord);
}
/*
* Create a network table.
*/
/*ARGSUSED*/
{
char *net;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
/*
* If open was successful, then close. Otherwise, if unsuccessful
* opening table, then map error to exception.
*/
if (rcode == DSVC_SUCCESS) {
} else {
}
}
/*
* Delete a network table.
*/
/*ARGSUSED*/
{
char *net;
int rcode;
/* Create a dsvc_datastore_t using args and DHCP config settings */
/* exception thrown */
return;
}
/* Retrieve the net argument */
/* exception thrown */
return;
}
if (rcode != DSVC_SUCCESS) {
}
}