iPXE
|
PXE FILE API. More...
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/uaccess.h>
#include <ipxe/posix_io.h>
#include <ipxe/features.h>
#include <pxe.h>
#include <realmode.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
FEATURE (FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2) | |
static PXENV_EXIT_t | pxenv_file_open (struct s_PXENV_FILE_OPEN *file_open) |
FILE OPEN. More... | |
static PXENV_EXIT_t | pxenv_file_close (struct s_PXENV_FILE_CLOSE *file_close) |
FILE CLOSE. More... | |
static PXENV_EXIT_t | pxenv_file_select (struct s_PXENV_FILE_SELECT *file_select) |
FILE SELECT. More... | |
static PXENV_EXIT_t | pxenv_file_read (struct s_PXENV_FILE_READ *file_read) |
FILE READ. More... | |
static PXENV_EXIT_t | pxenv_get_file_size (struct s_PXENV_GET_FILE_SIZE *get_file_size) |
GET FILE SIZE. More... | |
static PXENV_EXIT_t | pxenv_file_exec (struct s_PXENV_FILE_EXEC *file_exec) |
FILE EXEC. More... | |
static PXENV_EXIT_t | pxenv_file_cmdline (struct s_PXENV_FILE_CMDLINE *file_cmdline) |
FILE CMDLINE. More... | |
static PXENV_EXIT_t | pxenv_file_api_check (struct s_PXENV_FILE_API_CHECK *file_api_check) |
FILE API CHECK. More... | |
Variables | |
struct pxe_api_call pxe_file_api [] | __pxe_api_call |
PXE file API. More... | |
PXE FILE API.
Definition in file pxe_file.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
FEATURE | ( | FEATURE_MISC | , |
"PXEXT" | , | ||
DHCP_EB_FEATURE_PXE_EXT | , | ||
2 | |||
) |
|
static |
FILE OPEN.
file_open | Pointer to a struct s_PXENV_FILE_OPEN |
s_PXENV_FILE_OPEN::FileName | URL of file to open |
PXENV_EXIT_SUCCESS | File was opened |
PXENV_EXIT_FAILURE | File was not opened |
s_PXENV_FILE_OPEN::Status | PXE status code |
s_PXENV_FILE_OPEN::FileHandle | Handle of opened file |
Definition at line 55 of file pxe_file.c.
References copy_from_user(), DBG, file_open(), open(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, real_to_user(), and strlen_user().
|
static |
FILE CLOSE.
file_close | Pointer to a struct s_PXENV_FILE_CLOSE |
s_PXENV_FILE_CLOSE::FileHandle | File handle |
PXENV_EXIT_SUCCESS | File was closed |
PXENV_EXIT_FAILURE | File was not closed |
s_PXENV_FILE_CLOSE::Status | PXE status code |
Definition at line 97 of file pxe_file.c.
References close, DBG, s_PXENV_FILE_CLOSE::FileHandle, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, and s_PXENV_FILE_CLOSE::Status.
|
static |
FILE SELECT.
file_select | Pointer to a struct s_PXENV_FILE_SELECT |
s_PXENV_FILE_SELECT::FileHandle | File handle |
PXENV_EXIT_SUCCESS | File has been checked for readiness |
PXENV_EXIT_FAILURE | File has not been checked for readiness |
s_PXENV_FILE_SELECT::Status | PXE status code |
s_PXENV_FILE_SELECT::Ready | Indication of readiness |
Definition at line 118 of file pxe_file.c.
References DBG, s_PXENV_FILE_SELECT::FileHandle, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, RDY_READ, s_PXENV_FILE_SELECT::Ready, select(), and s_PXENV_FILE_SELECT::Status.
|
static |
FILE READ.
file_read | Pointer to a struct s_PXENV_FILE_READ |
s_PXENV_FILE_READ::FileHandle | File handle |
s_PXENV_FILE_READ::BufferSize | Size of data buffer |
s_PXENV_FILE_READ::Buffer | Data buffer |
PXENV_EXIT_SUCCESS | Data has been read from file |
PXENV_EXIT_FAILURE | Data has not been read from file |
s_PXENV_FILE_READ::Status | PXE status code |
s_PXENV_FILE_READ::Ready | Indication of readiness |
s_PXENV_FILE_READ::BufferSize | Length of data read |
Definition at line 150 of file pxe_file.c.
References buffer, DBG, file_read(), len, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, read_user(), and real_to_user().
|
static |
GET FILE SIZE.
get_file_size | Pointer to a struct s_PXENV_GET_FILE_SIZE |
s_PXENV_GET_FILE_SIZE::FileHandle | File handle |
PXENV_EXIT_SUCCESS | File size has been determined |
PXENV_EXIT_FAILURE | File size has not been determined |
s_PXENV_GET_FILE_SIZE::Status | PXE status code |
s_PXENV_GET_FILE_SIZE::FileSize | Size of file |
Definition at line 184 of file pxe_file.c.
References DBG, s_PXENV_GET_FILE_SIZE::FileHandle, s_PXENV_GET_FILE_SIZE::FileSize, fsize(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, and s_PXENV_GET_FILE_SIZE::Status.
|
static |
FILE EXEC.
file_exec | Pointer to a struct s_PXENV_FILE_EXEC |
s_PXENV_FILE_EXEC::Command | Command to execute |
PXENV_EXIT_SUCCESS | Command was executed successfully |
PXENV_EXIT_FAILURE | Command was not executed successfully |
s_PXENV_FILE_EXEC::Status | PXE status code |
Definition at line 212 of file pxe_file.c.
References command, s_PXENV_FILE_EXEC::Command, command_len, copy_from_user(), DBG, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, rc, real_to_user(), s_PXENV_FILE_EXEC::Status, strlen_user(), and system.
|
static |
FILE CMDLINE.
file_cmdline | Pointer to a struct s_PXENV_FILE_CMDLINE |
s_PXENV_FILE_CMDLINE::Buffer | Buffer to contain command line |
s_PXENV_FILE_CMDLINE::BufferSize | Size of buffer |
PXENV_EXIT_SUCCESS | Command was executed successfully |
PXENV_EXIT_FAILURE | Command was not executed successfully |
s_PXENV_FILE_EXEC::Status | PXE status code |
s_PXENV_FILE_EXEC::BufferSize | Length of command line (including NUL) |
Definition at line 253 of file pxe_file.c.
References buffer, s_PXENV_FILE_CMDLINE::Buffer, s_PXENV_FILE_CMDLINE::BufferSize, copy_to_user(), DBG, len, pxe_cmdline, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, real_to_user(), s_PXENV_FILE_CMDLINE::Status, and strlen().
|
static |
FILE API CHECK.
file_exec | Pointer to a struct s_PXENV_FILE_API_CHECK |
s_PXENV_FILE_API_CHECK::Magic | Inbound magic number (0x91d447b2) |
PXENV_EXIT_SUCCESS | Command was executed successfully |
PXENV_EXIT_FAILURE | Command was not executed successfully |
s_PXENV_FILE_API_CHECK::Status | PXE status code |
s_PXENV_FILE_API_CHECK::Magic | Outbound magic number (0xe9c17b20) |
s_PXENV_FILE_API_CHECK::Provider | "iPXE" (0x45585067) |
s_PXENV_FILE_API_CHECK::APIMask | API function bitmask |
s_PXENV_FILE_API_CHECK::Flags | Reserved |
Definition at line 291 of file pxe_file.c.
References s_PXENV_FILE_API_CHECK::APIMask, DBG, s_PXENV_FILE_API_CHECK::Flags, for_each_table_entry, s_PXENV_FILE_API_CHECK::Magic, offset, pxe_api_call::opcode, s_PXENV_FILE_API_CHECK::Provider, PXE_API_CALLS, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_FILE_MAX, PXENV_FILE_MIN, PXENV_STATUS_BAD_FUNC, PXENV_STATUS_OUT_OF_RESOURCES, PXENV_STATUS_SUCCESS, s_PXENV_FILE_API_CHECK::Size, and s_PXENV_FILE_API_CHECK::Status.
struct pxe_api_call pxe_file_api [] __pxe_api_call |
PXE file API.
Definition at line 329 of file pxe_file.c.