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 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 
26 /** @file
27  *
28  * Login UI
29  *
30  */
31 
32 #include <ipxe/dynui.h>
33 #include <ipxe/login_ui.h>
34 
35 static struct dynamic_item username;
36 static struct dynamic_item password;
37 
38 static struct dynamic_ui login = {
39  .items = {
40  .prev = &password.list,
41  .next = &username.list,
42  },
43  .count = 2,
44 };
45 
46 static struct dynamic_item username = {
47  .list = {
48  .prev = &login.items,
49  .next = &password.list,
50  },
51  .name = "username",
52  .text = "Username",
53  .index = 0,
54 };
55 
56 static struct dynamic_item password = {
57  .list = {
58  .prev = &username.list,
59  .next = &login.items,
60  },
61  .name = "password",
62  .text = "Password",
63  .index = 1,
64  .flags = DYNUI_SECRET,
65 };
66 
67 int login_ui ( void ) {
68 
69  return show_form ( &login );
70 }
Login UI.
A dynamic user interface item.
Definition: dynui.h:29
struct list_head * next
Next list entry.
Definition: list.h:20
static struct dynamic_ui login
Definition: login_ui.c:38
struct list_head items
Dynamic user interface items.
Definition: dynui.h:23
static struct dynamic_item password
Definition: login_ui.c:36
int show_form(struct dynamic_ui *dynui)
Show form.
Definition: form_ui.c:507
A dynamic user interface.
Definition: dynui.h:15
struct list_head * prev
Previous list entry.
Definition: list.h:22
static struct dynamic_item username
Definition: login_ui.c:35
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Dynamic user interfaces.
int login_ui(void)
Definition: login_ui.c:67
struct list_head list
List of dynamic user interface items.
Definition: dynui.h:31
#define DYNUI_SECRET
Dynamic user interface item represents a secret.
Definition: dynui.h:48