#ifndef lint
static char copyright[] =
-"$Id: dns.c,v 1.7 1998/03/15 20:50:53 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dns.c,v 1.8 1998/03/16 06:11:30 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Compute a hash on the question. */
-static inline u_int32_t dns_hash_question (struct dns_question *question)
+static INLINE u_int32_t dns_hash_question (struct dns_question *question)
{
u_int32_t sum;
u_int32_t remainder;
for (q = dns_query_hash [hash]; q; q = q -> next) {
if (q -> question -> type == question -> type &&
q -> question -> class == question -> class &&
- !strcmp (q -> question -> data, question -> data))
+ !strcmp ((char *)q -> question -> data,
+ (char *)question -> data))
break;
}
if (q || !new) {
struct dns_question *question;
/* First format the query in the internal format. */
- sprintf (query, "%d.%d.%d.%d.in-addr.arpa.",
+ sprintf ((char *)query, "%d.%d.%d.%d.in-addr.arpa.",
inaddr.iabuf [0], inaddr.iabuf [1],
inaddr.iabuf [2], inaddr.iabuf [3]);
- question = (struct dns_question *)malloc (strlen (query) +
+ question = (struct dns_question *)malloc (strlen ((char *)query) +
sizeof *question);
if (!question)
return (struct dns_query *)-1;
question -> type = T_PTR;
question -> class = C_IN;
- strcpy (question -> data, query);
+ strcpy ((char *)question -> data, (char *)query);
/* Now format the query for the name server. */
s = query;
/* Copy out the digits. */
for (i = 3; i >= 0; --i) {
label = s++;
- sprintf (s, "%d", inaddr.iabuf [i]);
- *label = strlen (s);
+ sprintf ((char *)s, "%d", inaddr.iabuf [i]);
+ *label = strlen ((char *)s);
s += *label;
}
s += addlabel (s, "in-addr");
/* Send the query. */
if (query -> next_server)
status = sendto (dns_protocol_fd,
- query -> query, query -> len, 0,
+ (char *)query -> query, query -> len, 0,
((struct sockaddr *)&query ->
next_server -> addr),
sizeof query -> next_server -> addr);
struct dns_query *query;
len = sizeof from;
- status = recvfrom (protocol -> fd, buf, sizeof buf, 0,
+ status = recvfrom (protocol -> fd, (char *)buf, sizeof buf, 0,
(struct sockaddr *)&from, &len);
if (status < 0) {
warn ("dns_packet: %m");
name = dptr;
/* Skip over the name. */
- dptr += copy_out_name (name, name, qbuf.q.data);
+ dptr += copy_out_name (name, name, (char *)qbuf.q.data);
/* Skip over the query type and query class. */
qbuf.q.type = getUShort (dptr);
#ifndef lint
static char copyright[] =
-"$Id: hash.c,v 1.9 1996/09/09 07:04:45 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: hash.c,v 1.10 1998/03/16 06:11:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
-static INLINE int do_hash PROTO ((char *, int, int));
+static INLINE int do_hash PROTO ((unsigned char *, int, int));
struct hash_table *new_hash ()
{
}
static INLINE int do_hash (name, len, size)
- char *name;
+ unsigned char *name;
int len;
int size;
{
void add_hash (table, name, len, pointer)
struct hash_table *table;
int len;
- char *name;
+ unsigned char *name;
unsigned char *pointer;
{
int hashno;
void delete_hash_entry (table, name, len)
struct hash_table *table;
int len;
- char *name;
+ unsigned char *name;
{
int hashno;
struct hash_bucket *bp, *pbp = (struct hash_bucket *)0;
/* Go through the list looking for an entry that matches;
if we find it, delete it. */
for (bp = table -> buckets [hashno]; bp; bp = bp -> next) {
- if ((!bp -> len && !strcmp (bp -> name, name)) ||
+ if ((!bp -> len &&
+ !strcmp ((char *)bp -> name, (char *)name)) ||
(bp -> len == len &&
!memcmp (bp -> name, name, len))) {
if (pbp) {
unsigned char *hash_lookup (table, name, len)
struct hash_table *table;
- char *name;
+ unsigned char *name;
int len;
{
int hashno;
}
} else {
for (bp = table -> buckets [hashno]; bp; bp = bp -> next)
- if (!strcmp (bp -> name, name))
+ if (!strcmp ((char *)bp -> name,
+ (char *)name))
return bp -> value;
}
return (unsigned char *)0;
Memory-resident database... */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: memory.c,v 1.35 1997/09/16 18:14:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: memory.c,v 1.36 1998/03/16 06:13:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
class -> name = tname;
if (type)
- add_hash (user_class_hash,
- tname, strlen (tname), (unsigned char *)class);
+ add_hash (user_class_hash, (unsigned char *)tname,
+ strlen (tname), (unsigned char *)class);
else
- add_hash (vendor_class_hash,
- tname, strlen (tname), (unsigned char *)class);
+ add_hash (vendor_class_hash, (unsigned char *)tname,
+ strlen (tname), (unsigned char *)class);
return class;
}
int len;
{
struct class *class =
- (struct class *)hash_lookup (type
- ? user_class_hash
- : vendor_class_hash, name, len);
+ (struct class *)hash_lookup ((type
+ ? user_class_hash
+ : vendor_class_hash),
+ (unsigned char *)name, len);
return class;
}
Turn data structures into printable text. */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1998 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: print.c,v 1.16 1997/11/29 07:52:10 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: print.c,v 1.17 1998/03/16 06:14:21 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if (bp -> len)
dump_raw (bp -> name, bp -> len);
else
- note (bp -> name);
+ note ((char *)bp -> name);
}
}
}
Tables of information... */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1998 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: tables.c,v 1.13 1997/05/09 08:13:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: tables.c,v 1.14 1998/03/16 06:15:04 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
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, dhcp_options [i].name, 0,
+ add_hash (dhcp_universe.hash,
+ (unsigned char *)dhcp_options [i].name, 0,
(unsigned char *)&dhcp_options [i]);
}
universe_hash.hash_count = DEFAULT_HASH_SIZE;
- add_hash (&universe_hash, dhcp_universe.name, 0,
+ add_hash (&universe_hash, (unsigned char *)dhcp_universe.name, 0,
(unsigned char *)&dhcp_universe);
}
Definitions for hashing... */
/*
- * Copyright (c) 1995 The Internet Software Consortium. All rights reserved.
+ * Copyright (c) 1995, 1998 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
struct hash_bucket {
struct hash_bucket *next;
- char *name;
+ unsigned char *name;
int len;
unsigned char *value;
};
#ifndef lint
static char copyright[] =
-"$Id: confpars.c,v 1.46 1998/03/15 21:16:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: confpars.c,v 1.47 1998/03/16 06:17:37 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Look up the option name hash table for the specified
vendor. */
- universe = (struct universe *)hash_lookup (&universe_hash,
- vendor, 0);
+ universe = ((struct universe *)
+ hash_lookup (&universe_hash,
+ (unsigned char *)vendor, 0));
/* If it's not there, we can't parse the rest of the
declaration. */
if (!universe) {
}
/* Look up the actual option info... */
- option = (struct option *)hash_lookup (universe -> hash, val, 0);
+ option = ((struct option *)
+ hash_lookup (universe -> hash, (unsigned char *)val, 0));
/* If we didn't get an option structure, it's an undefined option. */
if (!option) {