iPXE
|
PXE Boot Menus. More...
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <byteswap.h>
#include <curses.h>
#include <ipxe/console.h>
#include <ipxe/dhcp.h>
#include <ipxe/keys.h>
#include <ipxe/timer.h>
#include <ipxe/uri.h>
#include <ipxe/ansicol.h>
#include <usr/dhcpmgmt.h>
#include <usr/autoboot.h>
Go to the source code of this file.
Data Structures | |
struct | pxe_menu_item |
A PXE boot menu item. More... | |
struct | pxe_menu |
A PXE boot menu. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | pxe_menu_parse (struct pxe_menu **menu) |
Parse and allocate PXE boot menu. More... | |
static void | pxe_menu_draw_item (struct pxe_menu *menu, unsigned int index, int selected) |
Draw PXE boot menu item. More... | |
static int | pxe_menu_select (struct pxe_menu *menu) |
Make selection from PXE boot menu. More... | |
static int | pxe_menu_prompt_and_select (struct pxe_menu *menu) |
Prompt for (and make selection from) PXE boot menu. More... | |
int | pxe_menu_boot (struct net_device *netdev) |
Boot using PXE boot menu. More... | |
PXE Boot Menus.
Definition in file pxemenu.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Parse and allocate PXE boot menu.
menu | PXE boot menu to fill in |
rc | Return status code |
It is the callers responsibility to eventually free the allocated boot menu.
Definition at line 88 of file pxemenu.c.
References DBG, dhcp_pxe_boot_menu::desc, dhcp_pxe_boot_menu::desc_len, DHCP_PXE_BOOT_MENU, DHCP_PXE_BOOT_MENU_PROMPT, ENOMEM, ENOSPC, fetch_raw_setting(), le16_to_cpu, memcpy(), memset(), NULL, dhcp_pxe_boot_menu_prompt::prompt, rc, strerror(), setting::tag, dhcp_pxe_boot_menu_prompt::timeout, dhcp_pxe_boot_menu::type, and zalloc().
Referenced by pxe_menu_boot().
|
static |
Draw PXE boot menu item.
menu | PXE boot menu |
index | Index of item to draw |
selected | Item is selected |
Definition at line 193 of file pxemenu.c.
References color_set, COLS, CPAIR_DEFAULT, CPAIR_PXE, pxe_menu_item::desc, index, pxe_menu::items, len, LINES, move(), mvprintw, NULL, pxe_menu::num_items, and snprintf().
Referenced by pxe_menu_select().
|
static |
Make selection from PXE boot menu.
menu | PXE boot menu |
rc | Return status code |
Definition at line 219 of file pxemenu.c.
References color_set, CPAIR_DEFAULT, CR, CTRL_C, ECANCELED, endwin(), ESC, getkey(), initscr(), key, KEY_DOWN, KEY_MIN, KEY_UP, LF, NULL, pxe_menu::num_items, printf(), pxe_menu_draw_item(), rc, pxe_menu::selection, start_color, and toupper().
Referenced by pxe_menu_prompt_and_select().
|
static |
Prompt for (and make selection from) PXE boot menu.
menu | PXE boot menu |
rc | Return status code |
Definition at line 281 of file pxemenu.c.
References CTRL_C, currticks(), ECANCELED, ESC, getkey(), iskey(), key, KEY_F8, len, printf(), pxe_menu::prompt, pxe_menu_select(), rc, start, TICKS_PER_SEC, and pxe_menu::timeout.
Referenced by pxe_menu_boot().
int pxe_menu_boot | ( | struct net_device * | netdev | ) |
Boot using PXE boot menu.
rc | Return status code |
Note that a success return status indicates that a PXE boot menu item has been selected, and that the DHCP session should perform a boot server request/ack.
Definition at line 344 of file pxemenu.c.
References assert(), ENOMEM, fetch_next_server_and_filename(), find_settings(), free, pxe_menu::items, netdev, NULL, pxe_menu_parse(), pxe_menu_prompt_and_select(), pxebs(), PXEBS_SETTINGS_NAME, rc, pxe_menu::selection, pxe_menu_item::type, uri_put(), uriboot(), and URIBOOT_NO_SAN.