orphan
[debian/elilo] / fs / netfs.h
1 /*
2  *  Copyright (C) 2001-2003 Hewlett-Packard Co.
3  *      Contributed by Stephane Eranian <eranian@hpl.hp.com>
4  *
5  * This file is part of the ELILO, the EFI Linux boot loader.
6  *
7  *  ELILO is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  ELILO is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with ELILO; see the file COPYING.  If not, write to the Free
19  *  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20  *  02111-1307, USA.
21  *
22  * Please check out the elilo.txt for complete documentation on how
23  * to use this program.
24  */
25
26 #ifndef __NETLFS_H__
27 #define __NETLFS_H__
28
29 #include <efi.h>
30 #include <efilib.h>
31
32 #define NETFS_BOOTFILE_MAXLEN   256
33
34 typedef struct {
35         EFI_IP_ADDRESS cln_ipaddr;
36         EFI_IP_ADDRESS srv_ipaddr;
37         EFI_IP_ADDRESS netmask;
38         EFI_IP_ADDRESS gw_ipaddr;
39         UINT8           hw_addr[16];
40         CHAR16          hostname[255];  /* 255 limitation of DHCP protocol */
41         CHAR16          domainame[255]; /* 255 limitation of DHCP protocol */
42         CHAR16          bootfile[NETFS_BOOTFILE_MAXLEN];  /* name of file downloaded (BOOTP/DHCP) */
43         BOOLEAN         using_pxe;
44         BOOLEAN         started;
45         BOOLEAN         using_ipv6;
46 } netfs_info_t;
47
48
49 INTERFACE_DECL(_netfs_interface_t);
50
51 typedef struct _netfs_interface_t {
52         EFI_STATUS (*netfs_name)(struct _netfs_interface_t *this, CHAR16 *name, UINTN maxlen);
53         EFI_STATUS (*netfs_open)(struct _netfs_interface_t *this, CHAR16 *name, UINTN *fd);
54         EFI_STATUS (*netfs_read)(struct _netfs_interface_t *this, UINTN fd, VOID *buf, UINTN *size);
55         EFI_STATUS (*netfs_close)(struct _netfs_interface_t *this, UINTN fd);
56         EFI_STATUS (*netfs_infosize)(struct _netfs_interface_t *this, UINTN fd, UINT64 *size);
57         EFI_STATUS (*netfs_seek)(struct _netfs_interface_t *this, UINTN fd, UINT64 newpos);
58         EFI_STATUS (*netfs_query_layer)(struct _netfs_interface_t *this, UINT16 server_type, UINT16 layer, UINTN maxlen, CHAR16 *str);
59         EFI_STATUS (*netfs_getinfo)(struct _netfs_interface_t *this, netfs_info_t *info);
60 } netfs_interface_t;
61
62 #define NETFS_PROTOCOL \
63     { 0x6746de4f, 0xcc1e, 0x4c5f, {0xb7, 0xfb, 0x85, 0x6a, 0x5d, 0x69, 0x0f, 0x06} }
64
65 extern EFI_STATUS netfs_install(VOID);
66 extern EFI_STATUS netfs_uninstall(VOID);
67
68 #endif /* __NETFS_H__ */