remove all trailing whitespace
[grub2/phcoder/solaris.git] / include / grub / net.h
blobc6d71d5b62834f4273cad0922789ae35ef0a50d3
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2002,2007 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_NET_HEADER
20 #define GRUB_NET_HEADER 1
22 #include <grub/symbol.h>
23 #include <grub/err.h>
24 #include <grub/types.h>
26 struct grub_net;
28 struct grub_net_dev
30 /* The device name. */
31 const char *name;
33 /* FIXME: Just a template. */
34 int (*probe) (struct grub_net *net, const void *addr);
35 void (*reset) (struct grub_net *net);
36 int (*poll) (struct grub_net *net);
37 void (*transmit) (struct grub_net *net, const void *destip,
38 unsigned srcsock, unsigned destsock, const void *packet);
39 void (*disable) (struct grub_net *net);
41 /* The next net device. */
42 struct grub_net_dev *next;
44 typedef struct grub_net_dev *grub_net_dev_t;
46 struct grub_fs;
48 struct grub_net
50 /* The net name. */
51 const char *name;
53 /* The underlying disk device. */
54 grub_net_dev_t dev;
56 /* The binding filesystem. */
57 struct grub_fs *fs;
59 /* FIXME: More data would be required, such as an IP address, a mask,
60 a gateway, etc. */
62 /* Device-specific data. */
63 void *data;
65 typedef struct grub_net *grub_net_t;
67 /* FIXME: How to abstract networks? More consideration is necessary. */
69 /* Note: Networks are very different from disks, because networks must
70 be initialized before used, and the status is persistent. */
72 #endif /* ! GRUB_NET_HEADER */