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 FILE_SECBOOT ( PERMITTED );
26 
27 /** @file
28  *
29  * Login UI
30  *
31  */
32 
33 #include <ipxe/dynui.h>
34 #include <ipxe/login_ui.h>
35 
36 static struct dynamic_item username;
37 static struct dynamic_item password;
38 
39 static struct dynamic_ui login = {
40  .items = {
41  .prev = &password.list,
42  .next = &username.list,
43  },
44  .count = 2,
45 };
46 
47 static 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 
57 static 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 
68 int login_ui ( void ) {
69 
70  return show_form ( &login );
71 }
Login UI.
A dynamic user interface item.
Definition: dynui.h:30
struct list_head * next
Next list entry.
Definition: list.h:21
static struct dynamic_ui login
Definition: login_ui.c:39
struct list_head items
Dynamic user interface items.
Definition: dynui.h:24
FILE_SECBOOT(PERMITTED)
static struct dynamic_item password
Definition: login_ui.c:37
int show_form(struct dynamic_ui *dynui)
Show form.
Definition: form_ui.c:508
A dynamic user interface.
Definition: dynui.h:16
struct list_head * prev
Previous list entry.
Definition: list.h:23
static struct dynamic_item username
Definition: login_ui.c:36
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Dynamic user interfaces.
int login_ui(void)
Definition: login_ui.c:68
struct list_head list
List of dynamic user interface items.
Definition: dynui.h:32
#define DYNUI_SECRET
Dynamic user interface item represents a secret.
Definition: dynui.h:49