#ifndef lint
static char copyright[] =
-"$Id: clparse.c,v 1.13 1997/10/27 20:13:21 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: clparse.c,v 1.13.2.1 1998/06/25 21:11:27 mellon Exp $ Copyright (c) 1997 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) {
#ifndef lint
static char copyright[] =
-"$Id: convert.c,v 1.4 1997/05/09 07:58:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: convert.c,v 1.4.2.1 1998/06/25 21:11:28 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
void putUShort (obuf, val)
unsigned char *obuf;
- u_int16_t val;
+ unsigned int val;
{
u_int16_t tmp = htons (val);
memcpy (obuf, &tmp, sizeof tmp);
void putShort (obuf, val)
unsigned char *obuf;
- int16_t val;
+ int val;
{
int16_t tmp = htons (val);
memcpy (obuf, &tmp, sizeof tmp);
Network input dispatcher... */
/*
- * 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: dispatch.c,v 1.47.2.1 1998/06/25 05:45:10 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dispatch.c,v 1.47.2.2 1998/06/25 21:11:28 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
static struct timeout *free_timeouts;
static int interfaces_invalidated;
void (*bootp_packet_handler) PROTO ((struct interface_info *,
- struct dhcp_packet *, int, unsigned short,
+ struct dhcp_packet *, int, unsigned int,
struct iaddr, struct hardware *));
static void got_one PROTO ((struct protocol *));
Routines for manipulating hash tables... */
/*
- * 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: 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.9.2.1 1998/06/25 21:11:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 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;
{
register int accum = 0;
- register unsigned char *s = (unsigned char *)name;
+ register unsigned char *s = name;
int i = len;
if (i) {
while (i--) {
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;
-/* dhcp.c
+/* icmp.c
ICMP Protocol engine - for sending out pings and receiving
responses. */
/*
- * Copyright (c) 1997 The Internet Software Consortium.
+ * Copyright (c) 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: icmp.c,v 1.7 1997/06/04 20:59:40 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: icmp.c,v 1.7.2.1 1998/06/25 21:11:29 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
(char *)&state, sizeof state) < 0)
error ("Unable to disable SO_DONTROUTE on ICMP socket: %m");
- add_protocol ("icmp", icmp_protocol_fd, icmp_echoreply, handler);
+ add_protocol ("icmp", icmp_protocol_fd, icmp_echoreply,
+ (void *)handler);
}
int icmp_echorequest (addr)
{
struct icmp *icfrom;
struct sockaddr_in from;
- unsigned char icbuf [1500];
+ u_int8_t icbuf [1500];
int status;
int len;
struct iaddr ia;
void (*handler) PROTO ((struct iaddr, u_int8_t *, int));
len = sizeof from;
- status = recvfrom (protocol -> fd, icbuf, sizeof icbuf, 0,
+ status = recvfrom (protocol -> fd, (char *)icbuf, sizeof icbuf, 0,
(struct sockaddr *)&from, &len);
if (status < 0) {
warn ("icmp_echoreply: %m");
/* If we were given a second-stage handler, call it. */
if (protocol -> local) {
- handler = protocol -> local;
+ handler = ((void (*) PROTO ((struct iaddr,
+ u_int8_t *, int)))
+ protocol -> local);
memcpy (ia.iabuf, &from.sin_addr, sizeof from.sin_addr);
ia.len = sizeof from.sin_addr;
#ifndef lint
static char copyright[] =
-"$Id: memory.c,v 1.35.2.1 1998/06/25 05:47:29 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: memory.c,v 1.35.2.2 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if (type)
add_hash (user_class_hash,
- tname, strlen (tname), (unsigned char *)class);
+ (unsigned char *)tname, strlen (tname),
+ (unsigned char *)class);
else
add_hash (vendor_class_hash,
- tname, strlen (tname), (unsigned char *)class);
+ (unsigned char *)tname, strlen (tname),
+ (unsigned char *)class);
return class;
}
struct class *find_class (type, name, len)
int type;
- char *name;
+ unsigned char *name;
int len;
{
struct class *class =
DHCP options parsing and reassembly. */
/*
- * 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: options.c,v 1.26.2.2 1998/06/25 05:49:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: options.c,v 1.26.2.3 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
&& packet -> options [DHO_DHCP_OPTION_OVERLOAD].data) {
if (packet -> options [DHO_DHCP_OPTION_OVERLOAD].data [0] & 1)
parse_option_buffer (packet,
+ (unsigned char *)
packet -> raw -> file,
sizeof packet -> raw -> file);
if (packet -> options [DHO_DHCP_OPTION_OVERLOAD].data [0] & 2)
parse_option_buffer (packet,
+ (unsigned char *)
packet -> raw -> sname,
sizeof packet -> raw -> sname);
}
case 't':
if (emit_quotes)
*op++ = '"';
- strcpy (op, dp);
- op += strlen (dp);
+ strcpy (op, (char *)dp);
+ op += strlen ((char *)dp);
if (emit_quotes)
*op++ = '"';
*op = 0;
struct interface_info *interface;
struct dhcp_packet *packet;
int len;
- unsigned short from_port;
+ unsigned int from_port;
struct iaddr from;
struct hardware *hfrom;
{
Common parser code for dhcpd and dhclient. */
/*
- * Copyright (c) 1995, 1996, 1997 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: parse.c,v 1.2 1997/05/09 08:08:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: parse.c,v 1.2.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
{
char *val;
int token;
- unsigned char *bufp = buf, *s, *t;
+ unsigned char *bufp = buf, *s;
+ char *t;
int count = 0;
pair c = (pair)0;
convert_num (s, val, base, size);
s += size / 8;
} else {
- t = (unsigned char *)malloc (strlen (val) + 1);
+ t = (char *)malloc (strlen (val) + 1);
if (!t)
error ("no temp space for number.");
strcpy (t, val);
Turn data structures into printable text. */
/*
- * 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: 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.16.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 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);
}
}
}
#ifndef lint
static char copyright[] =
-"$Id: socket.c,v 1.26.2.1 1998/05/18 05:45:49 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: socket.c,v 1.26.2.2 1998/06/25 21:11:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
int retry = 0;
do {
#endif
- result = recvfrom (interface -> rfdesc, buf, len, 0,
+ result = recvfrom (interface -> rfdesc, (char *)buf, len, 0,
(struct sockaddr *)from, &flen);
#ifdef IGNORE_HOSTUNREACH
} while (result < 0 &&
#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.13.2.1 1998/06/25 21:11:32 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 dhcpd... */
/*
- * Copyright (c) 1995, 1996, 1997 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
unsigned char *, int, int, int));
void do_packet PROTO ((struct interface_info *,
struct dhcp_packet *, int,
- unsigned short, struct iaddr, struct hardware *));
+ unsigned int, struct iaddr, struct hardware *));
/* errwarn.c */
extern int warnings_occurred;
void dhcpdecline PROTO ((struct packet *));
void dhcpinform PROTO ((struct packet *));
void nak_lease PROTO ((struct packet *, struct iaddr *cip));
-void ack_lease PROTO ((struct packet *, struct lease *, unsigned char, TIME));
+void ack_lease PROTO ((struct packet *, struct lease *, unsigned int, TIME));
void dhcp_reply PROTO ((struct lease *));
struct lease *find_lease PROTO ((struct packet *,
struct shared_network *, int *));
void hw_hash_add PROTO ((struct lease *));
void hw_hash_delete PROTO ((struct lease *));
struct class *add_class PROTO ((int, char *));
-struct class *find_class PROTO ((int, char *, int));
+struct class *find_class PROTO ((int, unsigned char *, int));
struct group *clone_group PROTO ((struct group *, char *));
void write_leases PROTO ((void));
void dump_subnets PROTO ((void));
extern int quiet_interface_discovery;
extern void (*bootp_packet_handler) PROTO ((struct interface_info *,
struct dhcp_packet *, int,
- unsigned short,
+ unsigned int,
struct iaddr, struct hardware *));
extern struct timeout *timeouts;
void discover_interfaces PROTO ((int));
/* hash.c */
struct hash_table *new_hash PROTO ((void));
-void add_hash PROTO ((struct hash_table *, char *, int, unsigned char *));
-void delete_hash_entry PROTO ((struct hash_table *, char *, int));
-unsigned char *hash_lookup PROTO ((struct hash_table *, char *, int));
+void add_hash PROTO ((struct hash_table *, unsigned char *,
+ int, unsigned char *));
+void delete_hash_entry PROTO ((struct hash_table *, unsigned char *, int));
+unsigned char *hash_lookup PROTO ((struct hash_table *, unsigned char *, int));
/* tables.c */
extern struct option dhcp_options [256];
int16_t getShort PROTO ((unsigned char *));
void putULong PROTO ((unsigned char *, u_int32_t));
void putLong PROTO ((unsigned char *, int32_t));
-void putUShort PROTO ((unsigned char *, u_int16_t));
-void putShort PROTO ((unsigned char *, int16_t));
+void putUShort PROTO ((unsigned char *, unsigned int));
+void putShort PROTO ((unsigned char *, int));
/* inet.c */
struct iaddr subnet_number PROTO ((struct iaddr, struct iaddr));
/* dhcrelay.c */
void relay PROTO ((struct interface_info *, struct dhcp_packet *, int,
- unsigned short, struct iaddr, struct hardware *));
+ unsigned int, struct iaddr, struct hardware *));
/* icmp.c */
void icmp_startup PROTO ((int, void (*) PROTO ((struct iaddr,
Definitions for hashing... */
/*
- * Copyright (c) 1995 The Internet Software Consortium. All rights reserved.
+ * Copyright (c) 1995, 1996 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: dhcrelay.c,v 1.9.2.3 1998/06/25 18:34:47 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcrelay.c,v 1.9.2.4 1998/06/25 21:11:34 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
struct interface_info *ip;
struct dhcp_packet *packet;
int length;
- u_int16_t from_port;
+ unsigned int from_port;
struct iaddr from;
struct hardware *hfrom;
{
#ifndef lint
static char copyright[] =
-"$Id: confpars.c,v 1.45 1997/10/27 20:22:40 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: confpars.c,v 1.45.2.1 1998/06/25 21:11:34 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) {
token = next_token (&val, cfile);
tree = tree_concat
(tree,
- tree_const (val,
+ tree_const ((unsigned char *)
+ val,
strlen (val)));
} else {
parse_warn ("expecting string %s.",
skip_to_semi (cfile);
return;
}
- tree = tree_concat (tree,
- tree_const (val,
- strlen (val)));
+ tree = tree_concat
+ (tree,
+ tree_const ((unsigned char *)val,
+ strlen (val)));
break;
case 'I': /* IP address or hostname. */
DHCP Protocol engine. */
/*
- * Copyright (c) 1995, 1996, 1997 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: dhcp.c,v 1.57.2.1 1998/05/18 05:28:06 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.57.2.2 1998/06/25 21:11:35 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
int outstanding_pings;
-static unsigned char dhcp_message [256];
+static char dhcp_message [256];
void dhcp (packet)
struct packet *packet;
/* Set DHCP_MESSAGE to whatever the message is */
options [DHO_DHCP_MESSAGE] = &dhcpmsg_tree;
- options [DHO_DHCP_MESSAGE] -> value = dhcp_message;
- options [DHO_DHCP_MESSAGE] -> len = strlen (dhcp_message);
- options [DHO_DHCP_MESSAGE] -> buf_size = strlen (dhcp_message);
+ options [DHO_DHCP_MESSAGE] -> value = (unsigned char *)dhcp_message;
+ options [DHO_DHCP_MESSAGE] -> len =
+ options [DHO_DHCP_MESSAGE] -> buf_size = strlen (dhcp_message);
options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF;
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
void ack_lease (packet, lease, offer, when)
struct packet *packet;
struct lease *lease;
- unsigned char offer;
+ unsigned int offer;
TIME when;
{
struct lease lt;