]>
Commit | Line | Data |
---|---|---|
1 | /*++ | |
2 | This file contains an 'Intel UEFI Application' and is | |
3 | licensed for Intel CPUs and chipsets under the terms of your | |
4 | license agreement with Intel or your vendor. This file may | |
5 | be modified by the user, subject to additional terms of the | |
6 | license agreement | |
7 | --*/ | |
8 | /*++ | |
9 | ||
10 | Copyright (c) 2011 Intel Corporation. All rights reserved | |
11 | This software and associated documentation (if any) is furnished | |
12 | under a license and may only be used or copied in accordance | |
13 | with the terms of the license. Except as permitted by such | |
14 | license, no part of this software or documentation may be | |
15 | reproduced, stored in a retrieval system, or transmitted in any | |
16 | form or by any means without the express written consent of | |
17 | Intel Corporation. | |
18 | ||
19 | --*/ | |
20 | ||
21 | /** @file | |
22 | Hello World response page | |
23 | ||
24 | **/ | |
25 | ||
26 | #include <WebServer.h> | |
27 | ||
28 | ||
29 | /** | |
30 | Respond with the Hello World page | |
31 | ||
32 | @param [in] SocketFD The socket's file descriptor to add to the list. | |
33 | @param [in] pPort The WSDT_PORT structure address | |
34 | @param [out] pbDone Address to receive the request completion status | |
35 | ||
36 | @retval EFI_SUCCESS The request was successfully processed | |
37 | ||
38 | **/ | |
39 | EFI_STATUS | |
40 | HelloPage ( | |
41 | IN int SocketFD, | |
42 | IN WSDT_PORT * pPort, | |
43 | OUT BOOLEAN * pbDone | |
44 | ) | |
45 | { | |
46 | EFI_STATUS Status; | |
47 | ||
48 | DBG_ENTER ( ); | |
49 | ||
50 | // | |
51 | // Send the Hello World page | |
52 | // | |
53 | for ( ; ; ) { | |
54 | // | |
55 | // Send the page header | |
56 | // | |
57 | Status = HttpPageHeader ( SocketFD, pPort, L"Hello World" ); | |
58 | if ( EFI_ERROR ( Status )) { | |
59 | break; | |
60 | } | |
61 | ||
62 | // | |
63 | // Send the page body | |
64 | // | |
65 | Status = HttpSendAnsiString ( SocketFD, | |
66 | pPort, | |
67 | "<h1>Hello World</h1>\r\n" | |
68 | "<p>\r\n" | |
69 | " This response was generated by the UEFI web server application.\r\n" | |
70 | "</p>\r\n" ); | |
71 | if ( EFI_ERROR ( Status )) { | |
72 | break; | |
73 | } | |
74 | ||
75 | // | |
76 | // Send the page trailer | |
77 | // | |
78 | Status = HttpPageTrailer ( SocketFD, pPort, pbDone ); | |
79 | break; | |
80 | } | |
81 | ||
82 | // | |
83 | // Return the operation status | |
84 | // | |
85 | DBG_EXIT_STATUS ( Status ); | |
86 | return Status; | |
87 | } |