/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2010,2011 Free Software Foundation, Inc.
*
* 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/datetime.h>
static char *
{
return NULL;
}
static void
{
char c;
+ grub_strlen (suffix)];
}
static void
{
*masksize = -1;
*router_ip = 0;
if (ptr[0] != GRUB_NET_BOOTP_RFC1048_MAGIC_0
return;
{
/* Pad tag. */
if (tagtype == GRUB_NET_BOOTP_PAD)
continue;
/* End tag. */
if (tagtype == GRUB_NET_BOOTP_END)
return;
switch (tagtype)
{
case GRUB_NET_BOOTP_NETMASK:
if (taglength == 4)
{
int i = 0;
/* Calculate the mask size */
while (invmask)
{
invmask >>= 1;
i++;
}
*masksize = (32 - i);
}
break;
case GRUB_NET_BOOTP_ROUTER:
if (taglength >= 4)
break;
default: break;
}
}
}
static void
{
if (ptr[0] != GRUB_NET_BOOTP_RFC1048_MAGIC_0
return;
{
/* Pad tag. */
if (tagtype == GRUB_NET_BOOTP_PAD)
continue;
/* End tag. */
if (tagtype == GRUB_NET_BOOTP_END)
return;
switch (tagtype)
{
case GRUB_NET_BOOTP_NETMASK:
if (taglength == 4)
{
}
break;
case GRUB_NET_BOOTP_ROUTER:
if (taglength >= 4)
{
}
break;
case GRUB_NET_BOOTP_DNS:
{
int i;
for (i = 0; i < taglength / 4; i++)
{
struct grub_net_network_level_address s;
grub_net_add_dns_server (&s);
}
}
break;
case GRUB_NET_BOOTP_HOSTNAME:
break;
case GRUB_NET_BOOTP_DOMAIN:
break;
case GRUB_NET_BOOTP_ROOT_PATH:
break;
break;
/* If you need any other options please contact GRUB
development team. */
}
}
}
struct grub_net_network_level_interface *
struct grub_net_card *card,
const struct grub_net_bootp_packet *bp,
{
else
if (device)
*device = 0;
if (path)
*path = 0;
if (! inter)
{
grub_print_error ();
return 0;
}
if (bp->gateway_ip)
{
}
{
}
if (is_def)
{
grub_print_error ();
{
grub_print_error ();
}
}
{
sizeof (bp->server_name));
if (is_def && !grub_net_default_server)
{
grub_print_error ();
}
{
grub_print_error ();
}
}
{
grub_print_error ();
if (*path)
{
char *slash;
if (slash)
*slash = 0;
else
**path = 0;
}
}
{
}
else
return inter;
}
void
struct grub_net_card *card)
{
char *name;
if (!name)
{
grub_print_error ();
return;
}
if (grub_errno)
grub_print_error ();
else
{
":dhcp_tmp", sizeof (":dhcp_tmp") - 1) == 0)
{
break;
}
}
}
static char
{
if (val < 10)
return val + '0';
}
static grub_err_t
{
int num;
if (argc < 4)
break;
if (!inter)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
if (grub_errno)
return grub_errno;
if (ptr[0] != GRUB_NET_BOOTP_RFC1048_MAGIC_0
while (1)
{
/* Pad tag. */
if (tagtype == 0)
continue;
/* End tag. */
if (tagtype == 0xff)
break;
}
{
if (!val)
return grub_errno;
else
return GRUB_ERR_NONE;
}
{
int i;
for (i = 0; i < taglength; i++)
else
{
}
return GRUB_ERR_NONE;
}
{
int i;
if (!val)
return grub_errno;
for (i = 0; i < taglength; i++)
{
}
else
return GRUB_ERR_NONE;
}
return grub_error (GRUB_ERR_BAD_ARGUMENT,
}
/* FIXME: allow to specify mac address. */
static grub_err_t
{
unsigned j = 0;
int interval;
{
continue;
ncards++;
}
if (!ifaces)
return grub_errno;
j = 0;
{
continue;
if (j)
card->num_ifaces++;
{
unsigned i;
for (i = 0; i < j; i++)
return grub_errno;
}
j++;
}
{
int done = 0;
for (j = 0; j < ncards; j++)
{
grub_int32_t t;
continue;
if (!nb)
{
return grub_errno;
}
if (err)
{
return err;
}
if (err)
{
return err;
}
done = 1;
{
t = 0;
}
pack->ident = grub_cpu_to_be32 (t);
if (err)
return err;
&target);
if (err)
return err;
}
if (!done)
break;
}
err = GRUB_ERR_NONE;
for (j = 0; j < ncards; j++)
{
continue;
grub_error_push ();
}
return err;
}
void
grub_bootp_init (void)
{
N_("[CARD]"),
N_("perform a bootp autoconfiguration"));
N_("VAR INTERFACE NUMBER DESCRIPTION"),
N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value."));
}
void
grub_bootp_fini (void)
{
}