Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/dhcp Update makefiles and remove removed files.
details: https://anonhg.NetBSD.org/src/rev/eb756457d460
branches: trunk
changeset: 487647:eb756457d460
user: mellon <mellon%NetBSD.org@localhost>
date: Sat Jun 10 18:29:27 2000 +0000
description:
Update makefiles and remove removed files.
diffstat:
usr.sbin/dhcp/client/Makefile | 2 +-
usr.sbin/dhcp/client/omapi.c | 328 ------------------------------------------
usr.sbin/dhcp/common/Makefile | 2 +-
usr.sbin/dhcp/common/auth.c | 72 ---------
usr.sbin/dhcp/server/Makefile | 2 +-
5 files changed, 3 insertions(+), 403 deletions(-)
diffs (truncated from 444 to 300 lines):
diff -r cf85d1a02bcb -r eb756457d460 usr.sbin/dhcp/client/Makefile
--- a/usr.sbin/dhcp/client/Makefile Sat Jun 10 18:27:01 2000 +0000
+++ b/usr.sbin/dhcp/client/Makefile Sat Jun 10 18:29:27 2000 +0000
@@ -33,7 +33,7 @@
.include <bsd.own.mk>
SUBDIR= scripts
-SRCS = dhclient.c clparse.c omapi.c
+SRCS = dhclient.c clparse.c
PROG = dhclient
MAN = dhclient.8 dhclient.conf.5 dhclient.leases.5 dhclient-script.8
diff -r cf85d1a02bcb -r eb756457d460 usr.sbin/dhcp/client/omapi.c
--- a/usr.sbin/dhcp/client/omapi.c Sat Jun 10 18:27:01 2000 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-/* omapi.c
-
- OMAPI object interfaces for the DHCP client. */
-
-/*
- * Copyright (c) 2000 The Internet Software Consortium
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of The Internet Software Consortium nor the names
- * of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * This software has been written for the Internet Software Consortium
- * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
- * To learn more about the Internet Software Consortium, see
- * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
- * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
- * ``http://www.nominum.com''.
- */
-
-#ifndef lint
-static char copyright[] =
-"$Id: omapi.c,v 1.1.1.1 2000/04/22 07:11:31 mellon Exp $ Copyright (c) 2000 The Internet Software Consortium. All rights reserved.\n";
-#endif /* not lint */
-
-#include "dhcpd.h"
-#include <omapip/omapip_p.h>
-
-void dhclient_db_objects_setup ()
-{
- isc_result_t status;
-
- status = omapi_object_type_register (&dhcp_type_interface,
- "interface",
- dhclient_interface_set_value,
- dhclient_interface_get_value,
- dhclient_interface_destroy,
- dhclient_interface_signal_handler,
- dhclient_interface_stuff_values,
- dhclient_interface_lookup,
- dhclient_interface_create,
- dhclient_interface_remove);
- if (status != ISC_R_SUCCESS)
- log_fatal ("Can't register interface object type: %s",
- isc_result_totext (status));
-
-}
-
-isc_result_t dhclient_interface_set_value (omapi_object_t *h,
- omapi_object_t *id,
- omapi_data_string_t *name,
- omapi_typed_data_t *value)
-{
- struct interface_info *interface;
- isc_result_t status;
- int foo;
-
- if (h -> type != dhcp_type_interface)
- return ISC_R_INVALIDARG;
- interface = (struct interface_info *)h;
-
- if (!omapi_ds_strcmp (name, "name")) {
- if (value -> type == omapi_datatype_data ||
- value -> type == omapi_datatype_string) {
- memcpy (interface -> name,
- value -> u.buffer.value,
- value -> u.buffer.len);
- interface -> name [value -> u.buffer.len] = 0;
- } else
- return ISC_R_INVALIDARG;
- return ISC_R_SUCCESS;
- }
-
- /* Try to find some inner object that can take the value. */
- if (h -> inner && h -> inner -> type -> set_value) {
- status = ((*(h -> inner -> type -> set_value))
- (h -> inner, id, name, value));
- if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
- return status;
- }
-
- return ISC_R_NOTFOUND;
-}
-
-
-isc_result_t dhclient_interface_get_value (omapi_object_t *h,
- omapi_object_t *id,
- omapi_data_string_t *name,
- omapi_value_t **value)
-{
- return ISC_R_NOTIMPLEMENTED;
-}
-
-isc_result_t dhclient_interface_destroy (omapi_object_t *h,
- const char *file, int line)
-{
- struct interface_info *interface;
- isc_result_t status;
-
- if (h -> type != dhcp_type_interface)
- return ISC_R_INVALIDARG;
- interface = (struct interface_info *)h;
-
-
- if (interface -> ifp)
- free (interface -> ifp);
- dfree (interface, file, line);
- return ISC_R_SUCCESS;
-}
-
-isc_result_t dhclient_interface_signal_handler (omapi_object_t *h,
- const char *name, va_list ap)
-{
- struct interface_info *ip, *interface;
- struct client_config *config;
- struct client_state *client;
-
- if (h -> type != dhcp_type_interface)
- return ISC_R_INVALIDARG;
- interface = (struct interface_info *)h;
-
- interface -> next = interfaces;
- interfaces = interface;
-
- discover_interfaces (DISCOVER_UNCONFIGURED);
-
- for (ip = interfaces; ip; ip = ip -> next) {
- /* If interfaces were specified, don't configure
- interfaces that weren't specified! */
- if (ip -> flags & INTERFACE_RUNNING ||
- (ip -> flags & (INTERFACE_REQUESTED |
- INTERFACE_AUTOMATIC)) !=
- INTERFACE_REQUESTED)
- continue;
- script_init (ip -> client,
- "PREINIT", (struct string_list *)0);
- if (ip -> client -> alias)
- script_write_params (ip -> client, "alias_",
- ip -> client -> alias);
- script_go (ip -> client);
- }
-
- discover_interfaces (interfaces_requested
- ? DISCOVER_REQUESTED
- : DISCOVER_RUNNING);
-
- for (ip = interfaces; ip; ip = ip -> next) {
- if (ip -> flags & INTERFACE_RUNNING)
- continue;
- ip -> flags |= INTERFACE_RUNNING;
- for (client = ip -> client; client; client = client -> next) {
- client -> state = S_INIT;
- /* Set up a timeout to start the initialization
- process. */
- add_timeout (cur_time + random () % 5,
- state_reboot, client);
- }
- }
- return ISC_R_SUCCESS;
-}
-
-isc_result_t dhclient_interface_stuff_values (omapi_object_t *c,
- omapi_object_t *id,
- omapi_object_t *h)
-{
- struct interface_info *interface;
- isc_result_t status;
-
- if (h -> type != dhcp_type_interface)
- return ISC_R_INVALIDARG;
- interface = (struct interface_info *)h;
-
- /* Write out all the values. */
-
- status = omapi_connection_put_name (c, "state");
- if (status != ISC_R_SUCCESS)
- return status;
- if (interface -> flags && INTERFACE_REQUESTED)
- status = omapi_connection_put_string (c, "up");
- else
- status = omapi_connection_put_string (c, "down");
- if (status != ISC_R_SUCCESS)
- return status;
-
- /* Write out the inner object, if any. */
- if (h -> inner && h -> inner -> type -> stuff_values) {
- status = ((*(h -> inner -> type -> stuff_values))
- (c, id, h -> inner));
- if (status == ISC_R_SUCCESS)
- return status;
- }
-
- return ISC_R_SUCCESS;
-}
-
-isc_result_t dhclient_interface_lookup (omapi_object_t **ip,
- omapi_object_t *id,
- omapi_object_t *ref)
-{
- omapi_value_t *tv = (omapi_value_t *)0;
- isc_result_t status;
- struct interface_info *interface;
-
- /* First see if we were sent a handle. */
- status = omapi_get_value_str (ref, id, "handle", &tv);
- if (status == ISC_R_SUCCESS) {
- status = omapi_handle_td_lookup (ip, tv -> value);
-
- omapi_value_dereference (&tv, MDL);
- if (status != ISC_R_SUCCESS)
- return status;
-
- /* Don't return the object if the type is wrong. */
- if ((*ip) -> type != dhcp_type_interface) {
- omapi_object_dereference (ip, MDL);
- return ISC_R_INVALIDARG;
- }
- }
-
- /* Now look for an interface name. */
- status = omapi_get_value_str (ref, id, "name", &tv);
- if (status == ISC_R_SUCCESS) {
- for (interface = interfaces; interface;
- interface = interface -> next) {
- if (strncmp (interface -> name,
- (char *)tv -> value -> u.buffer.value,
- tv -> value -> u.buffer.len) == 0)
- break;
- }
- omapi_value_dereference (&tv, MDL);
- if (*ip && *ip != (omapi_object_t *)interface) {
- omapi_object_dereference (ip, MDL);
- return ISC_R_KEYCONFLICT;
- } else if (!interface) {
- if (*ip)
- omapi_object_dereference (ip, MDL);
- return ISC_R_NOTFOUND;
- } else if (!*ip)
- /* XXX fix so that hash lookup itself creates
- XXX the reference. */
- omapi_object_reference (ip,
- (omapi_object_t *)interface,
- MDL);
- }
-
- /* If we get to here without finding an interface, no valid key was
- specified. */
- if (!*ip)
- return ISC_R_NOKEYS;
- return ISC_R_SUCCESS;
-}
-
-/* actually just go discover the interface */
-isc_result_t dhclient_interface_create (omapi_object_t **lp,
- omapi_object_t *id)
-{
- struct interface_info *hp;
-
- hp = (struct interface_info *)dmalloc (sizeof (struct interface_info),
- MDL);
- if (!hp)
Home |
Main Index |
Thread Index |
Old Index