diff options
-rw-r--r-- | sbin/dhclient/Makefile | 4 | ||||
-rw-r--r-- | sbin/dhclient/alloc.c | 24 | ||||
-rw-r--r-- | sbin/dhclient/clparse.c | 5 | ||||
-rw-r--r-- | sbin/dhclient/dhcpd.h | 25 | ||||
-rw-r--r-- | sbin/dhclient/tables.c | 19 | ||||
-rw-r--r-- | sbin/dhclient/tree.h | 7 |
6 files changed, 7 insertions, 77 deletions
diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile index 594c9aff1b4..4dfad35e18d 100644 --- a/sbin/dhclient/Makefile +++ b/sbin/dhclient/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2004/05/04 12:52:05 henning Exp $ +# $OpenBSD: Makefile,v 1.10 2005/07/11 18:09:09 krw Exp $ # # Copyright (c) 1996, 1997 The Internet Software Consortium. # All rights reserved. @@ -32,7 +32,7 @@ .include <bsd.own.mk> -SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \ +SRCS= dhclient.c clparse.c alloc.c dispatch.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ parse.c privsep.c diff --git a/sbin/dhclient/alloc.c b/sbin/dhclient/alloc.c index cabb76d4298..d0a7d4afe94 100644 --- a/sbin/dhclient/alloc.c +++ b/sbin/dhclient/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.9 2004/05/04 20:28:40 deraadt Exp $ */ +/* $OpenBSD: alloc.c,v 1.10 2005/07/11 18:09:09 krw Exp $ */ /* Memory allocation... */ @@ -52,25 +52,3 @@ new_string_list(size_t size) rval->string = ((char *)rval) + sizeof(struct string_list); return (rval); } - -struct hash_table * -new_hash_table(int count) -{ - struct hash_table *rval; - - rval = calloc(1, sizeof(struct hash_table) - - (DEFAULT_HASH_SIZE * sizeof(struct hash_bucket *)) + - (count * sizeof(struct hash_bucket *))); - if (rval == NULL) - return (NULL); - rval->hash_count = count; - return (rval); -} - -struct hash_bucket * -new_hash_bucket(void) -{ - struct hash_bucket *rval = calloc(1, sizeof(struct hash_bucket)); - - return (rval); -} diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index d9374d9bb88..f6d46ac78d6 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.20 2005/07/11 17:57:26 krw Exp $ */ +/* $OpenBSD: clparse.c,v 1.21 2005/07/11 18:09:09 krw Exp $ */ /* Parser for dhclient config and lease files... */ @@ -65,9 +65,6 @@ read_client_conf(void) new_parse(path_dhclient_conf); - /* Set up the initial dhcp option universe. */ - initialize_dhcp_universe(); - /* Initialize the top level client configuration. */ memset(&top_level_config, 0, sizeof(top_level_config)); diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 4b748afa006..1f52a052a64 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.40 2005/07/09 16:16:11 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.41 2005/07/11 18:09:09 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -220,20 +220,6 @@ struct protocol { void *local; }; -#define DEFAULT_HASH_SIZE 97 - -struct hash_bucket { - struct hash_bucket *next; - unsigned char *name; - int len; - unsigned char *value; -}; - -struct hash_table { - int hash_count; - struct hash_bucket *buckets[DEFAULT_HASH_SIZE]; -}; - /* Default path to dhcpd config file. */ #define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" #define _PATH_DHCLIENT_DB "/var/db/dhclient.leases" @@ -282,8 +268,6 @@ pair cons(caddr_t, pair); /* alloc.c */ struct string_list *new_string_list(size_t size); -struct hash_table *new_hash_table(int); -struct hash_bucket *new_hash_bucket(void); /* bpf.c */ int if_register_bpf(struct interface_info *); @@ -307,16 +291,9 @@ void add_protocol(char *, int, void (*)(struct protocol *), void *); void remove_protocol(struct protocol *); int interface_link_status(char *); -/* hash.c */ -struct hash_table *new_hash(void); -void add_hash(struct hash_table *, unsigned char *, int, unsigned char *); -unsigned char *hash_lookup(struct hash_table *, unsigned char *, int); - /* tables.c */ extern struct option dhcp_options[256]; extern unsigned char dhcp_option_default_priority_list[256]; -extern struct universe dhcp_universe; -void initialize_dhcp_universe(void); /* convert.c */ u_int32_t getULong(unsigned char *); diff --git a/sbin/dhclient/tables.c b/sbin/dhclient/tables.c index e064a8395a8..e45ded9803f 100644 --- a/sbin/dhclient/tables.c +++ b/sbin/dhclient/tables.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tables.c,v 1.7 2005/07/09 14:36:16 krw Exp $ */ +/* $OpenBSD: tables.c,v 1.8 2005/07/11 18:09:09 krw Exp $ */ /* Tables of information... */ @@ -60,7 +60,6 @@ * A - array of whatever precedes (e.g., IA means array of IP addresses) */ -struct universe dhcp_universe; struct option dhcp_options[256] = { { "pad", "", 0 }, { "subnet-mask", "I", 1 }, @@ -406,19 +405,3 @@ unsigned char dhcp_option_default_priority_list[256] = { 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, }; - -void -initialize_dhcp_universe(void) -{ - int i; - - dhcp_universe.hash = new_hash(); - if (!dhcp_universe.hash) - error("Can't allocate dhcp option hash table."); - for (i = 0; i < 256; i++) { - dhcp_universe.options[i] = &dhcp_options[i]; - add_hash(dhcp_universe.hash, - (unsigned char *)dhcp_options[i].name, 0, - (unsigned char *)&dhcp_options[i]); - } -} diff --git a/sbin/dhclient/tree.h b/sbin/dhclient/tree.h index c7d257b5b66..c4cd676294b 100644 --- a/sbin/dhclient/tree.h +++ b/sbin/dhclient/tree.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.h,v 1.9 2005/07/09 14:36:16 krw Exp $ */ +/* $OpenBSD: tree.h,v 1.10 2005/07/11 18:09:09 krw Exp $ */ /* Definitions for address trees... */ @@ -45,11 +45,6 @@ typedef struct _pair { struct _pair *cdr; } *pair; -struct universe { - struct hash_table *hash; - struct option *options[256]; -}; - struct option { char *name; char *format; |