See RT ticket #16988 for more.
- Fixed file descriptor leak on listen failure. Thanks to Tom Clark.
- Changes since 4.0.0a2
-
- Bug in server configuration parser caused server to get stuck on
startup for certain bad pool declarations. Thanks to Guillaume
Knispel for the bug report and fix.
+- Code cleaned to remove warnings reported by "gcc -Wall".
+
Changes since 4.0.0a1
- Bug in octal parsing fixed. Thanks to Bernd Fuhrmann for the report
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: clparse.c,v 1.71 2007/05/19 19:16:23 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <errno.h>
-static TIME parsed_time;
-
struct client_config top_level_config;
u_int32_t default_requested_options [] = {
static void parse_client_default_duid(struct parse *cfile);
static void parse_client6_lease_statement(struct parse *cfile);
+#ifdef DHCPv6
static struct dhc6_ia *parse_client6_ia_statement(struct parse *cfile);
static struct dhc6_addr *parse_client6_iaaddr_statement(struct parse *cfile);
+#endif /* DHCPv6 */
/* client-conf-file :== client-declarations END_OF_FILE
client-declarations :== <nil>
isc_result_t read_client_conf ()
{
struct client_config *config;
- struct client_state *state;
struct interface_info *ip;
isc_result_t status;
int token;
const char *val;
struct option *option = NULL;
- 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;
{
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)) {
case KEY:
static void
parse_client6_lease_statement(struct parse *cfile)
{
+#if !defined(DHCPv6)
+ parse_warn(cfile, "No DHCPv6 support.");
+ skip_to_semi(cfile);
+#else /* defined(DHCPv6) */
struct option_cache *oc = NULL;
struct dhc6_lease *lease;
struct dhc6_ia **ia;
unsigned len;
int token, has_ia, no_semi, has_name;
-#if !defined(DHCPv6)
- parse_warn(cfile, "No DHCPv6 support.");
- skip_to_semi(cfile);
-#else /* defined(DHCPv6) */
token = next_token(NULL, NULL, cfile);
if (token != LBRACE) {
parse_warn(cfile, "Expecting open curly brace.");
/* Parse an ia_na object from the client lease.
*/
+#ifdef DHCPv6
static struct dhc6_ia *
parse_client6_ia_statement(struct parse *cfile)
{
struct dhc6_ia *ia;
struct dhc6_addr **addr;
const char *val;
- unsigned len;
int token, no_semi;
ia = dmalloc(sizeof(*ia), MDL);
return ia;
}
+#endif /* DHCPv6 */
/* Parse an iaaddr {} structure. */
+#ifdef DHCPv6
static struct dhc6_addr *
parse_client6_iaaddr_statement(struct parse *cfile)
{
return addr;
}
+#endif /* DHCPv6 */
void parse_string_list (cfile, lp, multiple)
struct parse *cfile;
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);
return 0;
* http://www.isc.org/
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: dhc6.c,v 1.6 2007/06/06 22:57:31 each Exp $ Copyright (c) 2006-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#ifdef DHCPv6
struct data_string ds;
struct data_string ia;
struct data_string addr;
- struct option_cache *oc;
TIME elapsed;
u_int32_t t1, t2;
- int idx, len, send_ret, code;
+ int idx, len, send_ret;
client = input;
if ((client->active_lease != NULL) &&
((old_ia = find_ia(client->active_lease->bindings,
- ia.data)) != NULL)) {
+ (char *)ia.data)) != NULL)) {
/* For each address in the old IA, request a binding. */
memset(&addr, 0, sizeof(addr));
for (old_addr = old_ia->addrs ; old_addr != NULL ;
do_confirm6(void *input)
{
struct client_state *client;
- struct dhc6_ia *ia;
- struct dhc6_addr *addr;
struct data_string ds;
- struct data_string ia_data;
- struct data_string addr_data;
int send_ret;
TIME elapsed;
void
start_release6(struct client_state *client)
{
- struct data_string packet;
-
/* Cancel any pending transmissions */
cancel_timeout(do_confirm6, client);
cancel_timeout(do_select6, client);
{
struct sockaddr_in6 unicast, *dest_addr = &DHCPv6DestAddr;
struct client_state *client;
- struct dhc6_ia *ia;
- struct dhc6_addr *addr;
struct data_string ds;
- struct data_string ia_data;
- struct data_string addr_data;
struct option_cache *oc;
struct dhc6_lease *lease;
int send_ret;
if (len > 0)
log_info("%s status code %s: %s", scope, msg,
- print_hex_1(len, additional, 50));
+ print_hex_1(len, (unsigned char *)additional, 50));
else
log_info("%s status code %s.", scope, msg);
}
status = dhc6_get_status_code(options, code, &msg);
if (status == ISC_R_SUCCESS) {
- status_log(*code, scope, msg.data, msg.len);
+ status_log(*code, scope, (char *)msg.data, msg.len);
data_string_forget(&msg, MDL);
if (*code != STATUS_Success)
{
struct dhc6_ia *ia;
struct dhc6_addr *addr;
- TIME future;
if ((client == NULL) || (client->active_lease == NULL))
return;
isc_boolean_t (*action)(struct client_state *, isc_result_t, unsigned);
struct dhc6_ia *ia;
struct dhc6_addr *addr;
- isc_result_t rval = ISC_R_SUCCESS, status;
+ isc_result_t rval = ISC_R_SUCCESS;
unsigned code;
int nscore, sscore;
void
init_handler(struct packet *packet, struct client_state *client)
{
- struct dhc6_lease *lease, **idx;
+ struct dhc6_lease *lease;
/* In INIT state, we send solicits, we only expect to get
* advertises (we don't support rapid commit yet).
start_selecting6(struct client_state *client)
{
struct dhc6_lease *lease;
- struct data_string packet;
if (client->advertised_leases == NULL) {
log_error("Can not enter DHCPv6 SELECTING state with no "
{
struct client_state *client;
struct dhc6_lease *lease;
- struct dhc6_ia *ia;
- struct dhc6_addr *addr;
- struct option_cache *oc;
struct data_string ds;
- TIME elapsed, t1, t2;
+ TIME elapsed;
int abort = ISC_FALSE;
- int code, send_ret;
+ int send_ret;
client = input;
void
reply_handler(struct packet *packet, struct client_state *client)
{
- struct dhc6_lease *lease, *old;
+ struct dhc6_lease *lease;
isc_result_t check_status;
if (packet->dhcpv6_msg_type != DHCPV6_REPLY)
return;
for (sia = src->bindings ; sia != NULL ; sia = sia->next) {
- dia = find_ia(dst->bindings, sia->iaid);
+ dia = find_ia(dst->bindings, (char *)sia->iaid);
if (dia == NULL) {
tia = dhc6_dup_ia(sia, MDL);
oldia = NULL;
for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
if (old != NULL)
- oldia = find_ia(old->bindings, ia->iaid);
+ oldia = find_ia(old->bindings, (char *)ia->iaid);
else
oldia = NULL;
struct data_string ds;
struct client_state *client;
struct dhc6_lease *lease;
- TIME elapsed, next;
+ TIME elapsed;
int send_ret;
client = (struct client_state *)input;
make_client6_options(struct client_state *client, struct option_state **op,
struct dhc6_lease *lease, u_int8_t message)
{
- int code;
struct option_cache *oc;
if ((op == NULL) || (client == NULL))
* fault and not Elliot's.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: dhclient.c,v 1.154 2007/06/15 15:02:05 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <syslog.h>
#include <signal.h>
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;
/* Start a configuration state machine for each interface. */
#ifdef DHCPv6
if (local_family == AF_INET6) {
- struct option_cache *oc;
-
/* Establish a default DUID. This may be moved to the
* DHCPv4 area later.
*/
picked = lp;
picked -> next = (struct client_lease *)0;
} else {
- freeit:
destroy_client_lease (lp);
}
}
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. */
void bind_lease (client)
struct client_state *client;
{
- struct interface_info *ip = client -> interface;
-
/* Remember the medium. */
client -> new -> medium = client -> medium;
void *cpp;
{
struct client_state *client = cpp;
- int i;
struct option_cache *oc;
struct data_string ds;
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
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));
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));
struct client_lease *lease;
{
unsigned char decline = DHCPDECLINE;
- int i;
struct option_cache *oc;
struct option_state *options = (struct option_state *)0;
struct client_lease *lease;
{
unsigned char request = DHCPRELEASE;
- int i;
struct option_cache *oc;
struct option_state *options = (struct option_state *)0;
void destroy_client_lease (lease)
struct client_lease *lease;
{
- int i;
-
if (lease -> server_name)
dfree (lease -> server_name, MDL);
if (lease -> filename)
{
const char *name, *dot;
struct data_string ds;
- int status;
- struct client_state *client;
char *preamble = stuff;
memset (&ds, 0, sizeof ds);
int rewrite;
int makesure;
{
- int i;
- struct tm *t;
- struct option_cache *oc;
struct data_string ds;
- pair *hash;
int errors = 0;
char *s;
const char *tval;
int i;
struct data_string data;
struct option_cache *oc;
- pair *hash;
- char *s, *t;
struct envadd_state es;
es.client = client;
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;
{
char spbuf [1024];
char *s;
- unsigned len, i;
+ unsigned len;
struct string_list *val;
va_list list;
isc_result_t client_dns_update (struct client_state *client, int addp,
int ttl, struct iaddr *address)
{
- struct data_string ddns_fqdn, ddns_fwd_name,
- ddns_dhcid, client_identifier;
+ struct data_string ddns_fwd_name, ddns_dhcid, client_identifier;
struct option_cache *oc;
int ignorep;
int result;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: alloc.c,v 1.60 2007/05/19 19:16:23 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
const char *file;
int line;
{
- int size;
struct option_chain_head *h;
if (!ptr) {
const char *file;
int line;
{
- int i;
struct option_chain_head *option_chain_head;
pair car, cdr;
const char *file;
int line;
{
- int size;
struct group *g;
if (!ptr) {
const char *file;
int line;
{
- int i;
struct group *group;
if (!ptr || !*ptr) {
const char *file;
int line;
{
- struct buffer *bp;
-
if (!ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
const char *file;
int line;
{
- struct dns_host_entry *bp;
-
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
const char *file;
int line;
{
- int size;
struct packet *p;
if (!ptr) {
const char *file;
int line;
{
- int size;
struct dns_zone *d;
if (!ptr) {
* managed to get me to integrate them.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: bpf.c,v 1.57 2007/05/19 23:39:51 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) \
|| defined (USE_LPF_RECEIVE)
useful, you have Brian and BCtel to thank. Any limitations in the
code are a result of mistakes on my part. -- Ted Lemon */
-#ifndef lint
-static char copyright[] =
-"$Id: comapi.c,v 1.12 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
{
struct group_object *group;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
{
struct group_object *group;
isc_result_t status;
- struct data_string ip_addrs;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
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;
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;
{
dhcp_control_object_t *control;
isc_result_t status;
- int foo;
unsigned long newstate;
if (h -> type != dhcp_type_control)
{
dhcp_control_object_t *control;
isc_result_t status;
- struct data_string ip_addrs;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
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;
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;
{
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) {
{
struct subnet *subnet;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
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;
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. */
/* If we get to here without finding a subnet, no valid key was
{
struct shared_network *shared_network;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
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;
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. */
/* If we get to here without finding a shared_network, no valid key was
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: conflex.c,v 1.112 2007/07/03 09:51:58 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <ctype.h>
static int get_char PROTO ((struct parse *));
-static enum dhcp_token get_token PROTO ((struct parse *));
static void skip_to_eol PROTO ((struct parse *));
static enum dhcp_token read_whitespace(int c, struct parse *cfile);
static enum dhcp_token read_string PROTO ((struct parse *));
static enum dhcp_token read_number PROTO ((int, struct parse *));
static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
-static enum dhcp_token intern PROTO ((unsigned char *, enum dhcp_token));
+static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
struct parse **cfile;
* when parsing IPv6 addresses).
*
* Generally we use the next_token() function to read tokens. This
- * in turn calls get_token, which does *not* return tokens for
+ * in turn calls get_next_token, which does *not* return tokens for
* whitespace. Rather, it skips these.
*
* When we need to see whitespace, we us next_raw_token(), which also
cfile -> tokbuf [i] = 0;
cfile -> tlen = i;
cfile -> tval = cfile -> tokbuf;
- return intern (cfile -> tval, rv);
+ return intern(cfile->tval, rv);
}
-static enum dhcp_token intern (atom, dfv)
- unsigned char *atom;
- enum dhcp_token dfv;
-{
- if (!isascii (atom [0]))
+static enum dhcp_token
+intern(char *atom, enum dhcp_token dfv) {
+ if (!isascii(atom[0]))
return dfv;
- switch (tolower (atom [0])) {
+ switch (tolower((unsigned char)atom[0])) {
case '-':
if (atom [1] == 0)
return MINUS;
}
break;
case 'e':
- if (isascii (atom [1]) && tolower (atom [1]) == 'x') {
+ if (isascii (atom [1]) &&
+ tolower((unsigned char)atom[1]) == 'x') {
if (!strcasecmp (atom + 2, "tract-int"))
return EXTRACT_INT;
if (!strcasecmp (atom + 2, "ists"))
case 's':
if (!strcasecmp(atom + 1, "cript"))
return SCRIPT;
- if (isascii(atom[1]) && tolower(atom[1]) == 'e') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'e') {
if (!strcasecmp(atom + 2, "arch"))
return SEARCH;
- if (isascii(atom[2]) && tolower(atom[2]) == 'c') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'c') {
if (!strncasecmp(atom + 3, "ond", 3)) {
if (!strcasecmp(atom + 6, "ary"))
return SECONDARY;
return TOKEN_SET;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'h') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'h') {
if (!strcasecmp(atom + 2, "ared-network"))
return SHARED_NETWORK;
if (!strcasecmp(atom + 2, "utdown"))
return SHUTDOWN;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'i') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'i') {
if (!strcasecmp(atom + 2, "addr"))
return SIADDR;
if (!strcasecmp(atom + 2, "gned"))
return SIZE;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'p') {
- if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'p') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'a') {
if (!strcasecmp(atom + 3, "ce"))
return SPACE;
if (!strcasecmp(atom + 3, "wn"))
return SPLIT;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 't') {
- if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 't') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'a') {
if(!strncasecmp(atom + 3, "rt", 2)) {
if (!strcasecmp(atom + 5, "s"))
return STARTS;
break;
}
if (isascii(atom[3]) &&
- tolower(atom[3]) == 't') {
+ tolower((unsigned char)atom[3]) == 't') {
if (!strcasecmp(atom + 4, "e"))
return STATE;
if (!strcasecmp(atom + 4, "ic"))
return SUBSTRING;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'u') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'u') {
if (!strcasecmp(atom + 2, "ffix"))
return SUFFIX;
if (!strcasecmp(atom + 2, "persede"))
* learn more about Nominum, Inc., see ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: ctrace.c,v 1.8 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (TRACING)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: discover.c,v 1.60 2007/06/08 14:58:20 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#define BSD_COMP /* needed on Solaris for SIOCGLIFNUM */
struct iface_info info;
int err;
- struct interface_info *tmp, *ip;
+ struct interface_info *tmp;
struct interface_info *last, *next;
- char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+#ifdef DHCPv6
+ char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+#endif /* DHCPv6 */
+
struct subnet *subnet;
int ir;
static int setup_fallback = 0;
- int sock;
-
if (!begin_iface_scan(&ifaces)) {
log_fatal("Can't get list of interfaces.");
}
}
ip = (struct interface_info *)h;
- result = receive_packet6(ip, buf, sizeof(buf), &from, &to);
+ result = receive_packet6(ip, (unsigned char *)buf, sizeof(buf),
+ &from, &to);
if (result < 0) {
log_error("receive_packet6() failed on %s: %m", ip->name);
return ISC_R_UNEXPECTED;
{
struct interface_info *interface;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
const char *file, int line)
{
struct interface_info *interface;
- isc_result_t status;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
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)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dispatch.c,v 1.66 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct timeout *timeouts;
* http://docs.hp.com/en/B2355-90139/index.html
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dlpi.c,v 1.33 2007/05/19 18:47:14 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dns.c,v 1.42 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "arpa/nameser.h"
#include "dst/md5.h"
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)
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;
const char *file;
int line;
{
- int i;
struct dns_zone *dns_zone;
if (!ptr || !*ptr) {
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] == '.')
/*
* Conflict detection override: delete DHCID RRs.
*/
- updrec = minires_mkupdrec(S_UPDATE, ddns_fwd_name->data,
+ updrec = minires_mkupdrec(S_UPDATE,
+ (const char *)ddns_fwd_name->data,
C_IN, T_DHCID, 0);
if (!updrec) {
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: ethernet.c,v 1.8 2005/03/17 20:14:58 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: execute.c,v 1.51 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
+#include <sys/types.h>
+#include <sys/wait.h>
int execute_statements (result, packet, lease, client_state,
in_options, out_options, scope, statements)
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;
binding -> next = (*scope) -> bindings;
(*scope) -> bindings = binding;
} else {
- badalloc:
dfree (binding, MDL);
binding = (struct binding *)0;
}
const char *file;
int line;
{
- struct executable_statement *bp;
-
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
{
struct executable_statement *r, *x;
struct expression *expr;
- int result;
- int status;
const char *s, *t, *dot;
int col;
{
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);
{
struct executable_statement *foo;
int ok = 0;
- int result;
for (foo = stmt; foo; foo = foo -> next) {
if ((*callback) (foo, vp, condp) != 0)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: fddi.c,v 1.4 2005/03/17 20:14:58 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (DEC_FDDI)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: icmp.c,v 1.34 2007/05/23 10:35:10 shane Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "netinet/ip.h"
#include "netinet/ip_icmp.h"
{
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. */
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);
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: inet.c,v 1.14 2007/06/19 17:06:03 shane Exp $ Copyright (c) 2004,2005,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
/* Return just the network number of an internet address... */
struct iaddr subnet;
struct iaddr mask;
{
- int i, j, k;
+ int i;
struct iaddr rv;
if (subnet.len > sizeof(subnet.iabuf))
* http://www.isc.org/
*/
-#ifndef lint
-static char copyright[] =
-"$Id: lpf.c,v 1.35 2007/05/19 18:47:14 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
#include <sys/ioctl.h>
struct interface_info *info;
{
int sock;
- char filename[50];
- int b;
struct sockaddr sa;
/* Make an LPF socket. */
struct sockaddr_in *from;
struct hardware *hfrom;
{
- int nread;
int length = 0;
int offset = 0;
unsigned char ibuf [1536];
break;
default:
log_fatal("Unsupported device type %ld for \"%s\"",
- sa->sa_family, name);
+ (long int)sa->sa_family, name);
}
close(sock);
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: memory.c,v 1.69 2006/06/01 20:23:17 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct group *root_group;
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. */
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
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: nit.c,v 1.36 2007/04/27 23:54:05 each Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_NIT_SEND) || defined (USE_NIT_RECEIVE)
#include <sys/ioctl.h>
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: options.c,v 1.110 2007/05/23 19:25:40 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#define DHCP_OPTION_DATA
#include "dhcpd.h"
#include <omapip/omapip_p.h>
struct option *vendor_cfg_option;
-static void do_option_set PROTO ((pair *,
- struct option_cache *,
- enum statement_op));
static int pretty_text(char **, char *, const unsigned char **,
const unsigned char *, int);
static int pretty_domain(char **, char *, const unsigned char **,
int parse_options (packet)
struct packet *packet;
{
- int i;
struct option_cache *op = (struct option_cache *)0;
/* Allocate a new option state. */
unsigned length;
struct universe *universe;
{
- unsigned char *t;
- const unsigned char *end = buffer + length;
unsigned len, offset;
unsigned code;
struct option_cache *op = NULL, *nop = NULL;
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. */
int priority_len;
unsigned char buffer [4096]; /* Really big buffer... */
unsigned main_buffer_size, mb_max;
- unsigned mainbufix, bufix, agentix;
- int fileix;
- int snameix;
+ unsigned mainbufix, agentix;
unsigned option_size;
unsigned length;
int i;
struct data_string ds;
pair pp, *hash;
int need_endopt = 0;
- int have_sso = 0;
int ocount = 0;
int ofbuf1=0, ofbuf2=0;
if (universe->tag_size == 1) {
vs->buf[vs->bufpos++] = oc->option->code;
} else if (universe->tag_size == 2) {
- putUShort(vs->buf+vs->bufpos, oc->option->code);
+ putUShort((unsigned char *)vs->buf+vs->bufpos,
+ oc->option->code);
vs->bufpos += 2;
} else if (universe->tag_size == 4) {
- putULong(vs->buf+vs->bufpos, oc->option->code);
+ putULong((unsigned char *)vs->buf+vs->bufpos,
+ oc->option->code);
vs->bufpos += 4;
}
if (universe->length_size == 1) {
vs->buf[vs->bufpos++] = ds.len;
} else if (universe->length_size == 2) {
- putUShort(vs->buf+vs->bufpos, ds.len);
+ putUShort((unsigned char *)vs->buf+vs->bufpos,
+ ds.len);
vs->bufpos += 2;
} else if (universe->length_size == 4) {
- putULong(vs->buf+vs->bufpos, ds.len);
+ putULong((unsigned char *)vs->buf+vs->bufpos,
+ ds.len);
vs->bufpos += 4;
}
memcpy(vs->buf + vs->bufpos, ds.data, ds.len);
struct option *o;
struct data_string ds;
int bufpos;
- int len;
int oro_size;
u_int16_t code;
int in_required_opts;
- struct universe *u;
int vsio_option_code;
int vsio_wanted;
struct vsio_state vs;
+ unsigned char *tmp;
bufpos = 0;
vsio_wanted = 0;
NULL, opt_state, NULL,
&global_scope, oc, MDL)) {
if ((ds.len + 4) <= (buflen - bufpos)) {
+ tmp = (unsigned char *)buf + bufpos;
/* option tag */
- putUShort(buf+bufpos, required_opts[i]);
+ putUShort(tmp, required_opts[i]);
/* option length */
- putUShort(buf+bufpos+2, ds.len);
+ putUShort(tmp+2, ds.len);
/* option data */
- memcpy(buf+bufpos+4, ds.data, ds.len);
+ memcpy(tmp+4, ds.data, ds.len);
/* update position */
bufpos += (4 + ds.len);
} else {
if (evaluate_option_cache(&ds, packet, NULL, NULL, opt_state,
NULL, &global_scope, oc, MDL)) {
if ((ds.len + 4) <= (buflen - bufpos)) {
+ tmp = (unsigned char *)buf + bufpos;
/* option tag */
- putUShort(buf+bufpos, code);
+ putUShort(tmp, code);
/* option length */
- putUShort(buf+bufpos+2, ds.len);
+ putUShort(tmp+2, ds.len);
/* option data */
- memcpy(buf+bufpos+4, ds.data, ds.len);
+ memcpy(tmp+4, ds.data, ds.len);
/* update position */
bufpos += (4 + ds.len);
} else {
* add the "header".
*/
if (vs.bufpos > bufpos+8) {
- putUShort(buf+bufpos,
+ tmp = (unsigned char *)buf +
+ bufpos;
+ putUShort(tmp,
vsio_option_code);
- putUShort(buf+bufpos+2,
+ putUShort(tmp+2,
vs.bufpos-bufpos-4);
- putULong(buf+bufpos+4, o->code);
+ putULong(tmp+4, o->code);
bufpos = vs.bufpos;
}
if ((option != NULL) &&
(((oc == NULL) && (option->format[0] == 'E')) ||
((oc != NULL) && (option->format[0] == 'e')))) {
- int uix;
static char *s, *t;
struct option_cache *tmp;
struct data_string name;
toptstart = tix;
while (length) {
unsigned incr = length;
- int consumed = 0;
int *pix;
unsigned char *base;
const char *format;
{
const char *p;
- int retval = 0;
p = format;
while (*p != '\0') {
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:
void *void_oro) {
struct data_string *oro = (struct data_string *)void_oro;
- putUShort((char *)(oro->data + oro->len), oc->option->code);
+ putUShort((unsigned char *)(oro->data + oro->len), oc->option->code);
oro->len += 2;
}
o = universes[i]->enc_opt;
while (o != NULL) {
if (o->universe == &dhcpv6_universe) {
- putUShort((char *)server_oro->data +
- server_oro->len,
+ unsigned char *tmp;
+ tmp = (unsigned char *)server_oro->data;
+ putUShort(tmp + server_oro->len,
o->code);
server_oro->len += 2;
break;
int hashix;
pair bptr, prev = (pair)0;
pair *hash = options -> universes [universe -> index];
- struct option_cache *oc;
/* There may not be any options in this space. */
if (!hash)
struct binding_scope **scope;
struct data_string *name;
{
- struct data_string sub;
- struct universe *u = NULL, *subu = NULL;
+ struct universe *u = NULL;
int status = 0;
- int i;
- universe_hash_lookup(&u, universe_hash, name->data, name->len, MDL);
+ universe_hash_lookup(&u, universe_hash,
+ (char *)name->data, name->len, MDL);
if (u == NULL) {
log_error("option_space_encapsulate: option space %.*s does "
"not exist, but is configured.",
{
pair ocp;
int status;
- int i;
static struct option_cache *no_nwip;
struct data_string ds;
struct option_chain_head *head;
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,
goto error;
/* Convert the domain name to textual representation for config. */
- len = MRns_name_ntop(buffer + 1, bp->data + 3, length - 1);
+ len = MRns_name_ntop(buffer + 1, (char *)bp->data + 3, length - 1);
if (len == -1) {
log_error("Unable to convert dhcp6.fqdn domain name to "
"printable form.");
bp->data + 3, len, FQDN_FQDN, 1))
goto error;
- first_dot = strchr(bp->data + 3, '.');
+ first_dot = (unsigned char *)strchr((char *)bp->data + 3, '.');
if (first_dot != NULL) {
hlen = first_dot - bp->data + 3;
{
struct universe *universe = find_option_universe (oc -> option,
vsname);
- int i;
-
if (universe -> foreach)
(*universe -> foreach) (packet, lease, client_state,
in_options, cfg_options,
struct option_cache *oc;
{
pair *tail;
- pair np = (pair )0;
struct option_chain_head *head;
struct option_cache **ocloc;
struct iaddr from;
struct hardware *hfrom;
{
- int i;
struct option_cache *op;
struct packet *decoded_packet;
#if defined (DEBUG_MEMORY_LEAKAGE)
* still be disabled.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: packet.c,v 1.48 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2005,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: parse.c,v 1.129 2007/06/27 18:25:15 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <syslog.h>
struct parse *cfile;
struct iaddr *addr;
{
- const char *val;
- enum dhcp_token token;
-
addr -> len = 4;
if (parse_numeric_aggregate (cfile, addr -> iabuf,
&addr -> len, DOT, 10, 8))
int base;
unsigned size;
{
- const unsigned char *ptr = str;
+ const unsigned char *ptr = (const unsigned char *)str;
int negative = 0;
u_int32_t val = 0;
int tval;
TIME parse_date (cfile)
struct parse *cfile;
{
- struct tm tm;
int guess;
int tzoff, wday, year, mon, mday, hour, min, sec;
const char *val;
char tokbuf [128];
unsigned tokix = 0;
char type;
- int code;
int is_signed;
char *s;
int has_encapsulation = 0;
enum dhcp_token token;
const char *val;
unsigned len;
- struct executable_statement base;
struct class *cta;
struct option *option=NULL;
struct option_cache *cache;
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;
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;
- int i;
unsigned long u;
- isc_result_t status, code;
+ isc_result_t status;
unsigned len;
token = peek_token (&val, (unsigned *)0, cfile);
parse_warn
(cfile,
"expecting dns expression.");
- badnstrans:
expression_dereference (expr, MDL);
*lose = 1;
return 0;
enum dhcp_token token;
struct expression *expr = (struct expression *)0;
int lose;
- int ftt = 1;
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SEMI) {
struct expression *t = (struct expression *)0;
unsigned char buf [4];
unsigned len;
- unsigned char *ob;
struct iaddr addr;
- int num, compress;
+ int compress;
const char *f, *g;
struct enumeration_value *e;
/* Parse the option data... */
do {
- /* 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')
break;
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) {
if (lix < (sizeof lexbuf) - 1)
lexbuf [lix++] = ' ';
if (cfile -> token_line [i] == '\t') {
- for (lix;
- lix < (sizeof lexbuf) - 1 && (lix & 7); lix++)
+ for (; lix < (sizeof lexbuf) - 1 && (lix & 7); lix++)
lexbuf [lix] = ' ';
}
}
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: print.c,v 1.67 2007/06/07 15:52:29 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
int db_time_format = DEFAULT_TIME_FORMAT;
char *quotify_string (const char *s, const char *file, int line)
{
unsigned len = 0;
- const unsigned char *sp;
+ const char *sp;
char *buf, *nsp;
for (sp = s; sp && *sp; sp++) {
{
unsigned rv, left;
const char *s;
- struct expression *next_arg;
switch (expr -> op) {
case expr_none:
const char *suffix, ...)
{
va_list list;
- char *buf;
unsigned len;
char *s, *t, *u;
/* If we have a purely ASCII string, output it as text. */
if (i == data -> len) {
- char *buf = dmalloc (data -> len + 3, MDL);
+ buf = dmalloc (data -> len + 3, MDL);
if (buf) {
buf [0] = '"';
memcpy (buf + 1, data -> data, data -> len);
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: raw.c,v 1.18 2005/03/17 20:15:00 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_RAW_SEND)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: resolv.c,v 1.18 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct name_server *name_servers;
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);
struct name_server *first_name_server ()
{
- FILE *rc;
static TIME rcdate;
struct stat st;
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);
* I have implemented it under Linux; other systems should be doable also.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: socket.c,v 1.66 2007/05/19 23:16:13 dhankins Exp $ "
-"Copyright (c) 2004-2007 Internet Systems Consortium.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <errno.h>
#include <sys/ioctl.h>
# endif
#endif
+/*
+ * If we can't bind() to a specific interface, then we can only have
+ * a single socket. This variable insures that we don't try to listen
+ * on two sockets.
+ */
+#if !defined(SO_BINDTODEVICE) && !defined(USE_FALLBACK)
static int once = 0;
+#endif /* !defined(SO_BINDTODEVICE) && !defined(USE_FALLBACK) */
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: tables.c,v 1.64 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
/* XXXDPN: Moved here from hash.c, when it moved to libomapi. Not sure
* http://www.isc.org/
*/
-#ifndef lint
-static char copyright[] =
-"$Id: tr.c,v 1.11 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (HAVE_TR_SUPPORT) && \
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: upf.c,v 1.24 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_UPF_SEND) || defined (USE_UPF_RECEIVE)
#include <sys/ioctl.h>
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: callback.c,v 1.8 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
{
dhcpctl_callback_object_t *callback;
omapi_object_t *inner;
- isc_result_t status;
callback = dmalloc (sizeof *callback, MDL);
if (!callback)
omapi_object_t *id,
omapi_object_t *p)
{
- int i;
-
if (p -> type != dhcpctl_callback_type)
return ISC_R_INVALIDARG;
* by Brian Murrell.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: cltest.c,v 1.13 2005/03/17 20:15:03 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
isc_result_t status, waitstatus;
dhcpctl_handle authenticator;
dhcpctl_handle connection;
- dhcpctl_handle host_handle, group_handle, interface_handle;
- dhcpctl_data_string cid;
- dhcpctl_data_string result, groupname, identifier;
+ dhcpctl_handle interface_handle;
+ dhcpctl_data_string result;
int i;
int mode = undefined;
const char *interface = 0;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dhcpctl.c,v 1.27 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
dhcpctl_handle authinfo)
{
isc_result_t status;
- dhcpctl_status waitstatus;
status = omapi_generic_new (connection, MDL);
if (status != ISC_R_SUCCESS) {
{
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;
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)
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)
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)
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)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: omshell.c,v 1.16 2007/06/08 14:58:20 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
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;
val = buf;
do {
int intval = atoi (val);
- dotiszero:
if (intval > 255) {
parse_warn (cfile,
"dotted octet > 255: %s",
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: remote.c,v 1.16 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
omapi_object_t *id,
omapi_object_t *p)
{
- int i;
-
if (p -> type != dhcpctl_remote_type)
return ISC_R_INVALIDARG;
#ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.2 2007/05/29 18:11:55 each Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.3 2007/07/13 06:43:42 shane Exp $";
#endif
/*
enckey[--len] = '\0';
/* remove leading spaces */
- for (notspace = (char *) enckey; isspace(*notspace); len--)
+ for (notspace = (unsigned char *)enckey; isspace(*notspace); len--)
notspace++;
- dlen = b64_pton(notspace, deckey, sizeof(deckey));
+ dlen = b64_pton((char *)notspace, deckey, sizeof(deckey));
if (dlen < 0) {
EREPORT(("dst_read_public_key: bad return from b64_pton = %d",
dlen));
#ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.3 2007/05/19 19:16:25 dhankins Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.4 2007/07/13 06:43:42 shane Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
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 */
}
int parse_expression PROTO ((struct expression **, struct parse *, int *,
enum expression_context,
struct expression **, enum expr_op));
+int parse_option_data(struct expression **expr, struct parse *cfile,
+ int lookups, struct option *option);
int parse_option_statement PROTO ((struct executable_statement **,
struct parse *, int,
struct option *, enum statement_op));
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_date.c,v 1.4 2007/05/29 18:11:56 each Exp $";
+static const char rcsid[] = "$Id: ns_date.c,v 1.5 2007/07/13 06:43:42 shane Exp $";
#endif
/* Import. */
/* Forward. */
-static int datepart(const unsigned char *, int, int, int, int *);
+static int datepart(const char *, int, int, int, int *);
/* Public. */
* Don't reset the flag if there is no error.
*/
static int
-datepart(const unsigned char *buf, int size, int min, int max, int *errp) {
+datepart(const char *buf, int size, int min, int max, int *errp) {
int result = 0;
int i;
for (i = 0; i < size; i++) {
- if (!isdigit(buf[i]))
+ if (!isdigit((unsigned char)buf[i]))
*errp = 1;
result = (result * 10) + buf[i] - '0';
}
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.7 2007/05/29 18:11:56 each Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.8 2007/07/13 06:43:42 shane Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
int
minires_vinit(res_state statp, int preinit) {
register FILE *fp;
- register unsigned char *cp;
+ char *cp;
register char **pp;
register int n;
char buf[BUFSIZ];
*/
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.10 2007/05/19 19:16:25 dhankins Exp $";
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.11 2007/07/13 06:43:42 shane Exp $";
#endif /* not lint */
#include <sys/types.h>
u_int16_t rtype, rclass;
u_int32_t n1, rttl;
u_char *dnptrs[20], **dpp, **lastdnptr;
- unsigned siglen, certlen;
+ unsigned certlen;
int keylen;
unsigned buflen = *blp;
u_char *buf = (unsigned char *)bp;
{
int sig_type, success, dateerror;
u_int32_t exptime, timesigned;
+ unsigned siglen;
/* type */
if ((n = getword_str(buf2, sizeof buf2,
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.6 2007/05/29 18:11:56 each Exp $";
+static const char rcsid[] = "$Id: res_query.c,v 1.7 2007/07/13 06:43:42 shane Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';
while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
+ for (cp1 = (unsigned char *)buf; *cp1 && !isspace(*cp1); ++cp1)
;
if (!*cp1)
break;
for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
;
*cp2 = '\0';
- strncpy(dst, cp1, siz - 1);
+ strncpy(dst, (char *)cp1, siz - 1);
dst[siz - 1] = '\0';
fclose(fp);
return (dst);
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/03/17 20:15:20 dhankins Exp $";
+static const char rcsid[] = "$Id: res_update.c,v 1.14 2007/07/13 06:43:42 shane Exp $";
#endif /* not lint */
/*
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];
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: alloc.c,v 1.28 2007/05/19 19:16:25 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium, Inc. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
dmalloc(unsigned size, const char *file, int line) {
unsigned char *foo;
unsigned len;
- int i;
void **bar;
#if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
+ int i;
struct dmalloc_preamble *dp;
#endif
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: array.c,v 1.6 2007/05/19 19:16:25 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
omapi_array_deref_t deref,
const char *file, int line)
{
- isc_result_t status;
omapi_array_t *aptr;
if (!array || *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;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: auth.c,v 1.8 2007/05/19 19:16:25 dhankins Exp $ Copyright 2004,2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
int bytes_written;
unsigned first_byte;
omapi_buffer_t *buffer;
- unsigned char *bufp;
omapi_connection_object_t *c;
isc_result_t status;
u_int32_t value)
{
u_int32_t inbuf;
- isc_result_t status;
inbuf = htonl (value);
u_int32_t value)
{
u_int16_t inbuf;
- isc_result_t status;
inbuf = htons (value);
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);
omapi_object_t *id,
omapi_object_t *m)
{
- int i;
-
if (m -> type != omapi_type_connection)
return ISC_R_INVALIDARG;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: convert.c,v 1.4 2007/05/19 19:16:26 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
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;
#include "dhcpd.h"
#include <omapip/omapip_p.h>
+#include <sys/time.h>
static omapi_io_object_t omapi_io_states;
time_t cur_time;
* with Vixie Laboratories.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: errwarn.c,v 1.12 2007/05/19 19:16:26 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: generic.c,v 1.14 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
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)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: handle.c,v 1.10 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
isc_result_t omapi_object_handle (omapi_handle_t *h, omapi_object_t *o)
{
- int tabix;
isc_result_t status;
if (o -> handle) {
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)
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: hash.c,v 1.16 2007/05/29 18:11:56 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
const char *file;
int line;
{
- int i;
- struct hash_bucket *hbc, *hbn = (struct hash_bucket *)0;
struct hash_table *ptr = *tp;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
+ int i;
+ struct hash_bucket *hbc, *hbn = (struct hash_bucket *)0;
+
for (i = 0; i < ptr -> hash_count; i++) {
for (hbc = ptr -> buckets [i]; hbc; hbc = hbn) {
hbn = hbc -> next;
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!");
struct hash_bucket *bp;
if (table->hash_count == 0)
- return (char *) "Invalid hash table.";
+ return (unsigned char *) "Invalid hash table.";
for (i = 0 ; i < table->hash_count ; i++) {
curlen = 0;
pct > 2147483647 ||
minlen > 2147483647 ||
maxlen > 2147483647)
- return (char *) "Report out of range for display.";
+ return (unsigned char *) "Report out of range for display.";
- sprintf(retbuf, "Contents/Size (%%): %u/%u (%u%%). Min/max: %u/%u",
+ sprintf((char *)retbuf,
+ "Contents/Size (%%): %u/%u (%u%%). Min/max: %u/%u",
contents, table->hash_count, pct, minlen, maxlen);
return retbuf;
#endif
#endif /* LIBC_SCCS and not lint */
-#ifndef lint
-static char copyright[] =
-"$Id: inet_addr.c,v 1.2 2007/05/19 18:47:15 dhankins Exp $ Copyright (c) 1983, 1990, 1993 The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "omapip/omapip_p.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;
/* Currently only support IPv4 addresses. */
if (addr->addrtype != AF_INET)
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;
/* 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;
omapi_object_t *id,
omapi_object_t *l)
{
- int i;
-
if (l -> type != omapi_type_listener)
return ISC_R_INVALIDARG;
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)
return ISC_R_INVALIDARG;
omapi_object_t *id,
omapi_object_t *m)
{
- int i;
-
if (m -> type != omapi_type_message)
return ISC_R_INVALIDARG;
unsigned buflen = 0;
char *buf = (char *)0;
isc_result_t status;
- u_int32_t id;
int i;
if (trace_playback ()) {
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.");
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: protocol.c,v 1.33 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
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 ||
omapi_object_t *id,
omapi_object_t *p)
{
- int i;
-
if (p -> type != omapi_type_protocol)
return ISC_R_INVALIDARG;
omapi_object_t *id,
omapi_object_t *p)
{
- int i;
-
if (p -> type != omapi_type_protocol_listener)
return ISC_R_INVALIDARG;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: support.c,v 1.30 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
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 ()
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)
const char *name,
omapi_typed_data_t *value)
{
- omapi_object_t *outer;
omapi_data_string_t *nds;
isc_result_t status;
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)
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)
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)
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)
* learn more about Nominum, Inc., see ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: trace.c,v 1.15 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
#include <errno.h>
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;
trace_type_t *ttype;
unsigned paylen;
int status;
- int len;
fpos_t curpos;
status = fgetpos (traceinfile, &curpos);
unsigned bufmax = 0;
unsigned buflen = 0;
char *buf = (char *)0;
- isc_result_t status;
time_t result;
trace_type_t *ttp;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: dhcrelay.c,v 1.63 2007/06/07 15:29:31 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <syslog.h>
unsigned length;
struct in_addr giaddr;
{
- int is_dhcp = 0, agent_options_present = 0;
+ int is_dhcp = 0;
unsigned optlen;
u_int8_t *op, *nextop, *sp, *max, *end_pad = NULL;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: bootp.c,v 1.79 2007/05/19 19:16:26 dhankins Exp $ Copyright (c) 2004,2005,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <errno.h>
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: class.c,v 1.33 2006/06/01 20:23:17 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-
-#endif /* not lint */
-
#include "dhcpd.h"
struct collection default_collection = {
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: confpars.c,v 1.172 2007/07/11 14:54:11 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
-static TIME parsed_time;
static unsigned char global_host_once = 1;
#if defined (TRACING)
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 = NULL;
struct option_cache *cache;
int lose;
- struct data_string key_id;
int known;
isc_result_t status;
unsigned code;
"load balance settings.");
if (token != NUMBER) {
parse_warn (cfile, "expecting number");
- badsplit:
skip_to_rbrace (cfile, 1);
dhcp_failover_state_dereference (&peer, MDL);
return;
/* See if there's already a pool into which we can merge this one. */
for (pp = pool -> shared_network -> pools; pp; pp = pp -> next) {
- struct lease *l;
-
if (pp -> group -> statements != pool -> group -> statements)
continue;
#if defined (FAILOVER_PROTOCOL)
char *name;
const char *tname;
struct executable_statement *stmt = (struct executable_statement *)0;
- struct expression *expr;
int new = 1;
isc_result_t status = ISC_R_FAILURE;
int matchedonce = 0;
{
const char *val;
enum dhcp_token token;
- struct subnet *subnet, *t, *u;
+ struct subnet *subnet;
struct iaddr iaddr;
unsigned char addr [4];
unsigned len = sizeof addr;
void
parse_subnet6_declaration(struct parse *cfile, struct shared_network *share) {
+#if !defined(DHCPv6)
+ parse_warn(cfile, "No DHCPv6 support.");
+ skip_to_semi(cfile);
+#else /* defined(DHCPv6) */
struct subnet *subnet;
isc_result_t status;
enum dhcp_token token;
const static int mask[] = { 0x00, 0x80, 0xC0, 0xE0,
0xF0, 0xF8, 0xFC, 0xFE };
struct iaddr iaddr;
- struct ipv6_pool *pool;
-#if !defined(DHCPv6)
- parse_warn(cfile, "No DHCPv6 support.");
- skip_to_semi(cfile);
-#else /* defined(DHCPv6) */
subnet = NULL;
status = subnet_allocate(&subnet, MDL);
if (status != ISC_R_SUCCESS) {
char tbuf [32];
struct lease *lease;
struct executable_statement *on;
- struct expression *exp;
- struct data_string ds;
int lose;
TIME t;
char *s;
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;
int dynamic = 0;
struct subnet *subnet;
struct shared_network *share;
- struct pool *p;
struct pool *pool;
isc_result_t status;
void
parse_ia_na_declaration(struct parse *cfile) {
+#if !defined(DHCPv6)
+ parse_warn(cfile, "No DHCPv6 support.");
+ skip_to_semi(cfile);
+#else /* defined(DHCPv6) */
enum dhcp_token token;
struct ia_na *ia_na;
const char *val;
struct ia_na *old_ia_na;
- int len;
+ unsigned int len;
u_int32_t iaid;
struct iaddr iaddr;
binding_state_t state;
struct iaaddr *iaaddr;
struct ipv6_pool *pool;
char addr_buf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
- struct data_string uid;
-#if !defined(DHCPv6)
- parse_warn(cfile, "No DHCPv6 support.");
- skip_to_semi(cfile);
-#else /* defined(DHCPv6) */
token = next_token(&val, &len, cfile);
if (token != STRING) {
parse_warn(cfile, "corrupt lease file; "
*/
old_ia_na = NULL;
if (ia_na_hash_lookup(&old_ia_na, ia_active,
- (char *)ia_na->iaid_duid.data,
+ (unsigned char *)ia_na->iaid_duid.data,
ia_na->iaid_duid.len, MDL)) {
ia_na_hash_delete(ia_active,
- (char *)ia_na->iaid_duid.data,
+ (unsigned char *)ia_na->iaid_duid.data,
ia_na->iaid_duid.len, MDL);
ia_na_remove_all_iaaddr(old_ia_na, MDL);
ia_na_dereference(&old_ia_na, MDL);
* If we have addresses, add this, otherwise don't bother.
*/
if (ia_na->num_iaaddr > 0) {
- ia_na_hash_add(ia_active, (char *)ia_na->iaid_duid.data,
+ ia_na_hash_add(ia_active,
+ (unsigned char *)ia_na->iaid_duid.data,
ia_na->iaid_duid.len, ia_na, MDL);
}
ia_na_dereference(&ia_na, MDL);
parse_server_duid(struct parse *cfile) {
enum dhcp_token token;
const char *val;
- int len;
+ unsigned int len;
struct data_string duid;
token = next_token(&val, &len, cfile);
if (!buffer_allocate(&duid.buffer, duid.len, MDL)) {
log_fatal("Out of memory storing DUID");
}
- duid.data = (char *)duid.buffer->data;
+ duid.data = (unsigned char *)duid.buffer->data;
memcpy(duid.buffer->data, val, len);
set_server_duid(&duid);
parse_server_duid_conf(struct parse *cfile) {
enum dhcp_token token;
const char *val;
- int len;
+ unsigned int len;
u_int32_t enterprise_number;
int ll_type;
struct data_string ll_addr;
if (!buffer_allocate(&duid.buffer, duid.len, MDL)) {
log_fatal("Out of memory storing DUID");
}
- duid.data = (char *)duid.buffer->data;
+ duid.data = (unsigned char *)duid.buffer->data;
putUShort(duid.buffer->data, DUID_EN);
putULong(duid.buffer->data + 2, enterprise_number);
memcpy(duid.buffer->data + 6, val, len);
if (!buffer_allocate(&duid.buffer, duid.len, MDL)) {
log_fatal("Out of memory storing DUID");
}
- duid.data = (char *)duid.buffer->data;
+ duid.data = (unsigned char *)duid.buffer->data;
putUShort(duid.buffer->data, DUID_LL);
putULong(duid.buffer->data + 2, ll_type);
memcpy(duid.buffer->data + 4,
if (!buffer_allocate(&duid.buffer, duid.len, MDL)) {
log_fatal("Out of memory storing DUID");
}
- duid.data = (char *)duid.buffer->data;
+ duid.data = (unsigned char *)duid.buffer->data;
putUShort(duid.buffer->data, DUID_LLT);
putULong(duid.buffer->data + 2, ll_type);
putULong(duid.buffer->data + 4, llt_time);
if (!buffer_allocate(&duid.buffer, duid.len, MDL)) {
log_fatal("Out of memory storing DUID");
}
- duid.data = (char *)duid.buffer->data;
+ duid.data = (unsigned char *)duid.buffer->data;
putUShort(duid.buffer->data, duid_type_num);
memcpy(duid.buffer->data + 2, val, len);
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: db.c,v 1.81 2007/06/06 23:07:17 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <ctype.h>
#include <errno.h>
struct lease *lease;
{
int errors = 0;
- int i;
struct binding *b;
char *s;
const char *tval;
++errors;
}
if (lease -> uid_len) {
- int i;
s = quotify_buf (lease -> uid, lease -> uid_len, MDL);
if (s) {
errno = 0;
}
}
if (lease -> client_hostname &&
- db_printable (lease -> client_hostname)) {
+ db_printable((unsigned char *)lease->client_hostname)) {
s = quotify_string (lease -> client_hostname, MDL);
if (s) {
errno = 0;
if (!new_lease_file ())
return 0;
- if (!db_printable (host -> name))
+ if (!db_printable((unsigned char *)host->name))
return 0;
if (counting)
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. */
if (!new_lease_file ())
return 0;
- if (!db_printable (group -> name))
+ if (!db_printable((unsigned char *)group->name))
return 0;
if (counting)
#if defined (FAILOVER_PROTOCOL)
int write_failover_state (dhcp_failover_state_t *state)
{
- struct tm *t;
int errors = 0;
const char *tval;
{
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) {
struct class *class;
{
int errors = 0;
- int i;
if (lease_file_is_corrupt)
if (!new_lease_file ())
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: ddns.c,v 1.28 2007/05/17 18:27:11 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "dst/md5.h"
#include "minires/minires.h"
struct data_string ddns_dhcid;
struct binding_scope **scope;
struct iaddr addr;
- unsigned len;
struct data_string d1;
struct option_cache *oc;
int s1, s2;
struct data_string ddns_rev_name;
struct data_string ddns_dhcid;
isc_result_t rcode;
- struct binding *binding;
struct binding_scope **scope;
struct iaddr addr;
int result = 0;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dhcp.c,v 1.220 2007/05/21 22:09:07 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <errno.h>
#include <limits.h>
if (lease && lease -> client_hostname) {
if ((strlen (lease -> client_hostname) <= 64) &&
- db_printable (lease -> client_hostname))
+ db_printable((unsigned char *)lease->client_hostname))
s = lease -> client_hostname;
else
s = "Hostname Unsuitable for Printing";
int ours = 0;
struct option_cache *oc;
struct data_string data;
- int status;
char msgbuf [1024]; /* XXX */
const char *s;
char smbuf [19];
if (lease && lease -> client_hostname) {
if ((strlen (lease -> client_hostname) <= 64) &&
- db_printable (lease -> client_hostname))
+ db_printable((unsigned char *)lease->client_hostname))
s = lease -> client_hostname;
else
s = "Hostname Unsuitable for Printing";
if (lease && lease -> client_hostname) {
if ((strlen (lease -> client_hostname) <= 64) &&
- db_printable (lease -> client_hostname))
+ db_printable((unsigned char *)lease->client_hostname))
s = lease -> client_hostname;
else
s = "Hostname Unsuitable for Printing";
if (lease && lease -> client_hostname) {
if ((strlen (lease -> client_hostname) <= 64) &&
- db_printable (lease -> client_hostname))
+ db_printable((unsigned char *)lease->client_hostname))
s = lease -> client_hostname;
else
s = "Hostname Unsuitable for Printing";
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, gip;
- unsigned i, j;
+ unsigned i;
int nulltp;
struct sockaddr_in to;
struct in_addr from;
struct packet outgoing;
struct hardware hto;
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;
option_state_allocate (&options, MDL);
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;
TIME ping_timeout;
TIME lease_cltt;
struct in_addr from;
unsigned i, j;
- int s1, s2;
- int val;
+ int s1;
int ignorep;
/* If we're already acking this lease, don't do it again. */
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;
const char *s;
if (!state)
if (lease -> client_hostname) {
if ((strlen (lease -> client_hostname) <= 64) &&
- db_printable (lease -> client_hostname))
+ db_printable((unsigned char *)lease->client_hostname))
s = lease -> client_hostname;
else
s = "Hostname Unsuitable for Printing";
struct data_string d1;
int have_client_identifier = 0;
struct data_string client_identifier;
- int status;
struct hardware h;
/* Quick check to see if the peer has leases. */
if (option_cache_allocate(&oc, MDL)) {
a = &packet->interface->addresses[0];
if (make_const_data(&oc->expression,
- (char *)a, sizeof(*a),
+ (unsigned char *)a, sizeof(*a),
0, 0, MDL)) {
option_code_hash_lookup(&oc->option,
dhcp_universe.code_hash,
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char ocopyright[] =
-"$Id: dhcpd.c,v 1.129 2007/07/03 10:34:18 shane Exp $ Copyright 2004-2007 Internet Systems Consortium.";
-#endif
-
- static char copyright[] =
+static char copyright[] =
"Copyright 2004-2007 Internet Systems Consortium.";
static char arr [] = "All rights reserved.";
static char message [] = "Internet Systems Consortium DHCP Server";
#include <syslog.h>
#include <errno.h>
#include <limits.h>
+#include <sys/types.h>
+#include <signal.h>
static void usage(void);
int fd;
int i, status;
struct servent *ent;
- unsigned char *s;
+ char *s;
int cftest = 0;
int lftest = 0;
#ifndef DEBUG
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;
if (++i == argc)
usage ();
for (s = argv [i]; *s; s++)
- if (!isdigit (*s))
+ if (!isdigit ((unsigned char)*s))
log_fatal ("%s: not a valid UDP port",
argv [i]);
status = atoi (argv [i]);
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",
memcpy(d.buffer->data + sizeof(status_code),
status_message, d.len - sizeof(status_code));
if (!save_option_buffer(&dhcpv6_universe, opt_state,
- d.buffer, (char *)d.data, d.len,
+ d.buffer, (unsigned char *)d.data, d.len,
D6O_STATUS_CODE, 0)) {
log_error("set_status_code: error saving status code.");
ret_val = 0;
struct dhcpv6_packet *reply) {
struct option_cache *oc;
struct data_string server_oro;
- char *server_id_data;
+ const unsigned char *server_id_data;
int server_id_len;
reply->msg_type = DHCPV6_REPLY;
oc = lookup_option(&dhcpv6_universe, *opt_state, D6O_SERVERID);
if (oc == NULL) {
if (server_id == NULL) {
- server_id_data = (char *)server_duid.data;
+ server_id_data = server_duid.data;
server_id_len = server_duid.len;
} else {
- server_id_data = (char *)server_id->data;
+ server_id_data = server_id->data;
server_id_len = server_id->len;
}
if (!save_option_buffer(&dhcpv6_universe, *opt_state,
- NULL, server_id_data, server_id_len,
- D6O_SERVERID, 0)) {
+ NULL, (unsigned char *)server_id_data,
+ server_id_len, D6O_SERVERID, 0)) {
log_error("start_reply: "
"error saving server identifier.");
return 0;
D6O_RECONF_ACCEPT);
if (oc != NULL) {
if (!save_option_buffer(&dhcpv6_universe, *opt_state,
- NULL, "", 0, D6O_RECONF_ACCEPT, 0)) {
+ NULL, (unsigned char *)"", 0,
+ D6O_RECONF_ACCEPT, 0)) {
log_error("start_reply: "
"error saving RECONF_ACCEPT option.");
option_state_dereference(opt_state, MDL);
*/
build_server_oro(&server_oro, *opt_state, MDL);
if (!save_option_buffer(&dhcpv6_universe, *opt_state,
- server_oro.buffer, (char *)server_oro.data,
+ server_oro.buffer,
+ (unsigned char *)server_oro.data,
server_oro.len, D6O_ORO, 0)) {
log_error("start_reply: error saving server ORO.");
data_string_forget(&server_oro, MDL);
const struct data_string *requested_addr) {
struct in6_addr tmp_addr;
isc_result_t result;
- struct iaddrmatch match;
if (requested_addr->len < sizeof(tmp_addr)) {
return ISC_R_INVALIDARG;
struct ipv6_pool *p;
int i;
int start_pool;
- int attempts;
+ unsigned int attempts;
/*
* First, find the link address where the packet from the client
struct host_decl *packet_host;
int matched_packet_host;
struct option_cache *ia;
- int rapid_commit;
char reply_data[65536];
struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data;
int reply_ofs = (int)((char *)reply->options - (char *)reply);
packet->options, D6O_RAPID_COMMIT);
if (oc != NULL) {
if (!save_option_buffer(&dhcpv6_universe,
- opt_state, NULL, "", 0,
+ opt_state, NULL,
+ (unsigned char *)"", 0,
D6O_RAPID_COMMIT, 0)) {
log_error("start_reply: error saving "
"RAPID_COMMIT option.");
*/
iaid = getULong(cli_enc_opt_data.data);
ia_na = NULL;
- if (ia_na_allocate(&ia_na, iaid, client_id->data,
+ if (ia_na_allocate(&ia_na, iaid, (char *)client_id->data,
client_id->len, MDL) != ISC_R_SUCCESS) {
log_fatal("lease_to_client: no memory for ia_na.");
}
*/
existing_ia_na = NULL;
if (ia_na_hash_lookup(&existing_ia_na, ia_active,
- (char *)ia_na->iaid_duid.data,
+ (unsigned char *)
+ ia_na->iaid_duid.data,
ia_na->iaid_duid.len, MDL) == 0) {
existing_ia_na = NULL;
}
}
if (fixed_addr.len == 16) {
- struct iaaddr *store_iaaddr;
-
/*
* Store the address.
*
* it up later.
*/
if (host != NULL) {
- change_host_uid(host, client_id->data,
+ change_host_uid(host, (char *)client_id->data,
client_id->len);
}
/*
struct data_string *d = &ia_na->iaid_duid;
old_ia_na = NULL;
if (ia_na_hash_lookup(&old_ia_na, ia_active,
- (char *)d->data,
+ (unsigned char *)d->data,
d->len, MDL)) {
ia_na_hash_delete(ia_active,
- (char *)d->data,
+ (unsigned char *)
+ d->data,
d->len, MDL);
ia_na_dereference(&old_ia_na, MDL);
}
"memory adding IAADDR");
}
ia_na_hash_add(ia_active,
- (char *)ia_na->iaid_duid.data,
+ (unsigned char *)
+ ia_na->iaid_duid.data,
ia_na->iaid_duid.len,
ia_na, MDL);
write_ia_na(ia_na);
* into our reply packet. Defined in RFC 3315, section 22.4.
*/
/* option number */
- putShort(reply_data+reply_ofs, D6O_IA_NA);
+ putShort((unsigned char *)reply_data+reply_ofs, D6O_IA_NA);
/* option length */
- putUShort(reply_data+reply_ofs+2, len + 12);
+ putUShort((unsigned char *)reply_data+reply_ofs+2, len + 12);
/* IA_NA, copied from the client */
memcpy(reply_data+reply_ofs+4, cli_enc_opt_data.data, 4);
/* T1 and T2, set previously */
- putULong(reply_data+reply_ofs+8, t1);
- putULong(reply_data+reply_ofs+12, t2);
+ putULong((unsigned char *)reply_data+reply_ofs+8, t1);
+ putULong((unsigned char *)reply_data+reply_ofs+12, t2);
/*
* Get ready for next IA_NA.
static void
dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) {
struct data_string client_id;
- struct option_cache *oc;
/*
* Validate our input.
* section 22.4.
*/
/* option number */
- putUShort(reply_data+(*reply_ofs), D6O_IA_NA);
+ putUShort((unsigned char *)reply_data+(*reply_ofs), D6O_IA_NA);
/* option length */
- putUShort(reply_data+(*reply_ofs)+2, len + 12);
+ putUShort((unsigned char *)reply_data+(*reply_ofs)+2, len + 12);
/* IA_NA, copied from the client */
memcpy(reply_data+(*reply_ofs)+4, ia_na_id, 4);
/* t1 and t2, odd that we need them, but here it is */
- putULong(reply_data+(*reply_ofs)+8, 0);
- putULong(reply_data+(*reply_ofs)+12, 0);
+ putULong((unsigned char *)reply_data+(*reply_ofs)+8, 0);
+ putULong((unsigned char *)reply_data+(*reply_ofs)+12, 0);
/*
* Get ready for next IA_NA.
struct option_state *cli_enc_opt_state;
struct host_decl *host;
struct option_state *host_opt_state;
- char tmp_addr[INET6_ADDRSTRLEN];
- int len;
struct data_string iaaddr;
struct data_string fixed_addr;
int iaaddr_is_found;
*/
oc = lookup_option(&dhcpv6_universe, opt_state, D6O_SERVERID);
if (oc == NULL) {
- if (!save_option_buffer(&dhcpv6_universe, opt_state,
- NULL, (char *)server_duid.data,
+ if (!save_option_buffer(&dhcpv6_universe, opt_state, NULL,
+ (unsigned char *)server_duid.data,
server_duid.len, D6O_SERVERID, 0)) {
log_error("iterate_over_ia_na: "
"error saving server identifier.");
/*
* Find existing IA_NA.
*/
- if (ia_na_make_key(&key, iaid, client_id->data,
+ if (ia_na_make_key(&key, iaid,
+ (char *)client_id->data,
client_id->len,
MDL) != ISC_R_SUCCESS) {
log_fatal("iterate_over_ia_na: no memory for "
existing_ia_na = NULL;
if (ia_na_hash_lookup(&existing_ia_na, ia_active,
- (char *)key.data, key.len, MDL)) {
+ (unsigned char *)key.data,
+ key.len, MDL)) {
/*
* Make sure this address is in the IA_NA.
*/
* section 22.4.
*/
/* option number */
- putUShort(reply_data+(*reply_ofs), D6O_IA_NA);
+ putUShort((unsigned char *)reply_data+(*reply_ofs), D6O_IA_NA);
/* option length */
- putUShort(reply_data+(*reply_ofs)+2, len + 12);
+ putUShort((unsigned char *)reply_data+(*reply_ofs)+2, len + 12);
/* IA_NA, copied from the client */
memcpy(reply_data+(*reply_ofs)+4, ia_na_id, 4);
/* t1 and t2, odd that we need them, but here it is */
- putULong(reply_data+(*reply_ofs)+8, 0);
- putULong(reply_data+(*reply_ofs)+12, 0);
+ putULong((unsigned char *)reply_data+(*reply_ofs)+8, 0);
+ putULong((unsigned char *)reply_data+(*reply_ofs)+12, 0);
/*
* Get ready for next IA_NA.
goto exit;
}
- if (!packet6_len_okay(enc_opt_data.data, enc_opt_data.len)) {
+ if (!packet6_len_okay((char *)enc_opt_data.data, enc_opt_data.len)) {
log_error("dhcpv6_forw_relay: encapsulated packet too short.");
goto exit;
}
u_int32_t tid;
char tmp_addr[INET6_ADDRSTRLEN];
const void *addr;
- struct option_cache *oc;
- struct data_string tmp_ds;
memset(&s, 0, sizeof(s));
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: failover.c,v 1.73 2007/06/01 22:26:01 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
{
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");
{
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;
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) {
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.");
omapi_object_t *id,
omapi_object_t *p)
{
- int i;
-
if (p -> type != dhcp_type_failover_listener)
return ISC_R_INVALIDARG;
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;
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_SERVER_STARTUP) ? 1 : 0;
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;
int dhcp_failover_state_pool_check (dhcp_failover_state_t *state)
{
- struct lease *lp;
struct shared_network *s;
struct pool *p;
void dhcp_failover_keepalive (void *vs)
{
- dhcp_failover_state_t *state = vs;
}
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");
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)
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;
omapi_object_t *connection,
int msg_type, u_int32_t xid, ...)
{
- unsigned count = 0;
unsigned size = 0;
int bad_option = 0;
int opix = 0;
{
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");
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;
{
struct shared_network *s;
struct pool *p;
- struct lease *l, *n;
+ struct lease *l;
int i;
#define FREE_LEASES 0
#define ACTIVE_LEASES 1
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: mdb.c,v 1.92 2007/06/08 18:56:30 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "omapip/hash.h"
void
change_host_uid(struct host_decl *host, const char *uid, int len) {
- struct host_decl *old_entry;
-
/* XXX: should consolidate this type of code throughout */
if (host_uid_hash == NULL) {
if (!host_new_hash(&host_uid_hash, HOST_HASH_SIZE, MDL)) {
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. */
const unsigned char *haddr, unsigned hlen,
const char *file, int line)
{
- struct host_decl *foo;
struct hardware h;
h.hlen = hlen + 1;
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;
struct pool *pool;
struct lease **lpchain;
{
- 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;
- isc_result_t status;
struct lease *lt = (struct lease *)0;
+#if !defined(COMPACT_LEASES)
+ isc_result_t status;
+#endif
/* All subnets should have attached shared network structures. */
if (!share) {
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) {
int pimmediate;
{
struct lease *lp, **lq, *prev;
- TIME lp_next_state;
#if defined (FAILOVER_PROTOCOL)
int do_pool_check = 0;
void *vpool;
{
struct pool *pool;
- struct lease *lt = (struct lease *)0;
struct lease *next = (struct lease *)0;
struct lease *lease = (struct lease *)0;
#define FREE_LEASES 0
{
struct shared_network *s;
struct pool *p;
- struct hash_bucket *hb;
int i;
struct lease *l;
struct lease **lptr[RESERVED_LEASES+1];
*/
void
ia_na_remove_all_iaaddr(struct ia_na *ia_na, const char *file, int line) {
- int i, j;
+ int i;
for (i=0; i<ia_na->num_iaaddr; i++) {
iaaddr_dereference(&(ia_na->iaaddr[i]), file, line);
iaaddr_dereference(&tmp, MDL);
if (ia_na->num_iaaddr <= 0) {
ia_na_hash_delete(ia_active,
- (char *)ia_na->iaid_duid.data,
+ (unsigned char*)ia_na->iaid_duid.data,
ia_na->iaid_duid.len, MDL);
}
ia_na_dereference(&ia_na, MDL);
return change_leases(ia_na, decline_lease6);
}
+#ifdef DHCPv6
/*
* Helper function to output leases.
*/
return ISC_R_SUCCESS;
}
-#ifdef DHCPv6
/*
* Write all DHCPv6 information.
*/
useful, you have Brian and BCtel to thank. Any limitations in the
code are a result of mistakes on my part. -- Ted Lemon */
-#ifndef lint
-static char copyright[] =
-"$Id: omapi.c,v 1.61 2007/05/19 19:16:27 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
{
struct lease *lease;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
isc_result_t dhcp_lease_destroy (omapi_object_t *h, const char *file, int line)
{
struct lease *lease;
- isc_result_t status;
- u_int8_t flagbuf;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
{
struct lease *lease;
isc_result_t status;
- int updatep = 0;
if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
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;
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;
{
struct pool *pool;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_pool)
return ISC_R_INVALIDARG;
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;
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. */
/* If we get to here without finding a pool, no valid key was
omapi_data_string_t *name,
omapi_typed_data_t *value)
{
- struct class *class;
- struct class *superclass = 0;
- isc_result_t status;
- int foo;
-
if (h -> type != dhcp_type_class)
return ISC_R_INVALIDARG;
isc_result_t dhcp_class_destroy (omapi_object_t *h, const char *file, int line)
{
struct class *class;
- isc_result_t status;
- int i;
if (h -> type != dhcp_type_class && h -> type != dhcp_type_subclass)
return ISC_R_INVALIDARG;
class -> name = (char *)0;
}
if (class -> billed_leases) {
+ int i;
for (i = 0; i < class -> lease_limit; i++) {
if (class -> billed_leases [i]) {
lease_dereference (&class -> billed_leases [i],
omapi_data_string_t *name,
omapi_typed_data_t *value)
{
- struct class *subclass = 0;
- struct class *superclass = 0;
- isc_result_t status;
- int foo;
-
if (h -> type != dhcp_type_subclass)
return ISC_R_INVALIDARG;
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: salloc.c,v 1.6 2006/02/24 23:16:32 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: stables.c,v 1.39 2007/05/19 22:03:51 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <syslog.h>