/* vim: set filetype=c:
 *
 **************************************************************************
 *
 * Boot-ROM-Code to load an operating system across a TCP/IP network.
 *
 * Module:  bootp.h86
 * Purpose: Definitions for implementing the BOOTP protocol
 * Entries: none
 *
 **************************************************************************
 *
 * Copyright (C) 1995-2007 Gero Kuhlmann <gero@gkminix.han.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: bootp.h86,v 1.7 2007/01/06 18:30:46 gkminix Exp $
 */

#ifndef KERNEL_ARPA_BOOTP_H86
#define KERNEL_ARPA_BOOTP_H86



/*
 **************************************************************************
 *
 * This file can only get included into target C source files
 */
#if defined(_ASSEMBLY_) || !defined(_TARGET_) || !defined(_BOOTROM_)
# error This file can only get included into target C source files
#endif



/*
 **************************************************************************
 *
 * We need some includes before we can include this file
 */
#include <common.h86>
#include <net/in.h86>
#include <net/bootp.h86>



/*
 **************************************************************************
 *
 * BOOTP UDP port numbers:
 */
#define BOOTP_S_PORT	IPPORT_BOOTPS	/* BOOTP server port		*/
#define BOOTP_C_PORT	IPPORT_BOOTPC	/* BOOTP client port		*/



/*
 **************************************************************************
 *
 * Various definitions:
 */
#define DHCP_GRACE_TIMEOUT	2	/* DHCP grace timeout (seconds)	*/
#define BOOTP_RETRIES		8	/* No. of retries		*/
#define BOOTP_TIMEOUT		4	/* Min. # of sec read timeout	*/
#define BOOTP_MAX_TIMEOUT	64	/* Max. # of sec read timeout	*/



/*
 **************************************************************************
 *
 * Public BOOTP/DHCP routines local to the ARPA library
 */

/* Retrieve BOOTP vendor extensions file */
extern void get_ext(const __u8 *ftag);

/* Initialize BOOTP buffer handling */
extern void init_bootp_buf(void);

/* Set new BOOTP buffer pointer */
extern bool_t new_bootp_buf(short id);

/* Set size of new BOOTP buffer */
extern size_t set_bootp_size(size_t minsize, bool_t update);


#endif

