WARNS=1 clean. patch submitted to dhcp-bugs@isc.org.

This commit is contained in:
itojun 2002-06-10 00:30:33 +00:00
parent b745604c00
commit 5b43820fcf
52 changed files with 118 additions and 370 deletions

View File

@ -43,13 +43,11 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: clparse.c,v 1.3 2002/06/10 00:30:33 itojun Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
static TIME parsed_time;
struct client_config top_level_config;
u_int32_t default_requested_options [] = {
@ -71,7 +69,6 @@ u_int32_t default_requested_options [] = {
isc_result_t read_client_conf ()
{
struct client_config *config;
struct client_state *state;
struct interface_info *ip;
isc_result_t status;
@ -255,11 +252,9 @@ void parse_client_statement (cfile, ip, config)
int token;
const char *val;
struct option *option;
struct executable_statement *stmt, **p;
enum statement_op op;
struct executable_statement *stmt;
int lose;
char *name;
struct data_string key_id;
enum policy policy;
int known;
int tmp, i;
@ -952,11 +947,9 @@ void parse_client_lease_declaration (cfile, lease, ipp, clientp)
{
int token;
const char *val;
char *t, *n;
struct interface_info *ip;
struct option_cache *oc;
struct client_state *client = (struct client_state *)0;
struct data_string key_id;
switch (next_token (&val, (unsigned *)0, cfile)) {
#if !defined (SMALL)
@ -1148,11 +1141,6 @@ int parse_allow_deny (oc, cfile, flag)
struct parse *cfile;
int flag;
{
enum dhcp_token token;
const char *val;
unsigned char rf = flag;
struct expression *data = (struct expression *)0;
int status;
parse_warn (cfile, "allow/deny/ignore not permitted here.");
skip_to_semi (cfile);

View File

@ -41,7 +41,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhclient.c,v 1.4 2002/04/03 03:32:50 christos Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
"$Id: dhclient.c,v 1.5 2002/06/10 00:30:33 itojun Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -105,7 +105,6 @@ int main (argc, argv, envp)
omapi_object_t *listener;
isc_result_t result;
int persist = 0;
int omapi_port;
int no_dhclient_conf = 0;
int no_dhclient_db = 0;
int no_dhclient_pid = 0;
@ -315,6 +314,7 @@ int main (argc, argv, envp)
/* Get the current time... */
GET_TIME (&cur_time);
memset(&sockaddr_broadcast, 0, sizeof(sockaddr_broadcast));
sockaddr_broadcast.sin_family = AF_INET;
sockaddr_broadcast.sin_port = remote_port;
if (server) {
@ -637,7 +637,6 @@ void state_selecting (cpp)
picked = lp;
picked -> next = (struct client_lease *)0;
} else {
freeit:
destroy_client_lease (lp);
}
}
@ -696,7 +695,6 @@ void dhcpack (packet)
struct client_lease *lease;
struct option_cache *oc;
struct data_string ds;
int i;
/* If we're not receptive to an offer right now, or if the offer
has an unrecognizable transaction id, then just drop it. */
@ -835,7 +833,6 @@ void dhcpack (packet)
void bind_lease (client)
struct client_state *client;
{
struct interface_info *ip = client -> interface;
/* Remember the medium. */
client -> new -> medium = client -> medium;
@ -897,7 +894,6 @@ void state_bound (cpp)
void *cpp;
{
struct client_state *client = cpp;
int i;
struct option_cache *oc;
struct data_string ds;
@ -938,7 +934,6 @@ void state_stop (cpp)
void *cpp;
{
struct client_state *client = cpp;
int i;
/* Cancel all timeouts. */
cancel_timeout (state_selecting, client);
@ -1051,8 +1046,6 @@ void dhcpoffer (packet)
int i;
int stop_selecting;
const char *name = packet -> packet_type ? "DHCPOFFER" : "BOOTREPLY";
struct iaddrlist *ap;
struct option_cache *oc;
char obuf [1024];
#ifdef DEBUG_PACKET
@ -1638,6 +1631,7 @@ void send_request (cpp)
/* If the lease T2 time has elapsed, or if we're not yet bound,
broadcast the DHCPREQUEST rather than unicasting. */
memset(&destination, 0, sizeof(destination));
if (client -> state == S_REQUESTING ||
client -> state == S_REBOOTING ||
cur_time > client -> active -> rebind)
@ -1723,6 +1717,7 @@ void send_release (cpp)
struct sockaddr_in destination;
struct in_addr from;
memset(&destination, 0, sizeof(destination));
memcpy (&from, client -> active -> address.iabuf,
sizeof from);
memcpy (&destination.sin_addr.s_addr,
@ -1852,7 +1847,6 @@ void make_discover (client, lease)
struct client_lease *lease;
{
unsigned char discover = DHCPDISCOVER;
int i;
struct option_state *options = (struct option_state *)0;
memset (&client -> packet, 0, sizeof (client -> packet));
@ -1908,9 +1902,6 @@ void make_request (client, lease)
struct client_lease *lease;
{
unsigned char request = DHCPREQUEST;
int i, j;
unsigned char *tmp, *digest;
unsigned char *old_digest_loc;
struct option_cache *oc;
memset (&client -> packet, 0, sizeof (client -> packet));
@ -1988,7 +1979,6 @@ void make_decline (client, lease)
struct client_lease *lease;
{
unsigned char decline = DHCPDECLINE;
int i;
struct option_cache *oc;
struct option_state *options = (struct option_state *)0;
@ -2043,7 +2033,6 @@ void make_release (client, lease)
struct client_lease *lease;
{
unsigned char request = DHCPRELEASE;
int i;
struct option_cache *oc;
struct option_state *options = (struct option_state *)0;
@ -2093,7 +2082,6 @@ void make_release (client, lease)
void destroy_client_lease (lease)
struct client_lease *lease;
{
int i;
if (lease -> server_name)
dfree (lease -> server_name, MDL);
@ -2157,8 +2145,6 @@ void write_lease_option (struct option_cache *oc,
{
const char *name, *dot;
struct data_string ds;
int status;
struct client_state *client;
memset (&ds, 0, sizeof ds);
@ -2189,9 +2175,7 @@ int write_client_lease (client, lease, rewrite, makesure)
int i;
struct tm *t;
static int leases_written;
struct option_cache *oc;
struct data_string ds;
pair *hash;
int errors = 0;
char *s;
@ -2427,8 +2411,6 @@ void script_write_params (client, prefix, lease)
int i;
struct data_string data;
struct option_cache *oc;
pair *hash;
char *s, *t;
struct envadd_state es;
es.client = client;
@ -2505,11 +2487,9 @@ void script_write_params (client, prefix, lease)
int script_go (client)
struct client_state *client;
{
int rval;
char *scriptName;
char *argv [2];
char **envp;
char *epp [3];
char reason [] = "REASON=NBI";
static char client_path [] = CLIENT_PATH;
int i;
@ -2585,7 +2565,7 @@ void client_envadd (struct client_state *client,
{
char spbuf [1024];
char *s;
unsigned len, i;
unsigned len;
struct string_list *val;
va_list list;
@ -2976,7 +2956,7 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
void client_dns_update (struct client_state *client, int addp)
{
struct data_string ddns_fqdn, ddns_fwd_name,
struct data_string ddns_fwd_name,
ddns_dhcid, client_identifier;
struct option_cache *oc;
int ignorep;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: alloc.c,v 1.1.1.1 2001/08/03 11:35:31 drochner Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: alloc.c,v 1.2 2002/06/10 00:30:33 itojun Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -57,7 +57,6 @@ int option_chain_head_allocate (ptr, file, line)
const char *file;
int line;
{
int size;
struct option_chain_head *h;
if (!ptr) {
@ -118,7 +117,6 @@ int option_chain_head_dereference (ptr, file, line)
const char *file;
int line;
{
int i;
struct option_chain_head *option_chain_head;
pair car, cdr;
@ -170,7 +168,6 @@ int group_allocate (ptr, file, line)
const char *file;
int line;
{
int size;
struct group *g;
if (!ptr) {
@ -231,7 +228,6 @@ int group_dereference (ptr, file, line)
const char *file;
int line;
{
int i;
struct group *group;
if (!ptr || !*ptr) {
@ -754,7 +750,6 @@ int buffer_dereference (ptr, file, line)
const char *file;
int line;
{
struct buffer *bp;
if (!ptr) {
log_error ("%s(%d): null pointer", file, line);
@ -843,7 +838,6 @@ int dns_host_entry_dereference (ptr, file, line)
const char *file;
int line;
{
struct dns_host_entry *bp;
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
@ -1045,7 +1039,6 @@ int packet_allocate (ptr, file, line)
const char *file;
int line;
{
int size;
struct packet *p;
if (!ptr) {
@ -1165,7 +1158,6 @@ int dns_zone_allocate (ptr, file, line)
const char *file;
int line;
{
int size;
struct dns_zone *d;
if (!ptr) {

View File

@ -47,7 +47,7 @@
#ifndef lint
static char copyright[] =
"$Id: bpf.c,v 1.3 2001/08/24 15:28:47 eeh Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: bpf.c,v 1.4 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -238,9 +238,10 @@ void if_register_receive (info)
{
int flag = 1;
struct bpf_version v;
u_int32_t addr;
struct bpf_program p;
#ifdef NEED_OSF_PFILT_HACKS
u_int32_t bits;
#endif
u_int32_t len;
#if defined(DEC_FDDI) || defined(NETBSD_FDDI)
int link_layer;
@ -370,7 +371,6 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
double ip [32];
struct iovec iov [3];
int result;
int fudge;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,

View File

@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
"$Id: comapi.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: comapi.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -150,7 +150,6 @@ isc_result_t dhcp_group_set_value (omapi_object_t *h,
{
struct group_object *group;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@ -224,7 +223,6 @@ isc_result_t dhcp_group_get_value (omapi_object_t *h, omapi_object_t *id,
{
struct group_object *group;
isc_result_t status;
struct data_string ip_addrs;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@ -247,7 +245,6 @@ isc_result_t dhcp_group_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_group_destroy (omapi_object_t *h, const char *file, int line)
{
struct group_object *group, *t;
isc_result_t status;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@ -278,7 +275,7 @@ isc_result_t dhcp_group_destroy (omapi_object_t *h, const char *file, int line)
isc_result_t dhcp_group_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
struct group_object *group, *t;
struct group_object *group;
isc_result_t status;
int updatep = 0;
@ -462,7 +459,6 @@ isc_result_t dhcp_control_set_value (omapi_object_t *h,
{
dhcp_control_object_t *control;
isc_result_t status;
int foo;
unsigned long newstate;
if (h -> type != dhcp_type_control)
@ -497,7 +493,6 @@ isc_result_t dhcp_control_get_value (omapi_object_t *h, omapi_object_t *id,
{
dhcp_control_object_t *control;
isc_result_t status;
struct data_string ip_addrs;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@ -520,8 +515,6 @@ isc_result_t dhcp_control_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_control_destroy (omapi_object_t *h,
const char *file, int line)
{
dhcp_control_object_t *control, *t;
isc_result_t status;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@ -533,9 +526,8 @@ isc_result_t dhcp_control_destroy (omapi_object_t *h,
isc_result_t dhcp_control_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
dhcp_control_object_t *control, *t;
dhcp_control_object_t *control;
isc_result_t status;
int updatep = 0;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@ -591,7 +583,6 @@ isc_result_t dhcp_control_lookup (omapi_object_t **lp,
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
dhcp_control_object_t *control;
/* First see if we were sent a handle. */
if (ref) {
@ -640,7 +631,6 @@ isc_result_t dhcp_subnet_set_value (omapi_object_t *h,
{
struct subnet *subnet;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
@ -686,7 +676,6 @@ isc_result_t dhcp_subnet_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)
{
struct subnet *subnet;
isc_result_t status;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
@ -763,9 +752,6 @@ isc_result_t dhcp_subnet_lookup (omapi_object_t **lp,
omapi_object_t *id,
omapi_object_t *ref)
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
struct subnet *subnet;
/* Can't look up subnets yet. */
@ -795,7 +781,6 @@ isc_result_t dhcp_shared_network_set_value (omapi_object_t *h,
{
struct shared_network *shared_network;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
@ -843,7 +828,6 @@ isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,
const char *file, int line)
{
struct shared_network *shared_network;
isc_result_t status;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
@ -933,9 +917,6 @@ isc_result_t dhcp_shared_network_lookup (omapi_object_t **lp,
omapi_object_t *id,
omapi_object_t *ref)
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
struct shared_network *shared_network;
/* Can't look up shared_networks yet. */

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: discover.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: discover.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -144,16 +144,14 @@ isc_result_t interface_initialize (omapi_object_t *ipo,
void discover_interfaces (state)
int state;
{
struct interface_info *tmp, *ip;
struct interface_info *tmp;
struct interface_info *last, *next;
char buf [2048];
struct ifconf ic;
struct ifreq ifr;
int i;
int sock;
int address_count = 0;
struct subnet *subnet;
struct shared_network *share;
struct sockaddr_in foo;
int ir;
struct ifreq *tif;
@ -804,7 +802,6 @@ isc_result_t dhcp_interface_set_value (omapi_object_t *h,
{
struct interface_info *interface;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
@ -847,7 +844,6 @@ isc_result_t dhcp_interface_destroy (omapi_object_t *h,
const char *file, int line)
{
struct interface_info *interface;
isc_result_t status;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
@ -877,8 +873,6 @@ isc_result_t dhcp_interface_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
struct interface_info *ip, *interface;
struct client_config *config;
struct client_state *client;
isc_result_t status;
if (h -> type != dhcp_type_interface)

View File

@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: dns.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: dns.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -137,7 +137,6 @@ struct hash_table *dns_zone_hash;
isc_result_t find_tsig_key (ns_tsig_key **key, const char *zname,
struct dns_zone *zone)
{
isc_result_t status;
ns_tsig_key *tkey;
if (!zone)
@ -215,7 +214,6 @@ isc_result_t enter_dns_zone (struct dns_zone *zone)
isc_result_t dns_zone_lookup (struct dns_zone **zone, const char *name)
{
struct dns_zone *tz = (struct dns_zone *)0;
int len;
char *tname = (char *)0;
isc_result_t status;
@ -251,7 +249,6 @@ int dns_zone_dereference (ptr, file, line)
const char *file;
int line;
{
int i;
struct dns_zone *dns_zone;
if (!ptr || !*ptr) {
@ -416,9 +413,7 @@ void repudiate_zone (struct dns_zone **zone)
void cache_found_zone (ns_class class,
char *zname, struct in_addr *addrs, int naddrs)
{
isc_result_t status = ISC_R_NOTFOUND;
struct dns_zone *zone = (struct dns_zone *)0;
struct data_string nsaddrs;
int ix = strlen (zname);
if (zname [ix - 1] == '.')

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: execute.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: execute.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -63,8 +63,6 @@ int execute_statements (result, packet, lease, client_state,
struct executable_statement *r, *e, *next;
int rc;
int status;
unsigned long num;
struct binding_scope *outer;
struct binding *binding;
struct data_string ds;
struct binding_scope *ns;
@ -292,7 +290,6 @@ int execute_statements (result, packet, lease, client_state,
binding -> next = (*scope) -> bindings;
(*scope) -> bindings = binding;
} else {
badalloc:
dfree (binding, MDL);
binding = (struct binding *)0;
}
@ -533,7 +530,6 @@ int executable_statement_dereference (ptr, file, line)
const char *file;
int line;
{
struct executable_statement *bp;
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
@ -657,8 +653,6 @@ void write_statements (file, statements, indent)
int indent;
{
struct executable_statement *r, *x;
int result;
int status;
const char *s, *t, *dot;
int col;
@ -913,10 +907,8 @@ int find_matching_case (struct executable_statement **ep,
{
int status, sub;
struct executable_statement *s;
unsigned long foo;
if (is_data_expression (expr)) {
struct executable_statement *e;
struct data_string cd, ds;
memset (&ds, 0, sizeof ds);
memset (&cd, 0, sizeof cd);
@ -990,7 +982,6 @@ int executable_statement_foreach (struct executable_statement *stmt,
{
struct executable_statement *foo;
int ok = 0;
int result;
for (foo = stmt; foo; foo = foo -> next) {
if ((*callback) (foo, vp, condp) != 0)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: fddi.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: fddi.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -67,11 +67,8 @@ static char copyright[] =
#if defined (PACKET_ASSEMBLY)
/* Assemble an hardware header... */
void assemble_fddi_header (interface, buf, bufix, to)
struct interface_info *interface;
unsigned char *buf;
unsigned *bufix;
struct hardware *to;
void assemble_fddi_header (struct interface_info *interface,
unsigned char *buf, unsigned *bufix, struct hardware *to)
{
struct fddi_header fh;
struct llc lh;
@ -98,14 +95,10 @@ void assemble_fddi_header (interface, buf, bufix, to)
#ifdef PACKET_DECODING
/* Decode a hardware header... */
ssize_t decode_fddi_header (interface, buf, bufix, from)
struct interface_info *interface;
unsigned char *buf;
unsigned bufix;
struct hardware *from;
ssize_t decode_fddi_header (struct interface_info *interface,
unsigned char *buf, unsigned bufix, struct hardware *from)
{
struct fddi_header fh;
struct llc lh;
memcpy(&fh, buf + bufix, FDDI_HEADER_SIZE);

View File

@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: icmp.c,v 1.2 2002/06/02 15:17:17 itojun Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: icmp.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -70,11 +70,7 @@ void icmp_startup (routep, handler)
{
struct protoent *proto;
int protocol = 1;
struct sockaddr_in from;
int fd;
int state;
struct icmp_state *new;
omapi_object_t *h;
isc_result_t result;
/* Only initialize icmp once. */
@ -292,7 +288,6 @@ isc_result_t icmp_echoreply (h)
void trace_icmp_input_input (trace_type_t *ttype, unsigned length, char *buf)
{
struct iaddr *ia;
unsigned len;
u_int8_t *icbuf;
ia = (struct iaddr *)buf;
ia->len = ntohl(ia->len);

View File

@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: inet.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1995-1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: inet.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -121,7 +121,7 @@ struct iaddr broadcast_addr (subnet, mask)
struct iaddr subnet;
struct iaddr mask;
{
int i, j, k;
int i;
struct iaddr rv;
if (subnet.len != mask.len) {

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: memory.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: memory.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -93,8 +93,7 @@ isc_result_t delete_group (struct group_object *group, int writep)
isc_result_t supersede_group (struct group_object *group, int writep)
{
struct group_object *t, *u;
isc_result_t status;
struct group_object *t;
/* Register the group in the group name hash table,
so we can look it up later. */
@ -154,7 +153,6 @@ isc_result_t supersede_group (struct group_object *group, int writep)
int clone_group (struct group **gp, struct group *group,
const char *file, int line)
{
isc_result_t status;
struct group *g = (struct group *)0;
/* Normally gp should contain the null pointer, but for convenience

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: options.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: options.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
@ -52,16 +52,11 @@ static char copyright[] =
struct option *vendor_cfg_option;
static void do_option_set PROTO ((pair *,
struct option_cache *,
enum statement_op));
/* Parse all available options out of the specified packet. */
int parse_options (packet)
struct packet *packet;
{
int i;
struct option_cache *op = (struct option_cache *)0;
/* Allocate a new option state. */
@ -121,11 +116,8 @@ int parse_option_buffer (options, buffer, length, universe)
unsigned length;
struct universe *universe;
{
unsigned char *t;
const unsigned char *end = buffer + length;
unsigned len, offset;
int code;
struct option_cache *op = (struct option_cache *)0;
struct buffer *bp = (struct buffer *)0;
if (!buffer_allocate (&bp, length, MDL)) {
@ -265,7 +257,6 @@ int fqdn_universe_decode (struct option_state *options,
const unsigned char *buffer,
unsigned length, struct universe *u)
{
char *name;
struct buffer *bp = (struct buffer *)0;
/* FQDN options have to be at least four bytes long. */
@ -712,7 +703,6 @@ int store_options (buffer, buflen, packet, lease, client_state,
struct data_string od;
struct option_cache *oc;
unsigned code;
int optstart;
memset (&od, 0, sizeof od);
@ -764,7 +754,6 @@ int store_options (buffer, buflen, packet, lease, client_state,
encapsulation option, use the user-provided value. */
if ((u -> options [code] -> format [0] == 'E' && !oc) ||
u -> options [code] -> format [0] == 'e') {
int uix;
static char *s, *t;
struct option_cache *tmp;
struct data_string name;
@ -882,7 +871,6 @@ int store_options (buffer, buflen, packet, lease, client_state,
optstart = bufix;
while (length) {
unsigned char incr = length > 255 ? 255 : length;
int consumed = 0;
/* If this hunk of the buffer will cross a
boundary, only go up to the boundary in this
@ -1223,7 +1211,7 @@ void set_option (universe, options, option, op)
case eval_statement:
case break_statement:
default:
log_error ("bogus statement type in do_option_set.");
log_error ("bogus statement type in set_option.");
break;
case default_option_statement:
@ -1706,7 +1694,6 @@ int nwip_option_space_encapsulate (result, packet, lease, client_state,
{
pair ocp;
int status;
int i;
static struct option_cache *no_nwip;
struct data_string ds;
struct option_chain_head *head;
@ -1720,7 +1707,6 @@ int nwip_option_space_encapsulate (result, packet, lease, client_state,
status = 0;
for (ocp = head -> first; ocp; ocp = ocp -> cdr) {
struct option_cache *oc = (struct option_cache *)(ocp -> car);
if (store_option (result, universe, packet,
lease, client_state, in_options,
cfg_options, scope,
@ -1904,7 +1890,6 @@ void suboption_foreach (struct packet *packet, struct lease *lease,
{
struct universe *universe = find_option_universe (oc -> option,
vsname);
int i;
if (universe -> foreach)
(*universe -> foreach) (packet, lease, client_state,
@ -1954,7 +1939,6 @@ void save_linked_option (universe, options, oc)
struct option_cache *oc;
{
pair *tail;
pair np = (pair )0;
struct option_chain_head *head;
if (universe -> index >= options -> universe_count)
@ -2126,7 +2110,6 @@ void do_packet (interface, packet, len, from_port, from, hfrom)
struct iaddr from;
struct hardware *hfrom;
{
int i;
struct option_cache *op;
struct packet *decoded_packet;
#if defined (DEBUG_MEMORY_LEAKAGE)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: parse.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: parse.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -317,8 +317,6 @@ int parse_ip_addr (cfile, addr)
struct parse *cfile;
struct iaddr *addr;
{
const char *val;
enum dhcp_token token;
addr -> len = 4;
if (parse_numeric_aggregate (cfile, addr -> iabuf,
@ -655,7 +653,6 @@ void convert_num (cfile, buf, str, base, size)
TIME parse_date (cfile)
struct parse *cfile;
{
struct tm tm;
int guess;
int tzoff, wday, year, mon, mday, hour, min, sec;
const char *val;
@ -1027,7 +1024,6 @@ int parse_option_code_definition (cfile, option)
char tokbuf [128];
unsigned tokix = 0;
char type;
int code;
int is_signed;
char *s;
int has_encapsulation = 0;
@ -1516,7 +1512,6 @@ int parse_executable_statement (result, cfile, lose, case_context)
{
enum dhcp_token token;
const char *val;
struct executable_statement base;
struct class *cta;
struct option *option;
struct option_cache *cache;
@ -1815,7 +1810,6 @@ int parse_executable_statement (result, cfile, lose, case_context)
if (token != NAME && token != NUMBER_OR_NAME) {
parse_warn (cfile,
"%s can't be a variable name", val);
badunset:
skip_to_semi (cfile);
*lose = 1;
return 0;
@ -2778,16 +2772,12 @@ int parse_non_binary (expr, cfile, lose, context)
enum dhcp_token token;
const char *val;
struct collection *col;
struct option *option;
struct expression *nexp, **ep;
int known;
enum expr_op opcode;
const char *s;
char *cptr;
struct executable_statement *stmt;
int i;
unsigned long u;
isc_result_t status, code;
unsigned len;
token = peek_token (&val, (unsigned *)0, cfile);
@ -3275,7 +3265,6 @@ int parse_non_binary (expr, cfile, lose, context)
parse_warn
(cfile,
"expecting dns expression.");
badnstrans:
expression_dereference (expr, MDL);
*lose = 1;
return 0;
@ -3904,9 +3893,6 @@ int parse_expression (expr, cfile, lose, context, plhs, binop)
struct expression *rhs = (struct expression *)0, *tmp;
struct expression *lhs = (struct expression *)0;
enum expr_op next_op;
enum expression_context
lhs_context = context_any,
rhs_context = context_any;
/* Consume the left hand side we were passed. */
if (plhs) {
@ -4144,8 +4130,6 @@ int parse_option_statement (result, cfile, lookups, option, op)
struct expression *expr = (struct expression *)0;
struct expression *tmp;
int lose;
struct executable_statement *stmt;
int ftt = 1;
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SEMI) {
@ -4263,9 +4247,7 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups)
struct expression *t = (struct expression *)0;
unsigned char buf [4];
unsigned len;
unsigned char *ob;
struct iaddr addr;
int num;
const char *f, *g;
struct enumeration_value *e;
@ -4509,7 +4491,6 @@ int parse_option_decl (oc, cfile)
/* Set a flag if this is an array of a simple type (i.e.,
not an array of pairs of IP addresses, or something
like that. */
int uniform = option -> format [1] == 'A';
for (fmt = option -> format; *fmt; fmt++) {
if (*fmt == 'A')
@ -4706,7 +4687,6 @@ int parse_X (cfile, buf, max)
int token;
const char *val;
unsigned len;
u_int8_t *s;
token = peek_token (&val, (unsigned *)0, cfile);
if (token == NUMBER_OR_NAME || token == NUMBER) {
@ -4778,7 +4758,7 @@ int parse_warn (struct parse *cfile, const char *fmt, ...)
if (lix < (sizeof lexbuf) - 1)
lexbuf [lix++] = ' ';
if (cfile -> token_line [i] == '\t') {
for (lix;
for (/*lix*/;
lix < (sizeof lexbuf) - 1 && (lix & 7); lix++)
lexbuf [lix] = ' ';
}

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: print.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: print.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -1020,7 +1020,6 @@ int token_print_indent_concat (FILE *file, int col, int indent,
const char *suffix, ...)
{
va_list list;
char *buf;
unsigned len;
char *s, *t, *u;
@ -1058,7 +1057,6 @@ int token_indent_data_string (FILE *file, int col, int indent,
struct data_string *data)
{
int i;
char *buf;
char obuf [3];
/* See if this is just ASCII. */

View File

@ -56,7 +56,7 @@
#ifndef lint
static char copyright[] =
"$Id: raw.c,v 1.1.1.1 2001/08/03 11:35:33 drochner Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: raw.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -74,10 +74,10 @@ void if_register_send (info)
int flag;
/* Set up the address we're going to connect to. */
memset (&name, 0, sizeof (name));
name.sin_family = AF_INET;
name.sin_port = local_port;
name.sin_addr.s_addr = htonl (INADDR_BROADCAST);
memset (name.sin_zero, 0, sizeof (name.sin_zero));
/* List addresses on which we're listening. */
if (!quiet_interface_discovery)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: resolv.c,v 1.1.1.1 2001/08/03 11:35:33 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: resolv.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -59,10 +59,8 @@ void read_resolv_conf (parse_time)
struct parse *cfile;
const char *val;
int token;
int declaration = 0;
struct name_server *sp, *sl, *ns;
struct domain_search_list *dp, *dl, *nd;
struct iaddr *iaddr;
if ((file = open (path_resolv_conf, O_RDONLY)) < 0) {
log_error ("Can't open %s: %m", path_resolv_conf);
@ -134,6 +132,7 @@ void read_resolv_conf (parse_time)
piaddr (iaddr));
ns -> next = (struct name_server *)0;
*sp = ns;
memset (&ns->addr, 0, sizeof ns->addr);
memcpy (&ns -> addr.sin_addr,
iaddr.iabuf, iaddr.len);
#ifdef HAVE_SA_LEN
@ -141,8 +140,6 @@ void read_resolv_conf (parse_time)
#endif
ns -> addr.sin_family = AF_INET;
ns -> addr.sin_port = htons (53);
memset (ns -> addr.sin_zero, 0,
sizeof ns -> addr.sin_zero);
}
ns -> rcdate = parse_time;
skip_to_semi (cfile);
@ -189,7 +186,6 @@ void read_resolv_conf (parse_time)
struct name_server *first_name_server ()
{
FILE *rc;
static TIME rcdate;
struct stat st;
@ -200,8 +196,6 @@ struct name_server *first_name_server ()
return (struct name_server *)0;
}
if (st.st_mtime > rcdate) {
char rcbuf [512];
char *s, *t, *u;
rcdate = cur_time + 1;
read_resolv_conf (rcdate);

View File

@ -51,7 +51,7 @@
#ifndef lint
static char copyright[] =
"$Id: socket.c,v 1.2 2002/06/02 15:17:18 itojun Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: socket.c,v 1.3 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -64,7 +64,13 @@ static char copyright[] =
# endif
#endif
#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)
#if 0
#ifndef USE_SOCKET_RECEIVE
static int once = 0;
#endif
#endif
#endif
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: tree.c,v 1.1.1.1 2001/08/03 11:35:34 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: tree.c,v 1.2 2002/06/10 00:30:34 itojun Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -257,7 +257,6 @@ int make_limit (new, expr, limit)
struct expression *expr;
int limit;
{
struct expression *rv;
/* Allocate a node to enforce a limit on evaluation. */
if (!expression_allocate (new, MDL))
@ -652,11 +651,10 @@ int evaluate_dns_expression (result, packet, lease, client_state, in_options,
struct binding_scope **scope;
struct expression *expr;
{
ns_updrec *foo;
unsigned long ttl = 0;
char *tname;
struct data_string name, data;
int r0, r1, r2, r3;
int r0, r1, r2;
if (!result || *result) {
log_error ("evaluate_dns_expression called with non-null %s",
@ -906,10 +904,7 @@ int evaluate_boolean_expression (result, packet, lease, client_state,
struct binding_scope **scope;
struct expression *expr;
{
struct data_string left, right;
struct data_string rrtype, rrname, rrdata;
unsigned long ttl;
int srrtype, srrname, srrdata, sttl;
struct data_string left;
int bleft, bright;
int sleft, sright;
struct binding *binding;
@ -1278,11 +1273,10 @@ int evaluate_data_expression (result, packet, lease, client_state,
int line;
{
struct data_string data, other;
unsigned long offset, len, i;
unsigned long offset, len;
int s0, s1, s2, s3;
int status;
struct binding *binding;
char *s;
struct binding_value *bv;
switch (expr -> op) {
@ -1828,7 +1822,6 @@ int evaluate_data_expression (result, packet, lease, client_state,
MDL);
if (s0 && s1) {
char *upper;
int i;
/* The buffer must be a multiple of the number's
@ -3125,7 +3118,6 @@ static int op_val (op)
int op_precedence (op1, op2)
enum expr_op op1, op2;
{
int ov1, ov2;
return op_val (op1) - op_val (op2);
}
@ -3740,7 +3732,6 @@ int binding_scope_dereference (ptr, file, line)
const char *file;
int line;
{
int i;
struct binding_scope *binding_scope;
if (!ptr || !*ptr) {

View File

@ -63,7 +63,6 @@ dhcpctl_status dhcpctl_set_callback (dhcpctl_handle h, void *data,
{
dhcpctl_callback_object_t *callback;
omapi_object_t *inner;
isc_result_t status;
callback = dmalloc (sizeof *callback, MDL);
if (!callback)
@ -166,7 +165,6 @@ isc_result_t dhcpctl_callback_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *p)
{
int i;
if (p -> type != dhcpctl_callback_type)
return ISC_R_INVALIDARG;

View File

@ -104,7 +104,6 @@ dhcpctl_status dhcpctl_connect (dhcpctl_handle *connection,
dhcpctl_handle authinfo)
{
isc_result_t status;
dhcpctl_status waitstatus;
status = omapi_generic_new (connection, MDL);
if (status != ISC_R_SUCCESS) {
@ -174,7 +173,6 @@ dhcpctl_status dhcpctl_get_value (dhcpctl_data_string *result,
{
isc_result_t status;
omapi_value_t *tv = (omapi_value_t *)0;
omapi_data_string_t *value = (omapi_data_string_t *)0;
unsigned len;
int ip;
@ -266,7 +264,6 @@ dhcpctl_status dhcpctl_set_value (dhcpctl_handle h, dhcpctl_data_string value,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@ -300,7 +297,6 @@ dhcpctl_status dhcpctl_set_string_value (dhcpctl_handle h, const char *value,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@ -389,7 +385,6 @@ dhcpctl_status dhcpctl_set_boolean_value (dhcpctl_handle h, int value,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@ -419,7 +414,6 @@ dhcpctl_status dhcpctl_set_int_value (dhcpctl_handle h, int value,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)

View File

@ -86,11 +86,9 @@ int main (int argc, char **argv, char **envp)
dhcpctl_handle connection;
dhcpctl_handle authenticator;
dhcpctl_handle oh;
dhcpctl_data_string cid, ip_addr;
dhcpctl_data_string result, groupname, identifier;
struct data_string secret;
const char *name = 0, *algorithm = "hmac-md5";
int i, j;
int i;
int port = 7911;
const char *server = "127.0.0.1";
struct parse *cfile;

View File

@ -348,7 +348,6 @@ isc_result_t dhcpctl_remote_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *p)
{
int i;
if (p -> type != dhcpctl_remote_type)
return ISC_R_INVALIDARG;

View File

@ -1,5 +1,5 @@
#ifndef LINT
static const char rcsid[] = "$Header: /cvsroot/src/dist/dhcp/dst/Attic/prandom.c,v 1.1.1.1 2001/08/03 11:35:34 drochner Exp $";
static const char rcsid[] = "$Header: /cvsroot/src/dist/dhcp/dst/Attic/prandom.c,v 1.2 2002/06/10 00:30:35 itojun Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@ -335,7 +335,7 @@ unix_cmd(dst_work *work)
cnt += do_time(work);
}
while ((n = fread(buffer, sizeof(char), sizeof(buffer), pipe)) > 0)
NULL; /* drain the pipe */
; /* drain the pipe */
pclose(pipe);
return (cnt); /* read how many bytes where read in */
}

View File

@ -2007,6 +2007,14 @@ int icmp_readsocket PROTO ((omapi_object_t *));
int icmp_echorequest PROTO ((struct iaddr *));
isc_result_t icmp_echoreply PROTO ((omapi_object_t *));
/* fddi.c */
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
void assemble_fddi_header (struct interface_info *,
unsigned char *, unsigned *, struct hardware *);
ssize_t decode_fddi_header (struct interface_info *,
unsigned char *, unsigned, struct hardware *);
#endif /* PACKET_ASSEMBLY || PACKET_DECODING */
/* dns.c */
#if defined (NSUPDATE)
isc_result_t find_tsig_key (ns_tsig_key **, const char *, struct dns_zone *);

View File

@ -21,7 +21,7 @@
*/
#if !defined(lint) && !defined(SABER)
static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.1.1 2001/08/03 11:35:36 drochner Exp $";
static const char rcsid[] = "$Id: res_mkupdate.c,v 1.2 2002/06/10 00:30:35 itojun Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -48,7 +48,9 @@ static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.1.1 2001/08/03 11:35:36 d
#define MAXPORT 1024
static int getnum_str(const u_char **, const u_char *);
#if 0
static int gethexnum_str(const u_char **, const u_char *);
#endif
static int getword_str(char *, int,
const unsigned char **,
const unsigned char *);
@ -96,12 +98,16 @@ res_nmkupdate(res_state statp,
ns_updrec *rrecp;
struct in_addr ina;
char buf2[MAXDNAME];
#if 0
u_char buf3[MAXDNAME];
#endif
int section, numrrs = 0, counts[ns_s_max];
u_int16_t rtype, rclass;
u_int32_t n1, rttl;
u_char *dnptrs[20], **dpp, **lastdnptr;
#if 0
unsigned siglen, keylen, certlen;
#endif
unsigned buflen = *blp;
u_char *buf = (unsigned char *)bp;
@ -767,6 +773,7 @@ getstr_str(char *buf, int size, const u_char **startpp, const u_char *endp) {
*cp = '\0';
return ((cp == buf)? (seen_quote? 0: -1): (cp - buf));
}
#if 0
/*
* Get a whitespace delimited base 16 number from a string (not file) into buf
* update the start pointer to point after the number in the string.
@ -815,6 +822,7 @@ gethexnum_str(const u_char **startpp, const u_char *endp) {
}
return (n + m);
}
#endif
/*
* Get a whitespace delimited base 16 number from a string (not file) into buf

View File

@ -1,5 +1,5 @@
#if !defined(lint) && !defined(SABER)
static const char rcsid[] = "$Id: res_update.c,v 1.1.1.1 2001/08/03 11:35:36 drochner Exp $";
static const char rcsid[] = "$Id: res_update.c,v 1.2 2002/06/10 00:30:35 itojun Exp $";
#endif /* not lint */
/*
@ -82,7 +82,7 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in) {
double answer[PACKETSZ / sizeof (double)];
double packet[2*PACKETSZ / sizeof (double)];
struct zonegrp *zptr, tgrp;
int nzones = 0, nscount = 0;
int nscount = 0;
unsigned n;
unsigned rval;
struct sockaddr_in nsaddrs[MAXNS];

View File

@ -69,10 +69,10 @@ VOIDPTR dmalloc (size, file, line)
int line;
{
unsigned char *foo = malloc (size + DMDSIZE);
int i;
VOIDPTR *bar;
#if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
int i;
struct dmalloc_preamble *dp;
#endif
if (!foo)

View File

@ -50,7 +50,6 @@ isc_result_t omapi_array_allocate (omapi_array_t **array,
omapi_array_deref_t deref,
const char *file, int line)
{
isc_result_t status;
omapi_array_t *aptr;
if (!array || *array)
@ -67,7 +66,6 @@ isc_result_t omapi_array_allocate (omapi_array_t **array,
isc_result_t omapi_array_free (omapi_array_t **array,
const char *file, int line)
{
isc_result_t status;
omapi_array_t *aptr;
int i;

View File

@ -451,7 +451,6 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
int bytes_written;
unsigned first_byte;
omapi_buffer_t *buffer;
unsigned char *bufp;
omapi_connection_object_t *c;
isc_result_t status;
@ -588,7 +587,6 @@ isc_result_t omapi_connection_put_uint32 (omapi_object_t *c,
u_int32_t value)
{
u_int32_t inbuf;
isc_result_t status;
inbuf = htonl (value);
@ -615,7 +613,6 @@ isc_result_t omapi_connection_put_uint16 (omapi_object_t *c,
u_int32_t value)
{
u_int16_t inbuf;
isc_result_t status;
inbuf = htons (value);

View File

@ -120,10 +120,6 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
omapi_connection_object_t *obj;
int flag;
struct sockaddr_in local_sin;
#if defined (TRACING)
trace_addr_t *addrs;
u_int16_t naddrs;
#endif
obj = (omapi_connection_object_t *)0;
status = omapi_connection_allocate (&obj, MDL);
@ -170,6 +166,7 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
omapi_connection_dereference (&obj, MDL);
return ISC_R_INVALIDARG;
}
memset (&local_sin, 0, sizeof local_sin);
local_sin.sin_port = htons (local_addr -> port);
memcpy (&local_sin.sin_addr,
local_addr -> address,
@ -178,8 +175,6 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
local_sin.sin_len = sizeof local_addr;
#endif
local_sin.sin_family = AF_INET;
memset (&local_sin.sin_zero, 0,
sizeof local_sin.sin_zero);
if (bind (obj -> socket, (struct sockaddr *)&local_sin,
sizeof local_sin) < 0) {
@ -618,6 +613,7 @@ static isc_result_t omapi_connection_connect_internal (omapi_object_t *h)
return ISC_R_INVALIDARG;
}
memset (&c->remote_addr, 0, sizeof c->remote_addr);
memcpy (&c -> remote_addr.sin_addr,
&c -> connect_list -> addresses [c -> cptr].address,
sizeof c -> remote_addr.sin_addr);
@ -627,8 +623,6 @@ static isc_result_t omapi_connection_connect_internal (omapi_object_t *h)
#if defined (HAVE_SA_LEN)
c -> remote_addr.sin_len = sizeof c -> remote_addr;
#endif
memset (&c -> remote_addr.sin_zero, 0,
sizeof c -> remote_addr.sin_zero);
++c -> cptr;
error = connect (c -> socket,
@ -1014,7 +1008,6 @@ isc_result_t omapi_connection_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *m)
{
int i;
if (m -> type != omapi_type_connection)
return ISC_R_INVALIDARG;

View File

@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: convert.c,v 1.2 2002/02/17 20:18:52 martin Exp $ Copyright (c) 1996-1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: convert.c,v 1.3 2002/06/10 00:30:36 itojun Exp $ Copyright (c) 1996-1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include <omapip/omapip_p.h>
@ -172,7 +172,7 @@ int binary_to_ascii (outbuf, inbuf, base, width)
u_int32_t number;
static char h2a [] = "0123456789abcdef";
int power = converted_length (inbuf, base, width);
int i, j;
int i;
if (base > 16)
return 0;

View File

@ -294,7 +294,6 @@ isc_result_t omapi_generic_stuff_values (omapi_object_t *c,
isc_result_t omapi_generic_clear_flags (omapi_object_t *o)
{
int i;
isc_result_t status;
omapi_generic_object_t *g;
if (o -> type != omapi_type_generic)

View File

@ -80,7 +80,6 @@ static isc_result_t omapi_handle_table_enclose (omapi_handle_table_t **);
isc_result_t omapi_object_handle (omapi_handle_t *h, omapi_object_t *o)
{
int tabix;
isc_result_t status;
if (o -> handle) {
@ -289,7 +288,6 @@ static isc_result_t omapi_handle_lookup_in (omapi_object_t **o,
isc_result_t omapi_handle_td_lookup (omapi_object_t **obj,
omapi_typed_data_t *handle)
{
isc_result_t status;
omapi_handle_t h;
if (handle -> type == omapi_datatype_int)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: hash.c,v 1.1.1.1 2001/08/03 11:35:37 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: hash.c,v 1.2 2002/06/10 00:30:36 itojun Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include <omapip/omapip_p.h>
@ -72,11 +72,11 @@ void free_hash_table (ptr, file, line)
const char *file;
int line;
{
#if defined (DEBUG_MEMORY_LEAKAGE) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
int i;
struct hash_bucket *hbc, *hbn = (struct hash_bucket *)0;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
for (i = 0; i < ptr -> hash_count; i++) {
for (hbc = ptr -> buckets [i]; hbc; hbc = hbn) {
hbn = hbc -> next;
@ -164,8 +164,9 @@ void free_hash_bucket (ptr, file, line)
const char *file;
int line;
{
struct hash_bucket *hp;
#if defined (DEBUG_MALLOC_POOL)
struct hash_bucket *hp;
for (hp = free_hash_buckets; hp; hp = hp -> next) {
if (hp == ptr) {
log_error ("hash bucket freed twice!");

View File

@ -77,12 +77,9 @@ isc_result_t omapi_listen_addr (omapi_object_t *h,
omapi_addr_t *addr,
int max)
{
struct hostent *he;
int hix;
isc_result_t status;
omapi_listener_object_t *obj;
int i;
struct in_addr ia;
/* Get the handle. */
obj = (omapi_listener_object_t *)0;
@ -108,6 +105,7 @@ isc_result_t omapi_listen_addr (omapi_object_t *h,
return ISC_R_INVALIDARG;
/* Set up the address on which we will listen... */
memset (&obj -> address, 0, sizeof obj -> address);
obj -> address.sin_port = htons (addr -> port);
memcpy (&obj -> address.sin_addr,
addr -> address, sizeof obj -> address.sin_addr);
@ -116,8 +114,6 @@ isc_result_t omapi_listen_addr (omapi_object_t *h,
sizeof (struct sockaddr_in);
#endif
obj -> address.sin_family = AF_INET;
memset (&(obj -> address.sin_zero), 0,
sizeof obj -> address.sin_zero);
#if defined (TRACING)
/* If we're playing back a trace file, we remember the object
@ -209,8 +205,6 @@ isc_result_t omapi_accept (omapi_object_t *h)
SOCKLEN_T len;
omapi_connection_object_t *obj;
omapi_listener_object_t *listener;
omapi_addr_t remote_addr;
int i;
struct sockaddr_in addr;
int socket;
@ -232,7 +226,6 @@ isc_result_t omapi_accept (omapi_object_t *h)
/* If we're recording a trace, remember the connection. */
if (trace_record ()) {
trace_iov_t iov [3];
u_int32_t lsock;
iov [0].buf = (char *)&addr.sin_port;
iov [0].len = sizeof addr.sin_port;
iov [1].buf = (char *)&addr.sin_addr;
@ -464,7 +457,6 @@ isc_result_t omapi_listener_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *l)
{
int i;
if (l -> type != omapi_type_listener)
return ISC_R_INVALIDARG;

View File

@ -218,7 +218,6 @@ isc_result_t omapi_message_get_value (omapi_object_t *h,
isc_result_t omapi_message_destroy (omapi_object_t *h,
const char *file, int line)
{
int i;
omapi_message_object_t *m;
if (h -> type != omapi_type_message)
@ -270,7 +269,6 @@ isc_result_t omapi_message_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *m)
{
int i;
if (m -> type != omapi_type_message)
return ISC_R_INVALIDARG;

View File

@ -94,7 +94,6 @@ void trace_mr_statp_setup (res_state statp)
unsigned buflen = 0;
char *buf = (char *)0;
isc_result_t status;
u_int32_t id;
int i;
if (trace_playback ()) {
@ -118,8 +117,8 @@ void trace_mr_statp_setup (res_state statp)
statp -> nsaddr_list [i].sin_len =
sizeof (struct sockaddr_in);
#endif
memset (&statp -> nsaddr_list [i].sin_zero, 0,
sizeof statp -> nsaddr_list [i].sin_zero);
memset (&statp -> nsaddr_list [i], 0,
sizeof statp -> nsaddr_list [i]);
statp -> nsaddr_list [i].sin_port = htons (53); /*XXX*/
statp -> nsaddr_list [i].sin_family = AF_INET;
memcpy (&statp -> nsaddr_list [i].sin_addr,
@ -232,6 +231,8 @@ ssize_t trace_mr_read_playback (struct sockaddr_in *from,
dfree (inbuf, MDL);
return -1;
}
if (from)
memset (from, 0, sizeof *from);
if (from)
memcpy (&from -> sin_addr, bufp,
sizeof from -> sin_addr);
@ -247,7 +248,6 @@ ssize_t trace_mr_read_playback (struct sockaddr_in *from,
#if defined(HAVE_SA_LEN)
from -> sin_len = sizeof (struct sockaddr_in);
#endif
memset (from -> sin_zero, 0, sizeof from -> sin_zero);
}
if (left > nbytes) {
log_error ("trace_mr_recvfrom: too much%s",
@ -421,7 +421,6 @@ unsigned int trace_mr_res_randomid (unsigned int oldid)
isc_result_t status;
if (trace_playback ()) {
int nscount;
status = trace_get_packet (&trace_mr_randomid, &buflen, &buf);
if (status != ISC_R_SUCCESS) {
log_error ("trace_mr_statp: no statp packet found.");

View File

@ -163,7 +163,6 @@ isc_result_t omapi_protocol_send_message (omapi_object_t *po,
omapi_remote_auth_t *ra;
omapi_value_t *signature;
isc_result_t status;
u_int32_t foo;
unsigned auth_len;
if (po -> type != omapi_type_protocol ||
@ -940,7 +939,6 @@ isc_result_t omapi_protocol_stuff_values (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *p)
{
int i;
if (p -> type != omapi_type_protocol)
return ISC_R_INVALIDARG;
@ -1128,7 +1126,6 @@ isc_result_t omapi_protocol_listener_stuff (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *p)
{
int i;
if (p -> type != omapi_type_protocol_listener)
return ISC_R_INVALIDARG;

View File

@ -57,7 +57,6 @@ omapi_object_type_t *omapi_type_auth_key;
omapi_object_type_t *omapi_object_types;
int omapi_object_type_count;
static int ot_max;
#if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
void omapi_type_relinquish ()
@ -303,7 +302,6 @@ isc_result_t omapi_signal (omapi_object_t *handle, const char *name, ...)
isc_result_t omapi_signal_in (omapi_object_t *handle, const char *name, ...)
{
va_list ap;
omapi_object_t *outer;
isc_result_t status;
if (!handle)
@ -373,7 +371,6 @@ isc_result_t omapi_set_value_str (omapi_object_t *h,
const char *name,
omapi_typed_data_t *value)
{
omapi_object_t *outer;
omapi_data_string_t *nds;
isc_result_t status;
@ -394,8 +391,6 @@ isc_result_t omapi_set_boolean_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *n = (omapi_data_string_t *)0;
int len;
int ip;
status = omapi_data_string_new (&n, strlen (name), MDL);
if (status != ISC_R_SUCCESS)
@ -420,8 +415,6 @@ isc_result_t omapi_set_int_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *n = (omapi_data_string_t *)0;
int len;
int ip;
status = omapi_data_string_new (&n, strlen (name), MDL);
if (status != ISC_R_SUCCESS)
@ -446,8 +439,6 @@ isc_result_t omapi_set_object_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *n = (omapi_data_string_t *)0;
int len;
int ip;
status = omapi_data_string_new (&n, strlen (name), MDL);
if (status != ISC_R_SUCCESS)
@ -472,8 +463,6 @@ isc_result_t omapi_set_string_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *n = (omapi_data_string_t *)0;
int len;
int ip;
status = omapi_data_string_new (&n, strlen (name), MDL);
if (status != ISC_R_SUCCESS)

View File

@ -316,7 +316,7 @@ trace_type_t *trace_type_register (const char *name,
void (*stop_tracing) (trace_type_t *),
const char *file, int line)
{
trace_type_t *ttmp, *tptr;
trace_type_t *ttmp;
unsigned slen = strlen (name);
isc_result_t status;
@ -515,7 +515,6 @@ isc_result_t trace_get_next_packet (trace_type_t **ttp,
trace_type_t *ttype;
unsigned paylen;
int status;
int len;
fpos_t curpos;
status = fgetpos (traceinfile, &curpos);
@ -641,7 +640,6 @@ time_t trace_snoop_time (trace_type_t **ptp)
unsigned bufmax = 0;
unsigned buflen = 0;
char *buf = (char *)0;
isc_result_t status;
time_t result;
trace_type_t *ttp;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhcrelay.c,v 1.2 2001/08/03 13:39:05 drochner Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n";
"$Id: dhcrelay.c,v 1.3 2002/06/10 00:30:36 itojun Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -700,7 +700,7 @@ int add_relay_agent_options (ip, packet, length, giaddr)
unsigned length;
struct in_addr giaddr;
{
int is_dhcp = 0, agent_options_present = 0;
int is_dhcp = 0;
u_int8_t *op, *sp, *max, *end_pad = 0;
/* If we're not adding agent options to packets, we can skip

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: bootp.c,v 1.1.1.1 2001/08/03 11:35:40 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: bootp.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -366,11 +366,11 @@ void bootp (packet)
: packet -> interface -> name);
/* Set up the parts of the address that are in common. */
memset (&to, 0, sizeof to);
to.sin_family = AF_INET;
#ifdef HAVE_SA_LEN
to.sin_len = sizeof to;
#endif
memset (to.sin_zero, 0, sizeof to.sin_zero);
/* If this was gatewayed, send it back to the gateway... */
if (raw.giaddr.s_addr) {

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: confpars.c,v 1.1.1.1 2001/08/03 11:35:41 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: confpars.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -337,15 +337,12 @@ int parse_statement (cfile, group, type, host_decl, declaration)
enum dhcp_token token;
const char *val;
struct shared_network *share;
char *t, *n;
struct expression *expr;
struct data_string data;
char *n;
struct hardware hardware;
struct executable_statement *et, *ep;
struct option *option;
struct option_cache *cache;
int lose;
struct data_string key_id;
int known;
isc_result_t status;
@ -912,7 +909,6 @@ void parse_failover_peer (cfile, group, type)
"load balance settings.");
if (token != NUMBER) {
parse_warn (cfile, "expecting number");
badsplit:
skip_to_rbrace (cfile, 1);
dhcp_failover_state_dereference (&peer, MDL);
return;
@ -1693,7 +1689,6 @@ int parse_class_declaration (cp, cfile, group, type)
char *name;
const char *tname;
struct executable_statement *stmt = (struct executable_statement *)0;
struct expression *expr;
int new = 1;
isc_result_t status;
@ -2106,7 +2101,6 @@ void parse_subnet_declaration (cfile, share)
unsigned char addr [4];
unsigned len = sizeof addr;
int declaration = 0;
struct interface_info *ip;
isc_result_t status;
subnet = (struct subnet *)0;
@ -2396,8 +2390,6 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
char tbuf [32];
struct lease *lease;
struct executable_statement *on;
struct expression *exp;
struct data_string ds;
int lose;
TIME t;
char *s;
@ -2813,7 +2805,6 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
unsigned char *tuid;
token = next_token (&val, &buflen, cfile);
binding -> value -> type = binding_data;
binding -> value -> value.data.len = buflen;
@ -2969,7 +2960,6 @@ void parse_address_range (cfile, group, type, inpool)
int dynamic = 0;
struct subnet *subnet;
struct shared_network *share;
struct pool *p;
struct pool *pool;
isc_result_t status;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: db.c,v 1.1.1.1 2001/08/03 11:35:41 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: db.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -65,7 +65,6 @@ int write_lease (lease)
struct tm *t;
char tbuf [64];
int errors = 0;
int i;
struct binding *b;
char *s;
@ -184,7 +183,6 @@ int write_lease (lease)
}
}
if (lease -> uid_len) {
int i;
s = quotify_buf (lease -> uid, lease -> uid_len, MDL);
if (s) {
fprintf (db_file, "\n uid \"%s\";", s);
@ -456,7 +454,6 @@ int write_group (group)
struct group_object *group;
{
int errors = 0;
int i;
/* If the lease file is corrupt, don't try to write any more leases
until we've written a good lease file. */
@ -614,8 +611,6 @@ void write_billing_classes ()
{
struct collection *lp;
struct class *cp;
struct hash_bucket *bp;
int i;
for (lp = collections; lp; lp = lp -> next) {
for (cp = lp -> classes; cp; cp = cp -> nic) {

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: ddns.c,v 1.1.1.1 2001/08/03 11:35:41 drochner Exp $ Copyright (c) 2000-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: ddns.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 2000-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -200,7 +200,6 @@ int ddns_updates (struct packet *packet,
struct data_string ddns_fwd_name;
struct data_string ddns_rev_name;
struct data_string ddns_dhcid;
unsigned len;
struct data_string d1;
struct option_cache *oc;
int s1, s2;
@ -599,7 +598,6 @@ int ddns_removals (struct lease *lease)
struct data_string ddns_rev_name;
struct data_string ddns_dhcid;
isc_result_t rcode;
struct binding *binding;
int result = 0;
int client_updated = 0;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: dhcp.c,v 1.1.1.1 2001/08/03 11:35:41 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: dhcp.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -407,7 +407,6 @@ void dhcprequest (packet, ms_nulltp, ip_lease)
int ours = 0;
struct option_cache *oc;
struct data_string data;
int status;
char msgbuf [1024]; /* XXX */
char *s;
char smbuf [19];
@ -892,14 +891,13 @@ void dhcpinform (packet, ms_nulltp)
char msgbuf [1024];
struct data_string d1, prl;
struct option_cache *oc;
struct expression *expr;
struct option_state *options = (struct option_state *)0;
struct dhcp_packet raw;
struct packet outgoing;
unsigned char dhcpack = DHCPACK;
struct subnet *subnet = (struct subnet *)0;
struct iaddr cip;
unsigned i, j;
unsigned i;
int nulltp;
struct sockaddr_in to;
struct in_addr from;
@ -1202,11 +1200,11 @@ void dhcpinform (packet, ms_nulltp)
#endif
/* Set up the common stuff... */
memset (&to, 0, sizeof to);
to.sin_family = AF_INET;
#ifdef HAVE_SA_LEN
to.sin_len = sizeof to;
#endif
memset (to.sin_zero, 0, sizeof to.sin_zero);
/* Use the IP address we derived for the client. */
memcpy (&to.sin_addr, cip.iabuf, 4);
@ -1235,7 +1233,6 @@ void nak_lease (packet, cip)
unsigned i;
struct data_string data;
struct option_state *options = (struct option_state *)0;
struct expression *expr;
struct option_cache *oc = (struct option_cache *)0;
struct iaddr myfrom;
@ -1369,11 +1366,11 @@ void nak_lease (packet, cip)
#endif
/* Set up the common stuff... */
memset (&to, 0, sizeof to);
to.sin_family = AF_INET;
#ifdef HAVE_SA_LEN
to.sin_len = sizeof to;
#endif
memset (to.sin_zero, 0, sizeof to.sin_zero);
memcpy (&from, myfrom.iabuf, sizeof from);
@ -1426,14 +1423,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp)
TIME max_lease_time;
TIME default_lease_time;
struct option_cache *oc;
struct expression *expr;
int status;
isc_result_t result;
int did_ping = 0;
unsigned i, j;
int s1, s2;
int val;
int s1;
int ignorep;
/* If we're already acking this lease, don't do it again. */
@ -2576,12 +2568,9 @@ void dhcp_reply (lease)
struct in_addr from;
struct hardware hto;
int result;
int i;
struct lease_state *state = lease -> state;
int nulltp, bootpp, unicastp = 1;
struct option_tag *ot, *not;
struct data_string d1;
struct option_cache *oc;
char *s;
if (!state)
@ -2683,11 +2672,11 @@ void dhcp_reply (lease)
hto.hlen = lease -> hardware_addr.hlen;
memcpy (hto.hbuf, lease -> hardware_addr.hbuf, hto.hlen);
memset(&to, 0, sizeof(to));
to.sin_family = AF_INET;
#ifdef HAVE_SA_LEN
to.sin_len = sizeof to;
#endif
memset (to.sin_zero, 0, sizeof to.sin_zero);
#ifdef DEBUG_PACKET
dump_raw ((unsigned char *)&raw, packet_length);
@ -2799,7 +2788,6 @@ int find_lease (struct lease **lp,
struct data_string d1;
int have_client_identifier = 0;
struct data_string client_identifier;
int status;
struct hardware h;
if (packet -> raw -> ciaddr.s_addr) {
@ -3447,7 +3435,6 @@ int mockup_lease (struct lease **lp, struct packet *packet,
struct shared_network *share, struct host_decl *hp)
{
struct lease *lease = (struct lease *)0;
const unsigned char **s;
isc_result_t status;
struct host_decl *rhp = (struct host_decl *)0;
@ -3495,8 +3482,6 @@ int allocate_lease (struct lease **lp, struct packet *packet,
struct pool *pool, int *peer_has_leases)
{
struct lease *lease = (struct lease *)0;
struct lease **lq;
struct permit *permit;
if (!pool)
return 0;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhcpd.c,v 1.1.1.1 2001/08/03 11:35:41 drochner Exp $ Copyright 1995-2001 Internet Software Consortium.";
"$Id: dhcpd.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright 1995-2001 Internet Software Consortium.";
#endif
static char copyright[] =
@ -226,9 +226,6 @@ int main (argc, argv, envp)
struct interface_info *ip;
struct parse *parse;
int lose;
omapi_object_t *auth;
struct tsig_key *key;
omapi_typed_data_t *td;
int no_dhcpd_conf = 0;
int no_dhcpd_db = 0;
int no_dhcpd_pid = 0;
@ -979,7 +976,6 @@ int dhcpd_interface_setup_hook (struct interface_info *ip, struct iaddr *ia)
necessary. */
if (!ia) {
const char *fnn = "fallback-net";
char *s;
status = shared_network_allocate (&ip -> shared_network, MDL);
if (status != ISC_R_SUCCESS)
log_fatal ("No memory for shared subnet: %s",

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: failover.c,v 1.3 2002/03/18 20:31:02 bjh21 Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: failover.c,v 1.4 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -51,7 +51,6 @@ static char copyright[] =
#include <omapip/omapip_p.h>
#if defined (FAILOVER_PROTOCOL)
static struct hash_table *failover_hash;
dhcp_failover_state_t *failover_states;
static isc_result_t do_a_failover_option (omapi_object_t *,
dhcp_failover_link_t *);
@ -67,7 +66,6 @@ void dhcp_failover_startup ()
{
dhcp_failover_state_t *state;
isc_result_t status;
dhcp_failover_listener_t *l;
for (state = failover_states; state; state = state -> next) {
dhcp_failover_state_transition (state, "startup");
@ -175,7 +173,6 @@ isc_result_t dhcp_failover_link_initiate (omapi_object_t *h)
{
isc_result_t status;
dhcp_failover_link_t *obj;
omapi_value_t *value = (omapi_value_t *)0;
dhcp_failover_state_t *state;
omapi_object_t *o;
int i;
@ -277,8 +274,6 @@ isc_result_t dhcp_failover_link_signal (omapi_object_t *h,
isc_result_t status;
dhcp_failover_link_t *link;
omapi_object_t *c;
u_int16_t nlen;
u_int32_t vlen;
dhcp_failover_state_t *s, *state = (dhcp_failover_state_t *)0;
if (h -> type != dhcp_type_failover_link) {
@ -562,7 +557,6 @@ static isc_result_t do_a_failover_option (c, link)
unsigned op_size;
unsigned op_count;
int i;
isc_result_t status;
if (link -> imsg_count + 2 > link -> imsg_len) {
log_error ("FAILOVER: message overflow at option code.");
@ -1094,7 +1088,6 @@ isc_result_t dhcp_failover_listener_stuff (omapi_object_t *c,
omapi_object_t *id,
omapi_object_t *p)
{
int i;
if (p -> type != dhcp_type_failover_listener)
return ISC_R_INVALIDARG;
@ -1155,11 +1148,8 @@ isc_result_t dhcp_failover_state_signal (omapi_object_t *o,
const char *name, va_list ap)
{
isc_result_t status;
omapi_connection_object_t *c;
omapi_protocol_object_t *obj;
dhcp_failover_state_t *state;
dhcp_failover_link_t *link;
char *peer_name;
if (!o || o -> type != dhcp_type_failover_state)
return ISC_R_INVALIDARG;
@ -1791,7 +1781,6 @@ isc_result_t dhcp_failover_peer_state_changed (dhcp_failover_state_t *state,
enum failover_state previous_state = state -> partner.state;
enum failover_state new_state;
int startupp;
isc_result_t status;
new_state = msg -> server_state;
startupp = (msg -> server_flags & FTF_STARTUP) ? 1 : 0;
@ -2137,7 +2126,6 @@ int dhcp_failover_pool_rebalance (dhcp_failover_state_t *state)
struct lease *next = (struct lease *)0;
struct shared_network *s;
struct pool *p;
int polarity;
binding_state_t peer_lease_state;
binding_state_t my_lease_state;
struct lease **lq;
@ -2220,7 +2208,6 @@ int dhcp_failover_pool_rebalance (dhcp_failover_state_t *state)
int dhcp_failover_pool_check (struct pool *pool)
{
int lts;
struct lease *lp;
if (!pool -> failover_peer ||
pool -> failover_peer -> i_am == primary ||
@ -2246,7 +2233,6 @@ int dhcp_failover_pool_check (struct pool *pool)
int dhcp_failover_state_pool_check (dhcp_failover_state_t *state)
{
struct lease *lp;
struct shared_network *s;
struct pool *p;
@ -2565,7 +2551,6 @@ isc_result_t dhcp_failover_state_set_value (omapi_object_t *h,
void dhcp_failover_keepalive (void *vs)
{
dhcp_failover_state_t *state = vs;
}
void dhcp_failover_reconnect (void *vs)
@ -2599,7 +2584,6 @@ void dhcp_failover_reconnect (void *vs)
void dhcp_failover_startup_timeout (void *vs)
{
dhcp_failover_state_t *state = vs;
isc_result_t status;
#if defined (DEBUG_FAILOVER_TIMING)
log_info ("dhcp_failover_startup_timeout");
@ -2611,7 +2595,6 @@ void dhcp_failover_startup_timeout (void *vs)
void dhcp_failover_link_startup_timeout (void *vl)
{
dhcp_failover_link_t *link = vl;
isc_result_t status;
omapi_object_t *p;
for (p = (omapi_object_t *)link; p -> inner; p = p -> inner)
@ -3090,7 +3073,6 @@ isc_result_t dhcp_failover_state_remove (omapi_object_t *sp,
int dhcp_failover_state_match (dhcp_failover_state_t *state,
u_int8_t *addr, unsigned addrlen)
{
struct option_cache *oc;
struct data_string ds;
int i;
@ -3605,7 +3587,6 @@ isc_result_t dhcp_failover_put_message (dhcp_failover_link_t *link,
omapi_object_t *connection,
int msg_type, ...)
{
unsigned count = 0;
unsigned size = 0;
int bad_option = 0;
int opix = 0;
@ -3719,7 +3700,6 @@ void dhcp_failover_timeout (void *vstate)
{
dhcp_failover_state_t *state = vstate;
dhcp_failover_link_t *link;
isc_result_t status;
#if defined (DEBUG_FAILOVER_TIMING)
log_info ("dhcp_failover_timeout");
@ -3839,7 +3819,6 @@ isc_result_t dhcp_failover_send_connect (omapi_object_t *l)
dhcp_failover_link_t *link;
dhcp_failover_state_t *state;
isc_result_t status;
char hba [32];
#if defined (DEBUG_FAILOVER_MESSAGES)
char obuf [64];
unsigned obufix = 0;

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: mdb.c,v 1.1.1.1 2001/08/03 11:35:42 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: mdb.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -255,7 +255,6 @@ isc_result_t delete_host (hd, commit)
struct host_decl *hp = (struct host_decl *)0;
struct host_decl *np = (struct host_decl *)0;
struct host_decl *foo;
struct executable_statement *esp;
int hw_head = 0, uid_head = 1;
/* Don't need to do it twice. */
@ -386,7 +385,6 @@ int find_hosts_by_haddr (struct host_decl **hp, int htype,
const unsigned char *haddr, unsigned hlen,
const char *file, int line)
{
struct host_decl *foo;
struct hardware h;
h.hlen = hlen + 1;
@ -416,7 +414,6 @@ int find_host_for_network (struct subnet **sp, struct host_decl **host,
struct iaddr *addr, struct shared_network *share)
{
int i;
struct subnet *subnet;
struct iaddr ip_address;
struct host_decl *hp;
struct data_string fixed_addr;
@ -464,12 +461,14 @@ void new_address_range (low, high, subnet, pool)
struct subnet *subnet;
struct pool *pool;
{
struct lease *address_range, *lp, *plp;
struct lease *address_range;
struct iaddr net;
unsigned min, max, i;
char lowbuf [16], highbuf [16], netbuf [16];
struct shared_network *share = subnet -> shared_network;
#if !defined (COMPACT_LEASES)
isc_result_t status;
#endif
struct lease *lt = (struct lease *)0;
/* All subnets should have attached shared network structures. */
@ -756,7 +755,6 @@ void enter_lease (lease)
struct lease *lease;
{
struct lease *comp = (struct lease *)0;
isc_result_t status;
if (find_lease_by_ip_addr (&comp, lease -> ip_addr, MDL)) {
if (!comp -> pool) {
@ -806,7 +804,6 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
int enter_uid = 0;
int enter_hwaddr = 0;
struct lease *lp, **lq, *prev;
TIME lp_next_state;
#if defined (FAILOVER_PROTOCOL)
/* We must commit leases before sending updates regarding them
@ -1444,7 +1441,6 @@ void pool_timer (vpool)
void *vpool;
{
struct pool *pool;
struct lease *lt = (struct lease *)0;
struct lease *next = (struct lease *)0;
struct lease *lease = (struct lease *)0;
struct lease **lptr [5];
@ -1952,7 +1948,6 @@ void expire_all_pools ()
{
struct shared_network *s;
struct pool *p;
struct hash_bucket *hb;
int i;
struct lease *l;
struct lease **lptr [5];

View File

@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
"$Id: omapi.c,v 1.1.1.1 2001/08/03 11:35:43 drochner Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: omapi.c,v 1.2 2002/06/10 00:30:37 itojun Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -212,7 +212,6 @@ isc_result_t dhcp_lease_set_value (omapi_object_t *h,
{
struct lease *lease;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
@ -369,7 +368,6 @@ isc_result_t dhcp_lease_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_lease_destroy (omapi_object_t *h, const char *file, int line)
{
struct lease *lease;
isc_result_t status;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
@ -446,7 +444,6 @@ isc_result_t dhcp_lease_signal_handler (omapi_object_t *h,
{
struct lease *lease;
isc_result_t status;
int updatep = 0;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
@ -808,9 +805,8 @@ isc_result_t dhcp_host_set_value (omapi_object_t *h,
omapi_data_string_t *name,
omapi_typed_data_t *value)
{
struct host_decl *host, *hp;
struct host_decl *host;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_host)
return ISC_R_INVALIDARG;
@ -1069,7 +1065,6 @@ isc_result_t dhcp_host_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_host_destroy (omapi_object_t *h, const char *file, int line)
{
struct host_decl *host;
isc_result_t status;
if (h -> type != dhcp_type_host)
return ISC_R_INVALIDARG;
@ -1490,7 +1485,6 @@ isc_result_t dhcp_pool_set_value (omapi_object_t *h,
{
struct pool *pool;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_pool)
return ISC_R_INVALIDARG;
@ -1536,8 +1530,10 @@ isc_result_t dhcp_pool_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_pool_destroy (omapi_object_t *h, const char *file, int line)
{
struct pool *pool;
isc_result_t status;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
struct permit *pc, *pn;
#endif
if (h -> type != dhcp_type_pool)
return ISC_R_INVALIDARG;
@ -1634,9 +1630,6 @@ isc_result_t dhcp_pool_stuff_values (omapi_object_t *c,
isc_result_t dhcp_pool_lookup (omapi_object_t **lp,
omapi_object_t *id, omapi_object_t *ref)
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
struct pool *pool;
/* Can't look up pools yet. */
@ -1666,7 +1659,6 @@ isc_result_t dhcp_class_set_value (omapi_object_t *h,
{
struct class *class;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_class)
return ISC_R_INVALIDARG;
@ -1712,8 +1704,10 @@ isc_result_t dhcp_class_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_class_destroy (omapi_object_t *h, const char *file, int line)
{
struct class *class;
isc_result_t status;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
int i;
#endif
if (h -> type != dhcp_type_class && h -> type != dhcp_type_subclass)
return ISC_R_INVALIDARG;
@ -1813,9 +1807,6 @@ isc_result_t dhcp_class_stuff_values (omapi_object_t *c,
isc_result_t dhcp_class_lookup (omapi_object_t **lp,
omapi_object_t *id, omapi_object_t *ref)
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
struct class *class;
/* Can't look up classs yet. */
@ -1845,7 +1836,6 @@ isc_result_t dhcp_subclass_set_value (omapi_object_t *h,
{
struct subclass *subclass;
isc_result_t status;
int foo;
if (h -> type != dhcp_type_subclass)
return ISC_R_INVALIDARG;
@ -1940,9 +1930,6 @@ isc_result_t dhcp_subclass_stuff_values (omapi_object_t *c,
isc_result_t dhcp_subclass_lookup (omapi_object_t **lp,
omapi_object_t *id, omapi_object_t *ref)
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
struct subclass *subclass;
/* Can't look up subclasss yet. */

View File

@ -1,6 +1,6 @@
# $NetBSD: Makefile.inc,v 1.15 2001/08/03 14:13:56 drochner Exp $
# $NetBSD: Makefile.inc,v 1.16 2002/06/10 00:30:33 itojun Exp $
WARNS?= 0
WARNS?= 1
.include <bsd.own.mk>
@ -12,7 +12,7 @@ OMOBJDIR!=cd $(.CURDIR)/../omapip && ${PRINTOBJDIR}
MROBJDIR!=cd $(.CURDIR)/../minires && ${PRINTOBJDIR}
DSTOBJDIR!=cd $(.CURDIR)/../dst && ${PRINTOBJDIR}
CPPFLAGS+= -I${DIST} -I${DIST}/includes
CPPFLAGS+= -I${DIST} -I${DIST}/includes -Dlint
LDADD+= ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a
LDADD+= ${OMOBJDIR}/libomapi.a ${DSTOBJDIR}/libdst.a
DPADD+= ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a