2002-12-27 08:53:07 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* GRUB -- GRand Unified Bootloader
|
2007-07-21 23:32:33 +00:00
|
|
|
* Copyright (C) 2002,2007 Free Software Foundation, Inc.
|
2002-12-27 08:53:07 +00:00
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
2002-12-27 08:53:07 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-21 23:32:33 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2002-12-27 08:53:07 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
2002-12-27 08:53:07 +00:00
|
|
|
* 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
|
2007-07-21 23:32:33 +00:00
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
2002-12-27 08:53:07 +00:00
|
|
|
*/
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#ifndef GRUB_NET_HEADER
|
|
|
|
#define GRUB_NET_HEADER 1
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#include <grub/symbol.h>
|
|
|
|
#include <grub/err.h>
|
|
|
|
#include <grub/types.h>
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_net;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_net_dev
|
2002-12-27 08:53:07 +00:00
|
|
|
{
|
|
|
|
/* The device name. */
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
/* FIXME: Just a template. */
|
2004-04-04 13:46:03 +00:00
|
|
|
int (*probe) (struct grub_net *net, const void *addr);
|
|
|
|
void (*reset) (struct grub_net *net);
|
|
|
|
int (*poll) (struct grub_net *net);
|
|
|
|
void (*transmit) (struct grub_net *net, const void *destip,
|
2002-12-27 08:53:07 +00:00
|
|
|
unsigned srcsock, unsigned destsock, const void *packet);
|
2004-04-04 13:46:03 +00:00
|
|
|
void (*disable) (struct grub_net *net);
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
/* The next net device. */
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_net_dev *next;
|
2002-12-27 08:53:07 +00:00
|
|
|
};
|
2004-04-04 13:46:03 +00:00
|
|
|
typedef struct grub_net_dev *grub_net_dev_t;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_fs;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_net
|
2002-12-27 08:53:07 +00:00
|
|
|
{
|
|
|
|
/* The net name. */
|
|
|
|
const char *name;
|
2009-06-10 21:04:23 +00:00
|
|
|
|
2002-12-27 08:53:07 +00:00
|
|
|
/* The underlying disk device. */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_net_dev_t dev;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
/* The binding filesystem. */
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_fs *fs;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
/* FIXME: More data would be required, such as an IP address, a mask,
|
|
|
|
a gateway, etc. */
|
2009-06-10 21:04:23 +00:00
|
|
|
|
2002-12-27 08:53:07 +00:00
|
|
|
/* Device-specific data. */
|
|
|
|
void *data;
|
|
|
|
};
|
2004-04-04 13:46:03 +00:00
|
|
|
typedef struct grub_net *grub_net_t;
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
/* FIXME: How to abstract networks? More consideration is necessary. */
|
|
|
|
|
|
|
|
/* Note: Networks are very different from disks, because networks must
|
|
|
|
be initialized before used, and the status is persistent. */
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#endif /* ! GRUB_NET_HEADER */
|