/* vim: set filetype=c:
 *
 **************************************************************************
 *
 * Boot-ROM-Code to load an operating system across a TCP/IP network.
 *
 * Module:  udp.h86
 * Purpose: Definitions for implementing the user datagram 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: udp.h86,v 1.5 2007/01/06 18:30:47 gkminix Exp $
 */

#ifndef KERNEL_NET_UDP_H86
#define KERNEL_NET_UDP_H86


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



/*
 **************************************************************************
 *
 * Definition of UDP header
 */
struct udphdr {
	__u16 udp_source;
	__u16 udp_dest;
	__u16 udp_len;
	__u16 udp_check;
};



/*
 **************************************************************************
 *
 * Definitions of pseudo header to compute UDP checkusm
 */
struct pshdr {
	t_ipaddr srcip;
	t_ipaddr destip;
	__u8     pad;
	__u8     protocol;
	__u16    length;
};



/*
 **************************************************************************
 * 
 * Default UDP timeout
 */
#define UDP_TIMEOUT	20		/* 20 seconds default timeout	*/



/*
 **************************************************************************
 * 
 * Assembler routines for UDP processing
 */

/* Compute UDP header checksum */
extern __u16 udpchksum(__u8 *pbuf, size_t plen,
				__u8 *ubuf, size_t ulen,
				__fptr dbuf, size_t dlen);

#endif

