Send TFTP_ERROR on tftp premature close. Several cleanups

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-07-06 12:53:37 +02:00
parent 72b9ad936a
commit b975df6348
10 changed files with 262 additions and 153 deletions

View file

@ -1,3 +1,21 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2010,2011 Free Software Foundation, Inc.
*
* GRUB 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 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/net/ethernet.h>
@ -8,6 +26,28 @@
#include <grub/time.h>
#include <grub/net/arp.h>
#define LLCADDRMASK 0x7f
struct etherhdr
{
grub_uint8_t dst[6];
grub_uint8_t src[6];
grub_uint16_t type;
} __attribute__ ((packed));
struct llchdr
{
grub_uint8_t dsap;
grub_uint8_t ssap;
grub_uint8_t ctrl;
} __attribute__ ((packed));
struct snaphdr
{
grub_uint8_t oui[3];
grub_uint16_t type;
} __attribute__ ((packed));
grub_err_t
send_ethernet_packet (struct grub_net_network_level_interface *inf,
struct grub_net_buff *nb,