1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _DD_MISC_H
  28 #define _DD_MISC_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #include <dhcp_svc_private.h>
  33 #include <sys/types.h>
  34 #include <sys/socket.h>
  35 #include <net/if.h>
  36 #include <unistd.h>
  37 #include <jni.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
  43 #define DAEMON_FNAME    "in.dhcpd"
  44 
  45 struct ip_interface {
  46         char name[IFNAMSIZ];
  47         struct in_addr addr;
  48         struct in_addr mask;
  49 };
  50 
  51 extern jstring dd_native_to_jstring(JNIEnv *, const char *);
  52 extern char *dd_jstring_to_native(JNIEnv *, jstring);
  53 extern boolean_t dd_jstring_to_UTF(JNIEnv *, jstring, char **);
  54 extern boolean_t dd_get_str_attr(JNIEnv *, jclass, int, jobject, char **);
  55 extern boolean_t dd_get_conf_datastore_t(JNIEnv *, dsvc_datastore_t *);
  56 extern boolean_t dd_make_datastore_t(JNIEnv *, dsvc_datastore_t *, jobject);
  57 extern void dd_free_datastore_t(dsvc_datastore_t *);
  58 extern char **dd_data_stores(JNIEnv *);
  59 extern void dd_free_data_stores(char **);
  60 extern int dd_signal(char *, int);
  61 extern pid_t dd_getpid(char *);
  62 extern struct ip_interface **dd_get_interfaces(void);
  63 
  64 #ifdef  __cplusplus
  65 }
  66 #endif
  67 
  68 #endif  /* !_DD_MISC_H */