iPXE
login_ui.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 *
19 * You can also choose to distribute this program under the terms of
20 * the Unmodified Binary Distribution Licence (as given in the file
21 * COPYING.UBDL), provided that you have satisfied its requirements.
22 */
23
24FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25FILE_SECBOOT ( PERMITTED );
26
27/** @file
28 *
29 * Login UI
30 *
31 */
32
33#include <ipxe/dynui.h>
34#include <ipxe/login_ui.h>
35
36static struct dynamic_item username;
37static struct dynamic_item password;
38
39static struct dynamic_ui login = {
40 .items = {
41 .prev = &password.list,
42 .next = &username.list,
43 },
44 .count = 2,
45};
46
47static struct dynamic_item username = {
48 .list = {
49 .prev = &login.items,
50 .next = &password.list,
51 },
52 .name = "username",
53 .text = "Username",
54 .index = 0,
55};
56
57static struct dynamic_item password = {
58 .list = {
59 .prev = &username.list,
60 .next = &login.items,
61 },
62 .name = "password",
63 .text = "Password",
64 .index = 1,
65 .flags = DYNUI_SECRET,
66};
67
68int login_ui ( void ) {
69
70 return show_form ( &login );
71}
Dynamic user interfaces.
#define DYNUI_SECRET
Dynamic user interface item represents a secret.
Definition dynui.h:49
int show_form(struct dynamic_ui *dynui)
Show form.
Definition form_ui.c:508
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
int login_ui(void)
Definition login_ui.c:68
static struct dynamic_item username
Definition login_ui.c:36
static struct dynamic_item password
Definition login_ui.c:37
static struct dynamic_ui login
Definition login_ui.c:39
Login UI.
A dynamic user interface item.
Definition dynui.h:30
A dynamic user interface.
Definition dynui.h:16