Commit b1b7b521 authored by Ted Lemon's avatar Ted Lemon

Get a clean compile with all known gcc warnings.

parent 77a5f871
......@@ -196,9 +196,12 @@ MINORVERSION=MinorVersion
## NetBSD
##--netbsd--
#CF = cf/netbsd.h
#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-implicit -Wno-comment \
# -Wno-uninitialized -Werror -Wno-switch \
# -Wimplicit-function-declaration -pipe $(BINDDEF)
#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \
# -Wno-uninitialized -Werror \
# -Wimplicit-function-declaration -Wpointer-arith -Wcast-qual \
# -Wcast-align -Wwrite-strings -Wconversion -Wmissing-prototypes \
# -Wmissing-declarations -Wnested-externs \
# -pipe $(BINDDEF)
#SCRIPT=netbsd
##--netbsd--
......
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.35 1999/10/01 03:42:31 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
"$Id: clparse.c,v 1.36 1999/10/07 06:35:35 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -51,7 +51,7 @@ isc_result_t read_client_conf ()
{
int file;
struct parse *cfile;
char *val;
const char *val;
int token;
int declaration = 0;
struct client_config *config;
......@@ -140,7 +140,7 @@ void read_client_leases ()
{
int file;
struct parse *cfile;
char *val;
const char *val;
int token;
/* Open the lease file. If we can't open it, just return -
......@@ -192,7 +192,7 @@ void parse_client_statement (cfile, ip, config)
struct client_config *config;
{
int token;
char *val;
const char *val;
struct option *option;
struct executable_statement *stmt, **p;
enum statement_op op;
......@@ -200,6 +200,7 @@ void parse_client_statement (cfile, ip, config)
char *name;
struct data_string key_id;
enum policy policy;
int known;
switch (peek_token (&val, cfile)) {
case AUTH_KEY:
......@@ -291,7 +292,8 @@ void parse_client_statement (cfile, ip, config)
op = supersede_option_statement;
do_option:
token = next_token (&val, cfile);
option = parse_option_name (cfile, 0);
known = 0;
option = parse_option_name (cfile, 0, &known);
if (!option)
return;
stmt = (struct executable_statement *)0;
......@@ -321,7 +323,7 @@ void parse_client_statement (cfile, ip, config)
return;
}
option = parse_option_name (cfile, 1);
option = parse_option_name (cfile, 1, &known);
if (!option)
return;
......@@ -485,11 +487,11 @@ void parse_client_statement (cfile, ip, config)
int parse_X (cfile, buf, max)
struct parse *cfile;
u_int8_t *buf;
int max;
unsigned max;
{
int token;
char *val;
int len;
const char *val;
unsigned len;
u_int8_t *s;
token = peek_token (&val, cfile);
......@@ -541,7 +543,7 @@ void parse_option_list (cfile, list)
{
int ix, i;
int token;
char *val;
const char *val;
pair p = (pair)0, q, r;
ix = 0;
......@@ -606,7 +608,7 @@ void parse_interface_declaration (cfile, outer_config, name)
char *name;
{
int token;
char *val;
const char *val;
struct client_state *client, **cp;
struct interface_info *ip;
......@@ -663,7 +665,7 @@ void parse_interface_declaration (cfile, outer_config, name)
}
struct interface_info *interface_or_dummy (name)
char *name;
const char *name;
{
struct interface_info *ip;
......@@ -738,7 +740,7 @@ void parse_client_lease_statement (cfile, is_static)
struct client_lease *lease, *lp, *pl;
struct interface_info *ip = (struct interface_info *)0;
int token;
char *val;
const char *val;
struct client_state *client = (struct client_state *)0;
token = next_token (&val, cfile);
......@@ -865,7 +867,7 @@ void parse_client_lease_declaration (cfile, lease, ipp, clientp)
struct client_state **clientp;
{
int token;
char *val;
const char *val;
char *t, *n;
struct interface_info *ip;
struct option_cache *oc;
......@@ -970,20 +972,21 @@ int parse_option_decl (oc, cfile)
struct option_cache **oc;
struct parse *cfile;
{
char *val;
const char *val;
int token;
u_int8_t buf [4];
u_int8_t hunkbuf [1024];
int hunkix = 0;
char *fmt;
unsigned hunkix = 0;
const char *fmt;
struct option *option;
struct iaddr ip_addr;
u_int8_t *dp;
int len;
unsigned len;
int nul_term = 0;
struct buffer *bp;
int known = 0;
option = parse_option_name (cfile, 0);
option = parse_option_name (cfile, 0, &known);
if (!option)
return 0;
......@@ -1105,7 +1108,7 @@ int parse_option_decl (oc, cfile)
goto alloc;
default:
log_error ("Bad format %c in parse_option_param.",
log_error ("parse_option_param: Bad format %c",
*fmt);
skip_to_semi (cfile);
return 0;
......@@ -1144,7 +1147,7 @@ void parse_string_list (cfile, lp, multiple)
int multiple;
{
int token;
char *val;
const char *val;
struct string_list *cur, *tmp;
/* Find the last medium in the media list. */
......@@ -1193,7 +1196,7 @@ void parse_reject_statement (cfile, config)
struct client_config *config;
{
int token;
char *val;
const char *val;
struct iaddr addr;
struct iaddrlist *list;
......
......@@ -22,7 +22,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhclient.c,v 1.83 1999/10/01 03:42:47 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: dhclient.c,v 1.84 1999/10/07 06:35:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -33,9 +33,9 @@ TIME default_lease_time = 43200; /* 12 hours... */
TIME max_lease_time = 86400; /* 24 hours... */
struct tree_cache *global_options [256];
char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
char *path_dhclient_db = _PATH_DHCLIENT_DB;
char *path_dhclient_pid = _PATH_DHCLIENT_PID;
const char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
const char *path_dhclient_db = _PATH_DHCLIENT_DB;
const char *path_dhclient_pid = _PATH_DHCLIENT_PID;
int dhcp_max_agent_option_packet_length = 0;
......@@ -75,7 +75,7 @@ int main (argc, argv, envp)
struct servent *ent;
struct interface_info *ip;
struct client_state *client;
int seed;
unsigned seed;
int quiet = 0;
char *server = (char *)0;
isc_result_t status;
......@@ -290,7 +290,7 @@ void cleanup ()
}
struct class *find_class (s)
char *s;
const char *s;
{
return (struct class *)0;
}
......@@ -774,7 +774,7 @@ void dhcp (packet)
{
struct iaddrlist *ap;
void (*handler) PROTO ((struct packet *));
char *type;
const char *type;
switch (packet -> packet_type) {
case DHCPOFFER:
......@@ -817,7 +817,7 @@ void dhcpoffer (packet)
struct client_lease *lease, *lp;
int i;
int stop_selecting;
char *name = packet -> packet_type ? "DHCPOFFER" : "BOOTREPLY";
const char *name = packet -> packet_type ? "DHCPOFFER" : "BOOTREPLY";
struct iaddrlist *ap;
struct option_cache *oc;
......@@ -966,7 +966,7 @@ struct client_lease *packet_to_lease (packet)
/* If the server name was filled out, copy it. */
if (!(i & 2) && packet -> raw -> sname [0]) {
int len;
unsigned len;
/* Don't count on the NUL terminator. */
for (len = 0; len < 64; len++)
if (!packet -> raw -> sname [len])
......@@ -985,7 +985,7 @@ struct client_lease *packet_to_lease (packet)
/* Ditto for the filename. */
if (!(i & 1) && packet -> raw -> file [0]) {
int len;
unsigned len;
/* Don't count on the NUL terminator. */
for (len = 0; len < 64; len++)
if (!packet -> raw -> file [len])
......@@ -1466,7 +1466,7 @@ void make_client_options (client, lease, type, sid, rip, prl, op)
u_int32_t *prl;
struct option_state **op;
{
int i;
unsigned i;
struct option_cache *oc;
struct buffer *bp = (struct buffer *)0;
......@@ -1943,7 +1943,7 @@ FILE *scriptFile;
void script_init (client, reason, medium)
struct client_state *client;
char *reason;
const char *reason;
struct string_list *medium;
{
int fd;
......@@ -1987,7 +1987,7 @@ void script_init (client, reason, medium)
void script_write_params (client, prefix, lease)
struct client_state *client;
char *prefix;
const char *prefix;
struct client_lease *lease;
{
int i;
......
......@@ -492,6 +492,48 @@ OOTTHHEERR DDEECCLLAARRAATTIIOONNSS
ration will use the parameters declared outside of any
interface declaration, or the default settings.
ppsseeuuddoo ""_n_a_m_e" "_r_e_a_l_-_n_a_m_e"" {{ _d_e_c_l_a_r_a_t_i_o_n_s _._._. }}
Under some circumstances it can be useful to declare a
pseudo-interface and have the DHCP client acquire a con­
figuration for that interface. Each interface that the
DHCP client is supporting normally has a DHCP client state
machine running on it to acquire and maintain its lease.
A pseudo-interface is just another state machine running
on the interface named _r_e_a_l_-_n_a_m_e, with its own lease and
its own state. If you use this feature, you must provide
a client identifier for both the pseudo-interface and the
actual interface, and the two identifiers must be differ­
ent. You must also provide a seperate client script for
the pseudo-interface to do what you want with the IP
address. For example:
interface "ep0" {
send dhcp-client-identifier "my-client-ep0";
}
pseudo "secondary" "ep0" {
send dhcp-client-identifier "my-client-ep0-secondary";
script "/etc/dhclient-secondary";
}
The client script for the pseudo-interface should not con­
figure the interface up or down - essentially, all it
needs to handle are the states where a lease has been
acquired or renewed, and the states where a lease has
8
dhclient.conf(5) dhclient.conf(5)
expired. See ddhhcclliieenntt--ssccrriipptt((88)) for more information.
mmeeddiiaa ""_m_e_d_i_a _s_e_t_u_p"" _[ ,, ""_m_e_d_i_a _s_e_t_u_p"",, _._._. _];;
The mmeeddiiaa statement defines one or more media configura­
......@@ -520,18 +562,6 @@ SSAAMMPPLLEE
192.5.5.213, and has one interface, ep0 (a 3com 3C589C).
Booting intervals have been shortened somewhat from the
default, because the client is known to spend most of its
8
dhclient.conf(5) dhclient.conf(5)
time on networks with little DHCP activity. The laptop
does roam to multiple networks.
......@@ -556,6 +586,18 @@ dhclient.conf(5) dhclient.conf(5)
media "media 10baseT/UTP", "media 10base2/BNC";
}
9
dhclient.conf(5) dhclient.conf(5)
alias {
interface "ep0";
fixed-address 192.5.5.213;
......@@ -589,6 +631,30 @@ AAUUTTHHOORR
9
10
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: alloc.c,v 1.33 1999/07/31 17:53:05 mellon Exp $ Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. All rights reserved.\n";
"$Id: alloc.c,v 1.34 1999/10/07 06:35:40 mellon Exp $ Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -31,8 +31,8 @@ struct dhcp_packet *dhcp_free_list;
struct packet *packet_free_list;
VOIDPTR dmalloc (size, name)
int size;
char *name;
unsigned size;
const char *name;
{
VOIDPTR foo = (VOIDPTR)malloc (size);
if (!foo)
......@@ -44,7 +44,7 @@ VOIDPTR dmalloc (size, name)
void dfree (ptr, name)
VOIDPTR ptr;
char *name;
const char *name;
{
if (!ptr) {
log_error ("dfree %s: free on null pointer.", name);
......@@ -54,7 +54,7 @@ void dfree (ptr, name)
}
struct dhcp_packet *new_dhcp_packet (name)
char *name;
const char *name;
{
struct dhcp_packet *rval;
rval = (struct dhcp_packet *)dmalloc (sizeof (struct dhcp_packet),
......@@ -64,7 +64,7 @@ struct dhcp_packet *new_dhcp_packet (name)
struct hash_table *new_hash_table (count, name)
int count;
char *name;
const char *name;
{
struct hash_table *rval = dmalloc (sizeof (struct hash_table)
- (DEFAULT_HASH_SIZE
......@@ -77,43 +77,43 @@ struct hash_table *new_hash_table (count, name)
}
struct hash_bucket *new_hash_bucket (name)
char *name;
const char *name;
{
struct hash_bucket *rval = dmalloc (sizeof (struct hash_bucket), name);
return rval;
}
struct lease *new_leases (n, name)
int n;
char *name;
unsigned n;
const char *name;
{
struct lease *rval = dmalloc (n * sizeof (struct lease), name);
return rval;
}
struct lease *new_lease (name)
char *name;
const char *name;
{
struct lease *rval = dmalloc (sizeof (struct lease), name);
return rval;
}
struct subnet *new_subnet (name)
char *name;
const char *name;
{
struct subnet *rval = dmalloc (sizeof (struct subnet), name);
return rval;
}
struct class *new_class (name)
char *name;
const char *name;
{
struct class *rval = dmalloc (sizeof (struct class), name);
return rval;
}
struct shared_network *new_shared_network (name)
char *name;
const char *name;
{
struct shared_network *rval =
dmalloc (sizeof (struct shared_network), name);
......@@ -121,7 +121,7 @@ struct shared_network *new_shared_network (name)
}
struct group *new_group (name)
char *name;
const char *name;
{
struct group *rval =
dmalloc (sizeof (struct group), name);
......@@ -131,7 +131,7 @@ struct group *new_group (name)
}
struct protocol *new_protocol (name)
char *name;
const char *name;
{
struct protocol *rval = dmalloc (sizeof (struct protocol), name);
return rval;
......@@ -140,7 +140,7 @@ struct protocol *new_protocol (name)
struct lease_state *free_lease_states;
struct lease_state *new_lease_state (name)
char *name;
const char *name;
{
struct lease_state *rval;
......@@ -162,7 +162,7 @@ struct lease_state *new_lease_state (name)
}
struct domain_search_list *new_domain_search_list (name)
char *name;
const char *name;
{
struct domain_search_list *rval =
dmalloc (sizeof (struct domain_search_list), name);
......@@ -170,7 +170,7 @@ struct domain_search_list *new_domain_search_list (name)
}
struct name_server *new_name_server (name)
char *name;
const char *name;
{
struct name_server *rval =
dmalloc (sizeof (struct name_server), name);
......@@ -179,13 +179,13 @@ struct name_server *new_name_server (name)
void free_name_server (ptr, name)
struct name_server *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
struct option *new_option (name)
char *name;
const char *name;
{
struct option *rval =
dmalloc (sizeof (struct option), name);
......@@ -196,7 +196,7 @@ struct option *new_option (name)
void free_option (ptr, name)
struct option *ptr;
char *name;
const char *name;
{
/* XXX have to put all options on heap before this is possible. */
#if 0
......@@ -207,7 +207,7 @@ void free_option (ptr, name)
}
struct universe *new_universe (name)
char *name;
const char *name;
{
struct universe *rval =
dmalloc (sizeof (struct universe), name);
......@@ -216,21 +216,21 @@ struct universe *new_universe (name)
void free_universe (ptr, name)
struct universe *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_domain_search_list (ptr, name)
struct domain_search_list *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_lease_state (ptr, name)
struct lease_state *ptr;
char *name;
const char *name;
{
if (ptr -> options)
option_state_dereference (&ptr -> options, name);
......@@ -242,69 +242,69 @@ void free_lease_state (ptr, name)
void free_protocol (ptr, name)
struct protocol *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_group (ptr, name)
struct group *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_shared_network (ptr, name)
struct shared_network *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_class (ptr, name)
struct class *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_subnet (ptr, name)
struct subnet *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_lease (ptr, name)
struct lease *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}
void free_hash_bucket (ptr, name)
struct hash_bucket *ptr;
char *name;
const char *name;
{
dfree ((VOIDPTR)ptr, name);
}