From: Ted Lemon Date: Wed, 17 May 2000 16:04:26 +0000 (+0000) Subject: Fix up various platform-specific errors. X-Git-Tag: V3-BETA-2-PATCH-1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=165bce70b2e0ad650d07058744d187eba62ec999;p=thirdparty%2Fdhcp.git Fix up various platform-specific errors. --- diff --git a/common/comapi.c b/common/comapi.c index acca60d01..c4679b975 100644 --- a/common/comapi.c +++ b/common/comapi.c @@ -50,7 +50,7 @@ #ifndef lint static char copyright[] = -"$Id: comapi.c,v 1.1 2000/05/16 23:12:09 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: comapi.c,v 1.2 2000/05/17 16:03:59 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -367,6 +367,7 @@ isc_result_t dhcp_group_lookup (omapi_object_t **lp, group = (struct group_object *)0; if (group_name_hash && group_hash_lookup (&group, group_name_hash, + (const char *) tv -> value -> u.buffer.value, tv -> value -> u.buffer.len, MDL)) { omapi_value_dereference (&tv, MDL); diff --git a/common/discover.c b/common/discover.c index c2df1a7ea..f569d59e5 100644 --- a/common/discover.c +++ b/common/discover.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: discover.c,v 1.27 2000/05/16 23:02:12 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: discover.c,v 1.28 2000/05/17 16:04:00 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -325,8 +325,8 @@ void discover_interfaces (state) interface_dereference (&tmp, MDL); tmp = interfaces; - if (interface_discovery_hook) - (*interface_discovery_hook (tmp); + if (dhcp_interface_discovery_hook) + (*dhcp_interface_discovery_hook) (tmp); } fclose (proc_dev); diff --git a/common/options.c b/common/options.c index 309e9c916..655284079 100644 --- a/common/options.c +++ b/common/options.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.59 2000/05/16 23:02:27 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.60 2000/05/17 16:04:02 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -1194,7 +1194,7 @@ int option_space_encapsulate (result, packet, lease, u = (struct universe *)0; universe_hash_lookup (&u, universe_hash, - name -> data, name -> len, MDL); + (const char *)name -> data, name -> len, MDL); if (!u) { log_error ("unknown option space %s.", name -> data); return 0; diff --git a/common/parse.c b/common/parse.c index 535570034..2dc661d34 100644 --- a/common/parse.c +++ b/common/parse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.73 2000/05/16 23:02:28 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.74 2000/05/17 16:04:03 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1122,7 +1122,7 @@ int parse_option_code_definition (cfile, option) } option -> universe -> options [option -> code] = option; option_hash_add (option -> universe -> hash, - (const unsigned char *)option -> name, + (const char *)option -> name, 0, option, MDL); return 1; } diff --git a/common/tree.c b/common/tree.c index ac44e4b0d..625147c8a 100644 --- a/common/tree.c +++ b/common/tree.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: tree.c,v 1.81 2000/03/18 03:32:53 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tree.c,v 1.82 2000/05/17 16:04:04 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -3394,8 +3394,6 @@ int binding_scope_dereference (ptr, file, line) const char *file; int line; { - struct binding_scope *bp; - if (!ptr || !*ptr) { log_error ("%s(%d): null pointer", file, line); #if defined (POINTER_DEBUG) @@ -3417,7 +3415,7 @@ int fundef_dereference (ptr, file, line) const char *file; int line; { - struct fundef *bp; + struct fundef *bp = *ptr; struct string_list *sp, *next; if (!ptr) { diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 14515ec59..f41017b73 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -1182,7 +1182,7 @@ struct lease *new_leases PROTO ((unsigned, const char *, int)); OMAPI_OBJECT_ALLOC_DECL (lease, struct lease, dhcp_type_lease) OMAPI_OBJECT_ALLOC_DECL (class, struct class, dhcp_type_class) OMAPI_OBJECT_ALLOC_DECL (pool, struct pool, dhcp_type_pool) -OMAPI_OBJECT_ALLOC_DECL (host, struct host_decl, dhcp_type_host); +OMAPI_OBJECT_ALLOC_DECL (host, struct host_decl, dhcp_type_host) /* alloc.c */ OMAPI_OBJECT_ALLOC_DECL (subnet, struct subnet, dhcp_type_subnet) @@ -1512,7 +1512,7 @@ struct protocol *add_protocol PROTO ((const char *, int, void remove_protocol PROTO ((struct protocol *)); OMAPI_OBJECT_ALLOC_DECL (interface, - struct interface_info, dhcp_type_interface); + struct interface_info, dhcp_type_interface) /* hash.c */ struct hash_table *new_hash PROTO ((hash_reference, hash_dereference, int)); @@ -1523,7 +1523,7 @@ void delete_hash_entry PROTO ((struct hash_table *, const unsigned char *, unsigned, const char *, int)); int hash_lookup PROTO ((hashed_object_t **, struct hash_table *, const unsigned char *, unsigned, const char *, int)); -int casecmp (const void *s, const void *t, unsigned len); +int casecmp (const void *s, const void *t, unsigned long len); HASH_FUNCTIONS_DECL (group, const char *, struct group_object) HASH_FUNCTIONS_DECL (universe, const char *, struct universe) HASH_FUNCTIONS_DECL (option, const char *, struct option) @@ -2233,16 +2233,15 @@ isc_result_t dhcp_failover_state_remove PROTO ((omapi_object_t *, int dhcp_failover_state_match (dhcp_failover_state_t *, u_int8_t *, unsigned); const char *dhcp_failover_reject_reason_print (int); const char *dhcp_failover_state_name_print (enum failover_state); -failover_option_t *dhcp_failover_option_printf PROTO ((unsigned, char *, - unsigned *, - unsigned, - const char *, ...)); +failover_option_t *dhcp_failover_option_printf (unsigned, char *, + unsigned *, + unsigned, + const char *, ...); failover_option_t *dhcp_failover_make_option PROTO ((unsigned, char *, unsigned *, unsigned, ...)); -isc_result_t dhcp_failover_put_message PROTO ((dhcp_failover_link_t *, - omapi_object_t *, - int, ...)); +isc_result_t dhcp_failover_put_message (dhcp_failover_link_t *, + omapi_object_t *, int, ...); isc_result_t dhcp_failover_send_connect PROTO ((omapi_object_t *)); isc_result_t dhcp_failover_send_connectack PROTO ((omapi_object_t *, int)); isc_result_t dhcp_failover_send_disconnect PROTO ((omapi_object_t *, diff --git a/includes/hash.h b/includes/hash.h index e780ce1d8..0e5b593a2 100644 --- a/includes/hash.h +++ b/includes/hash.h @@ -59,7 +59,7 @@ struct hash_bucket { hashed_object_t *value; }; -typedef int (*hash_comparator_t)(const void *, const void *, size_t); +typedef int (*hash_comparator_t)(const void *, const void *, unsigned long); struct hash_table { unsigned hash_count; diff --git a/omapip/connection.c b/omapip/connection.c index cdeeeb2bc..8b0cb986f 100644 --- a/omapip/connection.c +++ b/omapip/connection.c @@ -307,7 +307,7 @@ isc_result_t omapi_connection_connect (omapi_object_t *h) if (c -> state == omapi_connection_connecting) { sl = sizeof error; if (getsockopt (c -> socket, SOL_SOCKET, SO_ERROR, - &error, &sl) < 0) { + (char *)&error, &sl) < 0) { omapi_disconnect (h, 1); return ISC_R_SUCCESS; } diff --git a/omapip/protocol.c b/omapip/protocol.c index 88721babd..adea07945 100644 --- a/omapip/protocol.c +++ b/omapip/protocol.c @@ -133,9 +133,9 @@ isc_result_t omapi_protocol_send_message (omapi_object_t *po, if (po -> type != omapi_type_protocol || !po -> outer || po -> outer -> type != omapi_type_connection || - m -> type != omapi_type_message) + mo -> type != omapi_type_message) return ISC_R_INVALIDARG; - if (om && om -> type != omapi_type_message) + if (omo && omo -> type != omapi_type_message) return ISC_R_INVALIDARG; p = (omapi_protocol_object_t *)po; c = (omapi_object_t *)(po -> outer); diff --git a/omapip/test.c b/omapip/test.c index 2ee46aff1..ddd2b3646 100644 --- a/omapip/test.c +++ b/omapip/test.c @@ -46,6 +46,7 @@ #include #include #include +#include #include int main (int argc, char **argv) diff --git a/server/confpars.c b/server/confpars.c index cd3a318a7..e547aeb90 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.110 2000/05/16 23:03:37 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.111 2000/05/17 16:04:23 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -615,7 +615,7 @@ void parse_failover_peer (cfile, group, type) char *name; u_int32_t split; u_int8_t hba [32]; - int hba_len = sizeof hba; + unsigned hba_len = sizeof hba; int i; struct expression *expr; isc_result_t status; diff --git a/server/dhcp.c b/server/dhcp.c index f8d5b8bf5..ff000ca64 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.149 2000/05/16 23:03:42 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.150 2000/05/17 16:04:25 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -833,7 +833,8 @@ void dhcpinform (packet, ms_nulltp) struct universe *u = (struct universe *)0; if (!universe_hash_lookup (&u, universe_hash, - d1.data, d1.len, MDL)) { + (const char *)d1.data, d1.len, + MDL)) { log_error ("unknown option space %s.", d1.data); option_state_dereference (&options, MDL); if (subnet) @@ -2110,7 +2111,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) struct universe *u = (struct universe *)0; if (!universe_hash_lookup (&u, universe_hash, - d1.data, d1.len, MDL)) { + (const char *)d1.data, d1.len, + MDL)) { log_error ("unknown option space %s.", d1.data); return; } diff --git a/server/failover.c b/server/failover.c index 6159b5d38..1f8627b68 100644 --- a/server/failover.c +++ b/server/failover.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: failover.c,v 1.14 2000/05/16 23:03:45 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: failover.c,v 1.15 2000/05/17 16:04:26 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1140,7 +1140,8 @@ isc_result_t dhcp_failover_state_signal (omapi_object_t *o, } else if (link -> imsg -> type == FTM_POOLREQ) { dhcp_failover_pool_rebalance (state); } else if (link -> imsg -> type == FTM_POOLRESP) { - log_info ("pool response: %d leases", + log_info ("pool response: %ld leases", + (unsigned long) link -> imsg -> addresses_transferred); } } @@ -2353,6 +2354,7 @@ failover_option_t *dhcp_failover_make_option (unsigned code, case FT_UNDEF: default: + break; } failover_print (obuf, obufix, obufmax, ")");