#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.57 1999/02/25 23:30:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.58 1999/03/10 20:39:02 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Rewrite the lease database... */
rewrite_client_leases ();
+ /* XXX */
+/* config_counter(&snd_counter, &rcv_counter); */
+
/* If no broadcast interfaces were discovered, call the script
and tell it so. */
if (!interfaces) {
/* Set up the option buffer... */
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet, 0,
- &options, (struct agent_options *)0, 0, 0, 0);
+ &options, (struct agent_options *)0,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
struct client_lease *lease;
{
unsigned char request = DHCPREQUEST;
- int i;
+ int i, j;
+ unsigned char *tmp, *digest;
+ unsigned char *old_digest_loc;
struct option_state options;
struct option_cache *oc;
/* Set up the option buffer... */
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet, 0,
- &options, (struct agent_options *)0, 0, 0, 0);
+ &options, (struct agent_options *)0,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
/* Set up the option buffer... */
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet, 0,
- &options, (struct agent_options *)0, 0, 0, 0);
+ &options, (struct agent_options *)0,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
/* Set up the option buffer... */
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet, 0,
- &options, (struct agent_options *)0, 0, 0, 0);
+ &options, (struct agent_options *)0,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
#ifndef lint
static char copyright[] =
-"$Id: options.c,v 1.35 1999/02/24 17:56:46 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: options.c,v 1.36 1999/03/10 20:39:22 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
of vendor options using the same routine. */
int cons_options (inpacket, outpacket, mms, options,
- agent_options, overload, terminate, bootpp)
+ agent_options, overload, terminate, bootpp, prl)
struct packet *inpacket;
struct dhcp_packet *outpacket;
int mms;
int overload; /* Overload flags that may be set. */
int terminate;
int bootpp;
+ struct data_string *prl;
{
#define PRIORITY_COUNT 300
int priority_list [PRIORITY_COUNT];
priority_list [priority_len++] = DHO_DHCP_MESSAGE;
priority_list [priority_len++] = DHO_DHCP_REQUESTED_ADDRESS;
- /* If the client has provided a list of options that it wishes
- returned, use it to prioritize. Otherwise, prioritize
- based on the default priority list. */
+ if (prl && prl -> len > 0) {
+ data_string_truncate (prl, (PRIORITY_COUNT - priority_len));
- if (inpacket)
- op = lookup_option (inpacket -> options.dhcp_hash,
- DHO_DHCP_PARAMETER_REQUEST_LIST);
- else
- op = (struct option_cache *)0;
-
- if (op)
- evaluate_option_cache (&ds, inpacket,
- &inpacket -> options, op);
-
- if (ds.len > 0) {
- data_string_truncate (&ds,
- (PRIORITY_COUNT - priority_len));
-
- for (i = 0; i < ds.len; i++)
- priority_list [priority_len++] = ds.data [i];
- data_string_forget (&ds, "cons_options");
+ for (i = 0; i < prl -> len; i++)
+ priority_list [priority_len++] = prl -> data [i];
} else {
/* First, hardcode some more options that ought to be
sent first... */