]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix up various platform-specific errors.
authorTed Lemon <source@isc.org>
Wed, 17 May 2000 16:04:26 +0000 (16:04 +0000)
committerTed Lemon <source@isc.org>
Wed, 17 May 2000 16:04:26 +0000 (16:04 +0000)
13 files changed:
common/comapi.c
common/discover.c
common/options.c
common/parse.c
common/tree.c
includes/dhcpd.h
includes/hash.h
omapip/connection.c
omapip/protocol.c
omapip/test.c
server/confpars.c
server/dhcp.c
server/failover.c

index acca60d0115da1817cd6403d148f63c881a9ac7e..c4679b9750ff8412a882a33d1449eb270d495105 100644 (file)
@@ -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);
index c2df1a7ea365005533102d51bcb51f942b25a405..f569d59e580463272d162f37854f6648844e0967 100644 (file)
@@ -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);
index 309e9c916829afa784f560f2f61f61dc3f0038f3..655284079efc49fc372c6614f60d5707e619d14e 100644 (file)
@@ -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;
index 53557003403a20713b9dbb1c5398c41880d5fc08..2dc661d3457eecb7b4a349f660363d0f44031e35 100644 (file)
@@ -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;
 }
index ac44e4b0de7a499490a59232651f88940aea90f5..625147c8ac3fc2c76e7f5cf722d86ab334073f9c 100644 (file)
@@ -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) {
index 14515ec59774e40dfcea325eed762555a8dbbee3..f41017b73dc56a08761c549c55244c298f1dee56 100644 (file)
@@ -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 *,
index e780ce1d840dfebed6a6ad70faec28f37ca9c36a..0e5b593a27f91fd103ba8dd2951b02cf66b42bfc 100644 (file)
@@ -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;
index cdeeeb2bc663bfdf16f88c2ab1e93b06d7781040..8b0cb986fc6dd85b46a5db621e6321e3abc1bef7 100644 (file)
@@ -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;
                }
index 88721babdd1fb66226a51e3de1b406065466f792..adea07945923b58825e9a1f7a29983afab340b91 100644 (file)
@@ -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);
index 2ee46aff19191ff72e095ff4f7eaa461294d36b7..ddd2b36468081e0086f4b55d3b9098e7390ed0f7 100644 (file)
@@ -46,6 +46,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <isc/result.h>
+#include <sys/time.h>
 #include <omapip/omapip.h>
 
 int main (int argc, char **argv)
index cd3a318a7017324a7cfb3c412dee8e281836e232..e547aeb906e73426881ad7d85796e2e1f6d6004a 100644 (file)
@@ -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;
index f8d5b8bf54904e55bb7d6d4bd940ec3a99388c90..ff000ca6478d62ea15cac55ca973c3e739f45dc6 100644 (file)
@@ -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;
                }
index 6159b5d384b0748d5d30646645727ab7483edaf6..1f8627b689239b0bac1a1a9b4a9daf9fe127ac55 100644 (file)
@@ -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, ")");