/***********************************************************
        Copyright 1996 by Carnegie Mellon University

                      All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of CMU not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/

#ifndef DHCP_H
#define DHCP_H

/* ANSI function prototypes or empty arg list? */
#ifdef  __STDC__
#define P(args) args
#else
#define P(args) ()
#endif

struct opts {
	int cur;
	int len;
};


#define DHCPDISCOVER	((unsigned char) 1)
#define DHCPOFFER		((unsigned char) 2)
#define DHCPREQUEST		((unsigned char) 3)
#define DHCPDECLINE		((unsigned char) 4)
#define DHCPACK			((unsigned char) 5)
#define DHCPNACK			((unsigned char) 6)
#define DHCPRELEASE		((unsigned char) 7)
#define DHCPINFORM		((unsigned char) 8)

#define SNAME_OFFSET 44
#define FILE_OFFSET 108
/* I think VEND_OFFSET must be skipping over the first 4 bytes of the vend field, on the assumption that it 
   contains the appropriate cookie.
*/
#define VEND_OFFSET 240
#define MAXCLIIDLEN	256

extern void report_cliid P((int log, struct shared_bindata *cl));
extern char * cliid_btoa P((struct shared_bindata *cl));
extern void report_assignment P((int category, int is_dhcp, int is_dynamic, char * ipaddr, char * ipaddr_name, struct client_info *cl));

#define RACATEGORY_ASSIGNED 1
#define RACATEGORY_OFFERRED 2
#define RACATEGORY_RENEWED  3
#define RACATEGORY_MAX 3
static char *report_assignment_category[] = {
	"INVALID-REPORT-ASSIGNED-CATEGORY", "ASSIGNED", "OFFERRED", "RENEWED"
};

#define BINDATA_EQ(a,b) (((a)->length)==((b)->length) && \
		!bcmp((a)->data,(b)->data,(a)->length))
#define CLIID_EQ BINDATA_EQ

#endif

/* In the event we need to force a "Client FQDN" option into the response,
we may need to call do_opts(), pretending that the client included the 
"Client FQDN" option in the value of a "Paramater Request List" Option.
So we'll have need for a dummy "Parameter Request List" option value that
consists of the TAG_CLIENT_FQDN, preceeded by a tag count (1). */
static u_char request_client_fqdn_option[] = {1, TAG_CLIENT_FQDN};
