]>
Commit | Line | Data |
---|---|---|
4684b66f | 1 | /** @file\r |
2 | Definitions for the web server.\r | |
3 | \r | |
9f7f5161 | 4 | Copyright (c) 2011-2012, Intel Corporation\r |
4684b66f | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _WEB_SERVER_H_\r | |
16 | #define _WEB_SERVER_H_\r | |
17 | \r | |
18 | #include <errno.h>\r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <Guid/EventGroup.h>\r | |
22 | \r | |
b30abe7d | 23 | #include <Register/Msr.h>\r |
4684b66f | 24 | #include <Library/BaseMemoryLib.h>\r |
25 | #include <Library/DebugLib.h>\r | |
9f7f5161 | 26 | #include <Library/MemoryAllocationLib.h>\r |
4684b66f | 27 | #include <Library/PcdLib.h>\r |
28 | #include <Library/UefiApplicationEntryPoint.h>\r | |
29 | #include <Library/UefiBootServicesTableLib.h>\r | |
30 | #include <Library/UefiLib.h>\r | |
31 | #include <Protocol/BlockIo.h>\r | |
32 | \r | |
33 | #include <netinet/in.h>\r | |
34 | \r | |
35 | #include <sys/EfiSysCall.h>\r | |
36 | #include <sys/poll.h>\r | |
37 | #include <sys/socket.h>\r | |
38 | \r | |
d3a595ce | 39 | #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.\r |
4684b66f | 40 | #pragma warning ( disable : 4054 )\r |
41 | #pragma warning ( disable : 4152 )\r | |
d3a595ce | 42 | #endif // defined(_MSC_VER)\r |
4684b66f | 43 | \r |
44 | //------------------------------------------------------------------------------\r | |
45 | // Pages\r | |
46 | //------------------------------------------------------------------------------\r | |
47 | \r | |
9f7f5161 | 48 | #define PAGE_ACPI_APIC L"/APIC"\r |
49 | #define PAGE_ACPI_BGRT L"/BGRT"\r | |
4684b66f | 50 | #define PAGE_ACPI_DSDT L"/DSDT"\r |
51 | #define PAGE_ACPI_FADT L"/FADT"\r | |
9f7f5161 | 52 | #define PAGE_ACPI_HPET L"/HPET"\r |
53 | #define PAGE_ACPI_MCFG L"/MCFG"\r | |
4684b66f | 54 | #define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"\r |
55 | #define PAGE_ACPI_RSDP_30 L"/RSDP3.0"\r | |
56 | #define PAGE_ACPI_RSDT L"/RSDT"\r | |
9f7f5161 | 57 | #define PAGE_ACPI_SSDT L"/SSDT"\r |
58 | #define PAGE_ACPI_TCPA L"/TCPA"\r | |
59 | #define PAGE_ACPI_UEFI L"/UEFI"\r | |
4684b66f | 60 | #define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"\r |
61 | #define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"\r | |
62 | #define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"\r | |
63 | #define PAGE_RUNTIME_SERVICES_TABLE L"/RuntimeServicesTable"\r | |
64 | \r | |
65 | //------------------------------------------------------------------------------\r | |
66 | // Signatures\r | |
67 | //------------------------------------------------------------------------------\r | |
68 | \r | |
9f7f5161 | 69 | #define APIC_SIGNATURE 0x43495041\r |
70 | #define BGRT_SIGNATURE 0x54524742\r | |
4684b66f | 71 | #define DSDT_SIGNATURE 0x54445344\r |
72 | #define FADT_SIGNATURE 0x50434146\r | |
9f7f5161 | 73 | #define HPET_SIGNATURE 0x54455048\r |
74 | #define MCFG_SIGNATURE 0x4746434d\r | |
75 | #define SSDT_SIGNATURE 0x54445353\r | |
76 | #define TCPA_SIGNATURE 0x41504354\r | |
77 | #define UEFI_SIGNATURE 0x49464555\r | |
4684b66f | 78 | \r |
79 | //------------------------------------------------------------------------------\r | |
80 | // Macros\r | |
81 | //------------------------------------------------------------------------------\r | |
82 | \r | |
83 | #if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */\r | |
84 | #define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry\r | |
85 | #define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit\r | |
86 | #define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value\r | |
87 | #define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value\r | |
88 | #define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value\r | |
89 | #define DBG_EXIT_TF(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", returning %s\n", (FALSE == Status) ? L"FALSE" : L"TRUE" )) ///< Display routine with TRUE/FALSE value\r | |
90 | #else // _MSC_VER\r | |
91 | #define DBG_ENTER()\r | |
92 | #define DBG_EXIT()\r | |
93 | #define DBG_EXIT_DEC(Status)\r | |
94 | #define DBG_EXIT_HEX(Status)\r | |
95 | #define DBG_EXIT_STATUS(Status)\r | |
96 | #define DBG_EXIT_TF(Status)\r | |
97 | #endif // _MSC_VER\r | |
98 | \r | |
99 | #define DIM(x) ( sizeof ( x ) / sizeof ( x[0] )) ///< Compute the number of entries in an array\r | |
100 | \r | |
101 | //------------------------------------------------------------------------------\r | |
102 | // Constants\r | |
103 | //------------------------------------------------------------------------------\r | |
104 | \r | |
105 | #define DEBUG_SOCKET_POLL 0x00080000 ///< Display the socket poll messages\r | |
106 | #define DEBUG_PORT_WORK 0x00040000 ///< Display the port work messages\r | |
f6e5cdd5 | 107 | #define DEBUG_SERVER_LISTEN 0x00020000 ///< Display the socket poll messages\r |
4684b66f | 108 | #define DEBUG_HTTP_PORT 0x00010000 ///< Display HTTP port related messages\r |
109 | #define DEBUG_REQUEST 0x00008000 ///< Display the HTTP request messages\r | |
110 | \r | |
111 | #define HTTP_PORT_POLL_DELAY ( 2 * 1000 ) ///< Delay in milliseconds for attempts to open the HTTP port\r | |
112 | #define CLIENT_POLL_DELAY 50 ///< Delay in milliseconds between client polls\r | |
113 | \r | |
114 | #define TPL_WEB_SERVER TPL_CALLBACK ///< TPL for routine synchronization\r | |
115 | \r | |
116 | /**\r | |
117 | Verify new TPL value\r | |
118 | \r | |
119 | This macro which is enabled when debug is enabled verifies that\r | |
120 | the new TPL value is >= the current TPL value.\r | |
121 | **/\r | |
122 | #ifdef VERIFY_TPL\r | |
123 | #undef VERIFY_TPL\r | |
124 | #endif // VERIFY_TPL\r | |
125 | \r | |
126 | #if !defined(MDEPKG_NDEBUG)\r | |
127 | \r | |
128 | #define VERIFY_TPL(tpl) \\r | |
129 | { \\r | |
130 | EFI_TPL PreviousTpl; \\r | |
131 | \\r | |
132 | PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \\r | |
133 | gBS->RestoreTPL ( PreviousTpl ); \\r | |
134 | if ( PreviousTpl > tpl ) { \\r | |
135 | DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \\r | |
136 | ASSERT ( PreviousTpl <= tpl ); \\r | |
137 | } \\r | |
138 | }\r | |
139 | \r | |
140 | #else // MDEPKG_NDEBUG\r | |
141 | \r | |
142 | #define VERIFY_TPL(tpl)\r | |
143 | \r | |
144 | #endif // MDEPKG_NDEBUG\r | |
145 | \r | |
59bc0593 | 146 | #define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature\r |
4684b66f | 147 | \r |
148 | #define SPACES_ADDRESS_TO_DATA 2\r | |
149 | #define BYTES_ON_A_LINE 16\r | |
150 | #define SPACES_BETWEEN_BYTES 1\r | |
151 | #define SPACES_DATA_TO_ASCII 2\r | |
152 | \r | |
153 | \r | |
154 | //------------------------------------------------------------------------------\r | |
155 | // Protocol Declarations\r | |
156 | //------------------------------------------------------------------------------\r | |
157 | \r | |
158 | extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; ///< Component name protocol declaration\r | |
159 | extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2; ///< Component name 2 protocol declaration\r | |
160 | extern EFI_DRIVER_BINDING_PROTOCOL gDriverBinding; ///< Driver binding protocol declaration\r | |
161 | \r | |
162 | //------------------------------------------------------------------------------\r | |
163 | // Data Types\r | |
164 | //------------------------------------------------------------------------------\r | |
165 | \r | |
166 | /**\r | |
167 | Port control structure\r | |
168 | **/\r | |
169 | typedef struct {\r | |
170 | //\r | |
171 | // Buffer management\r | |
172 | //\r | |
173 | size_t RequestLength; ///< Request length in bytes\r | |
174 | size_t TxBytes; ///< Bytes in the TX buffer\r | |
59bc0593 | 175 | UINT8 Request[ 65536 ]; ///< Page request\r |
176 | UINT8 RxBuffer[ 65536 ]; ///< Receive buffer\r | |
177 | UINT8 TxBuffer[ 65536 ]; ///< Transmit buffer\r | |
4684b66f | 178 | } WSDT_PORT;\r |
179 | \r | |
180 | /**\r | |
181 | Web server control structure\r | |
182 | **/\r | |
183 | typedef struct {\r | |
184 | UINTN Signature; ///< Structure identification\r | |
185 | \r | |
186 | //\r | |
187 | // Image attributes\r | |
188 | //\r | |
189 | EFI_HANDLE ImageHandle; ///< Image handle\r | |
190 | \r | |
191 | //\r | |
192 | // HTTP port management\r | |
193 | //\r | |
f6e5cdd5 | 194 | BOOLEAN bRunning; ///< Web server running\r |
4684b66f | 195 | EFI_EVENT TimerEvent; ///< Timer to open HTTP port\r |
f6e5cdd5 | 196 | int HttpListenPort; ///< File descriptor for the HTTP listen port over TCP4\r |
197 | int HttpListenPort6; ///< File descriptor for the HTTP listen port over TCP6\r | |
4684b66f | 198 | \r |
199 | //\r | |
200 | // Client port management\r | |
201 | //\r | |
202 | nfds_t MaxEntries; ///< Maximum entries in the PortList array\r | |
203 | nfds_t Entries; ///< The current number of entries in the PortList array\r | |
204 | struct pollfd * pFdList; ///< List of socket file descriptors\r | |
205 | WSDT_PORT ** ppPortList; ///< List of port management structures\r | |
206 | } DT_WEB_SERVER;\r | |
207 | \r | |
59bc0593 | 208 | //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding\r |
4684b66f | 209 | \r |
210 | extern DT_WEB_SERVER mWebServer;\r | |
211 | \r | |
212 | /**\r | |
213 | Process an HTTP request\r | |
214 | \r | |
215 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
216 | @param [in] pPort The WSDT_PORT structure address\r | |
217 | @param [out] pbDone Address to receive the request completion status\r | |
218 | \r | |
219 | @retval EFI_SUCCESS The request was successfully processed\r | |
220 | \r | |
221 | **/\r | |
222 | typedef\r | |
223 | EFI_STATUS\r | |
224 | (* PFN_RESPONSE) (\r | |
225 | IN int SocketFD,\r | |
226 | IN WSDT_PORT * pPort,\r | |
227 | IN BOOLEAN * pbDone\r | |
228 | );\r | |
229 | \r | |
230 | /**\r | |
231 | Data structure to delcare page support routines\r | |
232 | **/\r | |
233 | typedef struct {\r | |
234 | UINT16 * pPageName; ///< Name of the page\r | |
235 | PFN_RESPONSE pfnResponse; ///< Routine to generate the response\r | |
236 | UINT16 * pDescription; ///< Description of the page\r | |
237 | } DT_PAGE;\r | |
238 | \r | |
59bc0593 | 239 | extern CONST DT_PAGE mPageList[]; ///< List of pages\r |
4684b66f | 240 | extern CONST UINTN mPageCount; ///< Number of pages\r |
241 | \r | |
242 | //------------------------------------------------------------------------------\r | |
243 | // Web Pages\r | |
244 | //------------------------------------------------------------------------------\r | |
245 | \r | |
9f7f5161 | 246 | /**\r |
247 | Respond with the APIC table\r | |
248 | \r | |
249 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
250 | @param [in] pPort The WSDT_PORT structure address\r | |
251 | @param [out] pbDone Address to receive the request completion status\r | |
252 | \r | |
253 | @retval EFI_SUCCESS The request was successfully processed\r | |
254 | \r | |
255 | **/\r | |
256 | EFI_STATUS\r | |
257 | AcpiApicPage (\r | |
258 | IN int SocketFD,\r | |
259 | IN WSDT_PORT * pPort,\r | |
260 | OUT BOOLEAN * pbDone\r | |
261 | );\r | |
262 | \r | |
263 | /**\r | |
264 | Respond with the BGRT table\r | |
265 | \r | |
266 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
267 | @param [in] pPort The WSDT_PORT structure address\r | |
268 | @param [out] pbDone Address to receive the request completion status\r | |
269 | \r | |
270 | @retval EFI_SUCCESS The request was successfully processed\r | |
271 | \r | |
272 | **/\r | |
273 | EFI_STATUS\r | |
274 | AcpiBgrtPage (\r | |
275 | IN int SocketFD,\r | |
276 | IN WSDT_PORT * pPort,\r | |
277 | OUT BOOLEAN * pbDone\r | |
278 | );\r | |
279 | \r | |
4684b66f | 280 | /**\r |
281 | Respond with the ACPI DSDT table\r | |
282 | \r | |
283 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
284 | @param [in] pPort The WSDT_PORT structure address\r | |
285 | @param [out] pbDone Address to receive the request completion status\r | |
286 | \r | |
287 | @retval EFI_SUCCESS The request was successfully processed\r | |
288 | \r | |
289 | **/\r | |
290 | EFI_STATUS\r | |
291 | AcpiDsdtPage (\r | |
292 | IN int SocketFD,\r | |
293 | IN WSDT_PORT * pPort,\r | |
294 | OUT BOOLEAN * pbDone\r | |
295 | );\r | |
296 | \r | |
297 | /**\r | |
298 | Respond with the ACPI FADT table\r | |
299 | \r | |
300 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
301 | @param [in] pPort The WSDT_PORT structure address\r | |
302 | @param [out] pbDone Address to receive the request completion status\r | |
303 | \r | |
304 | @retval EFI_SUCCESS The request was successfully processed\r | |
305 | \r | |
306 | **/\r | |
307 | EFI_STATUS\r | |
308 | AcpiFadtPage (\r | |
309 | IN int SocketFD,\r | |
310 | IN WSDT_PORT * pPort,\r | |
311 | OUT BOOLEAN * pbDone\r | |
312 | );\r | |
313 | \r | |
9f7f5161 | 314 | /**\r |
315 | Respond with the HPET table\r | |
316 | \r | |
317 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
318 | @param [in] pPort The WSDT_PORT structure address\r | |
319 | @param [out] pbDone Address to receive the request completion status\r | |
320 | \r | |
321 | @retval EFI_SUCCESS The request was successfully processed\r | |
322 | \r | |
323 | **/\r | |
324 | EFI_STATUS\r | |
325 | AcpiHpetPage (\r | |
326 | IN int SocketFD,\r | |
327 | IN WSDT_PORT * pPort,\r | |
328 | OUT BOOLEAN * pbDone\r | |
329 | );\r | |
330 | \r | |
331 | /**\r | |
332 | Respond with the MCFG table\r | |
333 | \r | |
334 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
335 | @param [in] pPort The WSDT_PORT structure address\r | |
336 | @param [out] pbDone Address to receive the request completion status\r | |
337 | \r | |
338 | @retval EFI_SUCCESS The request was successfully processed\r | |
339 | \r | |
340 | **/\r | |
341 | EFI_STATUS\r | |
342 | AcpiMcfgPage (\r | |
343 | IN int SocketFD,\r | |
344 | IN WSDT_PORT * pPort,\r | |
345 | OUT BOOLEAN * pbDone\r | |
346 | );\r | |
347 | \r | |
4684b66f | 348 | /**\r |
349 | Respond with the ACPI RSDP 1.0b table\r | |
350 | \r | |
351 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
352 | @param [in] pPort The WSDT_PORT structure address\r | |
353 | @param [out] pbDone Address to receive the request completion status\r | |
354 | \r | |
355 | @retval EFI_SUCCESS The request was successfully processed\r | |
356 | \r | |
357 | **/\r | |
358 | EFI_STATUS\r | |
359 | AcpiRsdp10Page (\r | |
360 | IN int SocketFD,\r | |
361 | IN WSDT_PORT * pPort,\r | |
362 | OUT BOOLEAN * pbDone\r | |
363 | );\r | |
364 | \r | |
365 | /**\r | |
366 | Respond with the ACPI RSDP 3.0 table\r | |
367 | \r | |
368 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
369 | @param [in] pPort The WSDT_PORT structure address\r | |
370 | @param [out] pbDone Address to receive the request completion status\r | |
371 | \r | |
372 | @retval EFI_SUCCESS The request was successfully processed\r | |
373 | \r | |
374 | **/\r | |
375 | EFI_STATUS\r | |
376 | AcpiRsdp30Page (\r | |
377 | IN int SocketFD,\r | |
378 | IN WSDT_PORT * pPort,\r | |
379 | OUT BOOLEAN * pbDone\r | |
380 | );\r | |
381 | \r | |
382 | /**\r | |
383 | Respond with the ACPI RSDT table\r | |
384 | \r | |
385 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
386 | @param [in] pPort The WSDT_PORT structure address\r | |
387 | @param [out] pbDone Address to receive the request completion status\r | |
388 | \r | |
389 | @retval EFI_SUCCESS The request was successfully processed\r | |
390 | \r | |
391 | **/\r | |
392 | EFI_STATUS\r | |
393 | AcpiRsdtPage (\r | |
394 | IN int SocketFD,\r | |
395 | IN WSDT_PORT * pPort,\r | |
396 | OUT BOOLEAN * pbDone\r | |
397 | );\r | |
398 | \r | |
9f7f5161 | 399 | /**\r |
400 | Respond with the SSDT table\r | |
401 | \r | |
402 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
403 | @param [in] pPort The WSDT_PORT structure address\r | |
404 | @param [out] pbDone Address to receive the request completion status\r | |
405 | \r | |
406 | @retval EFI_SUCCESS The request was successfully processed\r | |
407 | \r | |
408 | **/\r | |
409 | EFI_STATUS\r | |
410 | AcpiSsdtPage (\r | |
411 | IN int SocketFD,\r | |
412 | IN WSDT_PORT * pPort,\r | |
413 | OUT BOOLEAN * pbDone\r | |
414 | );\r | |
415 | \r | |
416 | /**\r | |
417 | Respond with the TCPA table\r | |
418 | \r | |
419 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
420 | @param [in] pPort The WSDT_PORT structure address\r | |
421 | @param [out] pbDone Address to receive the request completion status\r | |
422 | \r | |
423 | @retval EFI_SUCCESS The request was successfully processed\r | |
424 | \r | |
425 | **/\r | |
426 | EFI_STATUS\r | |
427 | AcpiTcpaPage (\r | |
428 | IN int SocketFD,\r | |
429 | IN WSDT_PORT * pPort,\r | |
430 | OUT BOOLEAN * pbDone\r | |
431 | );\r | |
432 | \r | |
433 | /**\r | |
434 | Respond with the UEFI table\r | |
435 | \r | |
436 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
437 | @param [in] pPort The WSDT_PORT structure address\r | |
438 | @param [out] pbDone Address to receive the request completion status\r | |
439 | \r | |
440 | @retval EFI_SUCCESS The request was successfully processed\r | |
441 | \r | |
442 | **/\r | |
443 | EFI_STATUS\r | |
444 | AcpiUefiPage (\r | |
445 | IN int SocketFD,\r | |
446 | IN WSDT_PORT * pPort,\r | |
447 | OUT BOOLEAN * pbDone\r | |
448 | );\r | |
449 | \r | |
4684b66f | 450 | /**\r |
451 | Respond with the boot services table\r | |
452 | \r | |
453 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
454 | @param [in] pPort The WSDT_PORT structure address\r | |
455 | @param [out] pbDone Address to receive the request completion status\r | |
456 | \r | |
457 | @retval EFI_SUCCESS The request was successfully processed\r | |
458 | \r | |
459 | **/\r | |
460 | EFI_STATUS\r | |
461 | BootServicesTablePage (\r | |
462 | IN int SocketFD,\r | |
463 | IN WSDT_PORT * pPort,\r | |
464 | OUT BOOLEAN * pbDone\r | |
465 | );\r | |
466 | \r | |
467 | /**\r | |
468 | Respond with the configuration tables\r | |
469 | \r | |
470 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
471 | @param [in] pPort The WSDT_PORT structure address\r | |
472 | @param [out] pbDone Address to receive the request completion status\r | |
473 | \r | |
474 | @retval EFI_SUCCESS The request was successfully processed\r | |
475 | \r | |
476 | **/\r | |
477 | EFI_STATUS\r | |
478 | ConfigurationTablePage (\r | |
479 | IN int SocketFD,\r | |
480 | IN WSDT_PORT * pPort,\r | |
481 | OUT BOOLEAN * pbDone\r | |
482 | );\r | |
483 | \r | |
484 | /**\r | |
485 | Respond with the DHCP options\r | |
486 | \r | |
487 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
488 | @param [in] pPort The WSDT_PORT structure address\r | |
489 | @param [out] pbDone Address to receive the request completion status\r | |
490 | \r | |
491 | @retval EFI_SUCCESS The request was successfully processed\r | |
492 | \r | |
493 | **/\r | |
494 | EFI_STATUS\r | |
495 | DhcpOptionsPage (\r | |
496 | IN int SocketFD,\r | |
497 | IN WSDT_PORT * pPort,\r | |
498 | OUT BOOLEAN * pbDone\r | |
499 | );\r | |
500 | \r | |
501 | /**\r | |
502 | Respond with the DXE services table\r | |
503 | \r | |
504 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
505 | @param [in] pPort The WSDT_PORT structure address\r | |
506 | @param [out] pbDone Address to receive the request completion status\r | |
507 | \r | |
508 | @retval EFI_SUCCESS The request was successfully processed\r | |
509 | \r | |
510 | **/\r | |
511 | EFI_STATUS\r | |
512 | DxeServicesTablePage (\r | |
513 | IN int SocketFD,\r | |
514 | IN WSDT_PORT * pPort,\r | |
515 | OUT BOOLEAN * pbDone\r | |
516 | );\r | |
517 | \r | |
f6e5cdd5 | 518 | /**\r |
519 | Respond with the Exit page\r | |
520 | \r | |
521 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
522 | @param [in] pPort The WSDT_PORT structure address\r | |
523 | @param [out] pbDone Address to receive the request completion status\r | |
524 | \r | |
525 | @retval EFI_SUCCESS The request was successfully processed\r | |
526 | \r | |
527 | **/\r | |
528 | EFI_STATUS\r | |
529 | ExitPage (\r | |
530 | IN int SocketFD,\r | |
531 | IN WSDT_PORT * pPort,\r | |
532 | OUT BOOLEAN * pbDone\r | |
533 | );\r | |
534 | \r | |
4684b66f | 535 | /**\r |
536 | Respond with the firmware status\r | |
537 | \r | |
538 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
539 | @param [in] pPort The WSDT_PORT structure address\r | |
540 | @param [out] pbDone Address to receive the request completion status\r | |
541 | \r | |
542 | @retval EFI_SUCCESS The request was successfully processed\r | |
543 | \r | |
544 | **/\r | |
545 | EFI_STATUS\r | |
546 | FirmwarePage (\r | |
547 | IN int SocketFD,\r | |
548 | IN WSDT_PORT * pPort,\r | |
549 | OUT BOOLEAN * pbDone\r | |
550 | );\r | |
551 | \r | |
552 | /**\r | |
553 | Respond with the handles in the system\r | |
554 | \r | |
555 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
556 | @param [in] pPort The WSDT_PORT structure address\r | |
557 | @param [out] pbDone Address to receive the request completion status\r | |
558 | \r | |
559 | @retval EFI_SUCCESS The request was successfully processed\r | |
560 | \r | |
561 | **/\r | |
562 | EFI_STATUS\r | |
563 | HandlePage (\r | |
564 | IN int SocketFD,\r | |
565 | IN WSDT_PORT * pPort,\r | |
566 | OUT BOOLEAN * pbDone\r | |
567 | );\r | |
568 | \r | |
569 | /**\r | |
570 | Respond with the Hello World page\r | |
571 | \r | |
572 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
573 | @param [in] pPort The WSDT_PORT structure address\r | |
574 | @param [out] pbDone Address to receive the request completion status\r | |
575 | \r | |
576 | @retval EFI_SUCCESS The request was successfully processed\r | |
577 | \r | |
578 | **/\r | |
579 | EFI_STATUS\r | |
580 | HelloPage (\r | |
581 | IN int SocketFD,\r | |
582 | IN WSDT_PORT * pPort,\r | |
583 | OUT BOOLEAN * pbDone\r | |
584 | );\r | |
585 | \r | |
586 | /**\r | |
587 | Respond with the list of known pages\r | |
588 | \r | |
589 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
590 | @param [in] pPort The WSDT_PORT structure address\r | |
591 | @param [out] pbDone Address to receive the request completion status\r | |
592 | \r | |
593 | @retval EFI_SUCCESS The request was successfully processed\r | |
594 | \r | |
595 | **/\r | |
596 | EFI_STATUS\r | |
597 | IndexPage (\r | |
598 | IN int SocketFD,\r | |
599 | IN WSDT_PORT * pPort,\r | |
9f7f5161 | 600 | OUT BOOLEAN * pbDone\r |
601 | );\r | |
602 | \r | |
603 | /**\r | |
604 | Page to display the memory map\r | |
605 | \r | |
606 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
607 | @param [in] pPort The WSDT_PORT structure address\r | |
608 | @param [out] pbDone Address to receive the request completion status\r | |
609 | \r | |
610 | @retval EFI_SUCCESS The request was successfully processed\r | |
611 | \r | |
612 | **/\r | |
613 | EFI_STATUS\r | |
614 | MemoryMapPage (\r | |
615 | IN int SocketFD,\r | |
616 | IN WSDT_PORT * pPort,\r | |
617 | OUT BOOLEAN * pbDone\r | |
618 | );\r | |
619 | \r | |
620 | /**\r | |
621 | Display the memory type registers\r | |
622 | \r | |
623 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
624 | @param [in] pPort The WSDT_PORT structure address\r | |
625 | @param [out] pbDone Address to receive the request completion status\r | |
626 | \r | |
627 | @retval EFI_SUCCESS The request was successfully processed\r | |
628 | \r | |
629 | **/\r | |
630 | EFI_STATUS\r | |
631 | MemoryTypeRegistersPage (\r | |
632 | IN int SocketFD,\r | |
633 | IN WSDT_PORT * pPort,\r | |
4684b66f | 634 | OUT BOOLEAN * pbDone\r |
635 | );\r | |
636 | \r | |
f6e5cdd5 | 637 | /**\r |
638 | Respond with the Ports page\r | |
639 | \r | |
640 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
641 | @param [in] pPort The WSDT_PORT structure address\r | |
642 | @param [out] pbDone Address to receive the request completion status\r | |
643 | \r | |
644 | @retval EFI_SUCCESS The request was successfully processed\r | |
645 | \r | |
646 | **/\r | |
647 | EFI_STATUS\r | |
648 | PortsPage (\r | |
649 | IN int SocketFD,\r | |
650 | IN WSDT_PORT * pPort,\r | |
651 | OUT BOOLEAN * pbDone\r | |
652 | );\r | |
653 | \r | |
4684b66f | 654 | /**\r |
655 | Page to reboot the system\r | |
656 | \r | |
657 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
658 | @param [in] pPort The WSDT_PORT structure address\r | |
659 | @param [out] pbDone Address to receive the request completion status\r | |
660 | \r | |
661 | @retval EFI_SUCCESS The request was successfully processed\r | |
662 | \r | |
663 | **/\r | |
664 | EFI_STATUS\r | |
665 | RebootPage (\r | |
666 | IN int SocketFD,\r | |
667 | IN WSDT_PORT * pPort,\r | |
668 | OUT BOOLEAN * pbDone\r | |
669 | );\r | |
670 | \r | |
671 | /**\r | |
672 | Respond with the runtime services table\r | |
673 | \r | |
674 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
675 | @param [in] pPort The WSDT_PORT structure address\r | |
676 | @param [out] pbDone Address to receive the request completion status\r | |
677 | \r | |
678 | @retval EFI_SUCCESS The request was successfully processed\r | |
679 | \r | |
680 | **/\r | |
681 | EFI_STATUS\r | |
682 | RuntimeSservicesTablePage (\r | |
683 | IN int SocketFD,\r | |
684 | IN WSDT_PORT * pPort,\r | |
685 | OUT BOOLEAN * pbDone\r | |
686 | );\r | |
687 | \r | |
688 | /**\r | |
689 | Respond with the system table\r | |
690 | \r | |
691 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
692 | @param [in] pPort The WSDT_PORT structure address\r | |
693 | @param [out] pbDone Address to receive the request completion status\r | |
694 | \r | |
695 | @retval EFI_SUCCESS The request was successfully processed\r | |
696 | \r | |
697 | **/\r | |
698 | EFI_STATUS\r | |
699 | SystemTablePage (\r | |
700 | IN int SocketFD,\r | |
701 | IN WSDT_PORT * pPort,\r | |
702 | OUT BOOLEAN * pbDone\r | |
703 | );\r | |
704 | \r | |
705 | //------------------------------------------------------------------------------\r | |
706 | // Support routines\r | |
707 | //------------------------------------------------------------------------------\r | |
708 | \r | |
709 | /**\r | |
710 | Display the EFI Table Header\r | |
711 | \r | |
712 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
713 | @param [in] pPort The WSDT_PORT structure address\r | |
714 | @param [in] pHeader Address of the EFI_TABLE_HEADER structure\r | |
715 | \r | |
716 | @retval EFI_SUCCESS The request was successfully processed\r | |
717 | \r | |
718 | **/\r | |
719 | EFI_STATUS\r | |
720 | EfiTableHeader (\r | |
721 | IN int SocketFD,\r | |
722 | IN WSDT_PORT * pPort,\r | |
723 | IN EFI_TABLE_HEADER * pHeader\r | |
724 | );\r | |
725 | \r | |
726 | /**\r | |
727 | Buffer the HTTP page header\r | |
728 | \r | |
729 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
730 | @param [in] pPort The WSDT_PORT structure address\r | |
731 | @param [in] pTitle A zero terminated Unicode title string\r | |
732 | \r | |
733 | @retval EFI_SUCCESS The request was successfully processed\r | |
734 | \r | |
735 | **/\r | |
736 | EFI_STATUS\r | |
737 | HttpPageHeader (\r | |
738 | IN int SocketFD,\r | |
739 | IN WSDT_PORT * pPort,\r | |
740 | IN CONST CHAR16 * pTitle\r | |
741 | );\r | |
742 | \r | |
743 | /**\r | |
744 | Buffer and send the HTTP page trailer\r | |
745 | \r | |
746 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
747 | @param [in] pPort The WSDT_PORT structure address\r | |
748 | @param [out] pbDone Address to receive the request completion status\r | |
749 | \r | |
750 | @retval EFI_SUCCESS The request was successfully processed\r | |
751 | \r | |
752 | **/\r | |
753 | EFI_STATUS\r | |
754 | HttpPageTrailer (\r | |
755 | IN int SocketFD,\r | |
756 | IN WSDT_PORT * pPort,\r | |
757 | IN BOOLEAN * pbDone\r | |
758 | );\r | |
759 | \r | |
760 | /**\r | |
761 | Process an HTTP request\r | |
762 | \r | |
763 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
764 | @param [in] pPort The WSDT_PORT structure address\r | |
765 | @param [out] pbDone Address to receive the request completion status\r | |
766 | \r | |
767 | @retval EFI_SUCCESS The request was successfully processed\r | |
768 | \r | |
769 | **/\r | |
770 | EFI_STATUS\r | |
771 | HttpRequest (\r | |
772 | IN int SocketFD,\r | |
773 | IN WSDT_PORT * pPort,\r | |
774 | IN BOOLEAN * pbDone\r | |
775 | );\r | |
776 | \r | |
777 | /**\r | |
778 | Buffer data for sending\r | |
779 | \r | |
780 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
781 | @param [in] pPort The WSDT_PORT structure address\r | |
782 | @param [in] LengthInBytes Length of valid data in the buffer\r | |
783 | @param [in] pBuffer Buffer of data to send\r | |
784 | \r | |
785 | @retval EFI_SUCCESS The request was successfully processed\r | |
786 | \r | |
787 | **/\r | |
788 | EFI_STATUS\r | |
789 | HttpSend (\r | |
790 | IN int SocketFD,\r | |
791 | IN WSDT_PORT * pPort,\r | |
792 | IN size_t LengthInBytes,\r | |
793 | IN CONST UINT8 * pBuffer\r | |
794 | );\r | |
795 | \r | |
796 | /**\r | |
797 | Send an ANSI string\r | |
798 | \r | |
799 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
800 | @param [in] pPort The WSDT_PORT structure address\r | |
801 | @param [in] pString A zero terminated Unicode string\r | |
802 | \r | |
803 | @retval EFI_SUCCESS The request was successfully processed\r | |
804 | \r | |
805 | **/\r | |
806 | EFI_STATUS\r | |
807 | HttpSendAnsiString (\r | |
808 | IN int SocketFD,\r | |
809 | IN WSDT_PORT * pPort,\r | |
810 | IN CONST char * pString\r | |
811 | );\r | |
812 | \r | |
813 | /**\r | |
814 | Buffer a single byte\r | |
815 | \r | |
816 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
817 | @param [in] pPort The WSDT_PORT structure address\r | |
818 | @param [in] Data The data byte to send\r | |
819 | \r | |
820 | @retval EFI_SUCCESS The request was successfully processed\r | |
821 | \r | |
822 | **/\r | |
823 | EFI_STATUS\r | |
824 | HttpSendByte (\r | |
825 | IN int SocketFD,\r | |
826 | IN WSDT_PORT * pPort,\r | |
827 | IN UINT8 Data\r | |
828 | );\r | |
829 | \r | |
830 | /**\r | |
831 | Display a character\r | |
832 | \r | |
833 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
834 | @param [in] pPort The WSDT_PORT structure address\r | |
835 | @param [in] Character Character to display\r | |
836 | @param [in] pReplacement Replacement character string\r | |
837 | \r | |
838 | @retval EFI_SUCCESS The request was successfully processed\r | |
839 | \r | |
840 | **/\r | |
841 | EFI_STATUS\r | |
842 | HttpSendCharacter (\r | |
843 | IN int SocketFD,\r | |
844 | IN WSDT_PORT * pPort,\r | |
845 | IN CHAR8 Character,\r | |
846 | IN CHAR8 * pReplacement\r | |
847 | );\r | |
848 | \r | |
849 | /**\r | |
850 | Send a buffer dump\r | |
851 | \r | |
852 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
853 | @param [in] pPort The WSDT_PORT structure address\r | |
854 | @param [in] ByteCount The number of bytes to display\r | |
855 | @param [in] pData Address of the byte array\r | |
856 | \r | |
857 | @retval EFI_SUCCESS The request was successfully processed\r | |
858 | \r | |
859 | **/\r | |
860 | EFI_STATUS\r | |
861 | HttpSendDump (\r | |
862 | IN int SocketFD,\r | |
863 | IN WSDT_PORT * pPort,\r | |
864 | IN UINTN ByteCount,\r | |
865 | IN CONST UINT8 * pData\r | |
866 | );\r | |
867 | \r | |
868 | /**\r | |
869 | Display a row containing a GUID value\r | |
870 | \r | |
871 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
872 | @param [in] pPort The WSDT_PORT structure address\r | |
873 | @param [in] pGuid Address of the GUID to display\r | |
874 | \r | |
875 | @retval EFI_SUCCESS The request was successfully processed\r | |
876 | \r | |
877 | **/\r | |
878 | EFI_STATUS\r | |
879 | HttpSendGuid (\r | |
880 | IN int SocketFD,\r | |
881 | IN WSDT_PORT * pPort,\r | |
882 | IN CONST EFI_GUID * pGuid\r | |
883 | );\r | |
884 | \r | |
885 | /**\r | |
886 | Output a hex value to the HTML page\r | |
887 | \r | |
888 | @param [in] SocketFD Socket file descriptor\r | |
889 | @param [in] pPort The WSDT_PORT structure address\r | |
890 | @param [in] Bits Number of bits to display\r | |
891 | @param [in] Value Value to display\r | |
892 | \r | |
893 | @retval EFI_SUCCESS Successfully displayed the address\r | |
894 | **/\r | |
895 | EFI_STATUS\r | |
896 | HttpSendHexBits (\r | |
897 | IN int SocketFD,\r | |
898 | IN WSDT_PORT * pPort,\r | |
899 | IN INT32 Bits,\r | |
900 | IN UINT64 Value\r | |
901 | );\r | |
902 | \r | |
903 | /**\r | |
904 | Output a hex value to the HTML page\r | |
905 | \r | |
906 | @param [in] SocketFD Socket file descriptor\r | |
907 | @param [in] pPort The WSDT_PORT structure address\r | |
908 | @param [in] Value Value to display\r | |
909 | \r | |
910 | @retval EFI_SUCCESS Successfully displayed the address\r | |
911 | **/\r | |
912 | EFI_STATUS\r | |
913 | HttpSendHexValue (\r | |
914 | IN int SocketFD,\r | |
915 | IN WSDT_PORT * pPort,\r | |
916 | IN UINT64 Value\r | |
917 | );\r | |
918 | \r | |
919 | /**\r | |
920 | Output an IP address to the HTML page\r | |
921 | \r | |
922 | @param [in] SocketFD Socket file descriptor\r | |
923 | @param [in] pPort The WSDT_PORT structure address\r | |
924 | @param [in] pAddress Address of the socket address\r | |
925 | \r | |
926 | @retval EFI_SUCCESS Successfully displayed the address\r | |
927 | **/\r | |
928 | EFI_STATUS\r | |
929 | HttpSendIpAddress (\r | |
930 | IN int SocketFD,\r | |
931 | IN WSDT_PORT * pPort,\r | |
f6e5cdd5 | 932 | IN struct sockaddr_in6 * pAddress\r |
4684b66f | 933 | );\r |
934 | \r | |
935 | /**\r | |
936 | Send a Unicode string\r | |
937 | \r | |
938 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
939 | @param [in] pPort The WSDT_PORT structure address\r | |
940 | @param [in] pString A zero terminated Unicode string\r | |
941 | \r | |
942 | @retval EFI_SUCCESS The request was successfully processed\r | |
943 | \r | |
944 | **/\r | |
945 | EFI_STATUS\r | |
946 | HttpSendUnicodeString (\r | |
947 | IN int SocketFD,\r | |
948 | IN WSDT_PORT * pPort,\r | |
949 | IN CONST UINT16 * pString\r | |
950 | );\r | |
951 | \r | |
952 | /**\r | |
953 | Output a value to the HTML page\r | |
954 | \r | |
955 | @param [in] SocketFD Socket file descriptor\r | |
956 | @param [in] pPort The WSDT_PORT structure address\r | |
957 | @param [in] Value Value to display\r | |
958 | \r | |
959 | @retval EFI_SUCCESS Successfully displayed the address\r | |
960 | **/\r | |
961 | EFI_STATUS\r | |
962 | HttpSendValue (\r | |
963 | IN int SocketFD,\r | |
964 | IN WSDT_PORT * pPort,\r | |
965 | IN UINT64 Value\r | |
966 | );\r | |
967 | \r | |
968 | /**\r | |
969 | Display a row containing a decimal value\r | |
970 | \r | |
971 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
972 | @param [in] pPort The WSDT_PORT structure address\r | |
973 | @param [in] pName Address of a zero terminated name string\r | |
974 | @param [in] Value The value to display\r | |
975 | \r | |
976 | @retval EFI_SUCCESS The request was successfully processed\r | |
977 | \r | |
978 | **/\r | |
979 | EFI_STATUS\r | |
980 | RowDecimalValue (\r | |
981 | IN int SocketFD,\r | |
982 | IN WSDT_PORT * pPort,\r | |
983 | IN CONST CHAR8 * pName,\r | |
984 | IN UINT64 Value\r | |
985 | );\r | |
986 | \r | |
987 | /**\r | |
988 | Display a row containing a GUID value\r | |
989 | \r | |
990 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
991 | @param [in] pPort The WSDT_PORT structure address\r | |
992 | @param [in] pName Address of a zero terminated name string\r | |
993 | @param [in] pGuid Address of the GUID to display\r | |
994 | \r | |
995 | @retval EFI_SUCCESS The request was successfully processed\r | |
996 | \r | |
997 | **/\r | |
998 | EFI_STATUS\r | |
999 | RowGuid (\r | |
1000 | IN int SocketFD,\r | |
1001 | IN WSDT_PORT * pPort,\r | |
1002 | IN CONST CHAR8 * pName,\r | |
1003 | IN CONST EFI_GUID * pGuid\r | |
1004 | );\r | |
1005 | \r | |
1006 | /**\r | |
1007 | Display a row containing a hex value\r | |
1008 | \r | |
1009 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1010 | @param [in] pPort The WSDT_PORT structure address\r | |
1011 | @param [in] pName Address of a zero terminated name string\r | |
1012 | @param [in] Value The value to display\r | |
1013 | @param [in] pWebPage Address of a zero terminated web page name\r | |
1014 | \r | |
1015 | @retval EFI_SUCCESS The request was successfully processed\r | |
1016 | \r | |
1017 | **/\r | |
1018 | EFI_STATUS\r | |
1019 | RowHexValue (\r | |
1020 | IN int SocketFD,\r | |
1021 | IN WSDT_PORT * pPort,\r | |
1022 | IN CONST CHAR8 * pName,\r | |
1023 | IN UINT64 Value,\r | |
1024 | IN CONST CHAR16 * pWebPage\r | |
1025 | );\r | |
1026 | \r | |
1027 | /**\r | |
1028 | Display a row containing a pointer\r | |
1029 | \r | |
1030 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1031 | @param [in] pPort The WSDT_PORT structure address\r | |
1032 | @param [in] pName Address of a zero terminated name string\r | |
1033 | @param [in] pAddress The address to display\r | |
1034 | @param [in] pWebPage Address of a zero terminated web page name\r | |
1035 | \r | |
1036 | @retval EFI_SUCCESS The request was successfully processed\r | |
1037 | \r | |
1038 | **/\r | |
1039 | EFI_STATUS\r | |
1040 | RowPointer (\r | |
1041 | IN int SocketFD,\r | |
1042 | IN WSDT_PORT * pPort,\r | |
1043 | IN CONST CHAR8 * pName,\r | |
1044 | IN CONST VOID * pAddress,\r | |
1045 | IN CONST CHAR16 * pWebPage\r | |
1046 | );\r | |
1047 | \r | |
1048 | /**\r | |
1049 | Display a row containing a revision\r | |
1050 | \r | |
1051 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1052 | @param [in] pPort The WSDT_PORT structure address\r | |
1053 | @param [in] pName Address of a zero terminated name string\r | |
1054 | @param [in] Revision The revision to display\r | |
1055 | \r | |
1056 | @retval EFI_SUCCESS The request was successfully processed\r | |
1057 | \r | |
1058 | **/\r | |
1059 | EFI_STATUS\r | |
1060 | RowRevision (\r | |
1061 | IN int SocketFD,\r | |
1062 | IN WSDT_PORT * pPort,\r | |
1063 | IN CONST CHAR8 * pName,\r | |
1064 | IN UINT32 Revision\r | |
1065 | );\r | |
1066 | \r | |
1067 | /**\r | |
1068 | Display a row containing a unicode string\r | |
1069 | \r | |
1070 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1071 | @param [in] pPort The WSDT_PORT structure address\r | |
1072 | @param [in] pName Address of a zero terminated name string\r | |
1073 | @param [in] pString Address of a zero terminated unicode string\r | |
1074 | \r | |
1075 | @retval EFI_SUCCESS The request was successfully processed\r | |
1076 | \r | |
1077 | **/\r | |
1078 | EFI_STATUS\r | |
1079 | RowUnicodeString (\r | |
1080 | IN int SocketFD,\r | |
1081 | IN WSDT_PORT * pPort,\r | |
1082 | IN CONST CHAR8 * pName,\r | |
1083 | IN CONST CHAR16 * pString\r | |
1084 | );\r | |
1085 | \r | |
1086 | /**\r | |
1087 | Start the table page\r | |
1088 | \r | |
1089 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1090 | @param [in] pPort The WSDT_PORT structure address\r | |
1091 | @param [in] pName Address of a zero terminated name string\r | |
1092 | @param [in] pTable Address of the table\r | |
1093 | \r | |
1094 | @retval EFI_SUCCESS The request was successfully processed\r | |
1095 | \r | |
1096 | **/\r | |
1097 | EFI_STATUS\r | |
1098 | TableHeader (\r | |
1099 | IN int SocketFD,\r | |
1100 | IN WSDT_PORT * pPort,\r | |
1101 | IN CONST CHAR16 * pName,\r | |
1102 | IN CONST VOID * pTable\r | |
1103 | );\r | |
1104 | \r | |
1105 | /**\r | |
1106 | End the table page\r | |
1107 | \r | |
1108 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1109 | @param [in] pPort The WSDT_PORT structure address\r | |
1110 | @param [out] pbDone Address to receive the request completion status\r | |
1111 | \r | |
1112 | @retval EFI_SUCCESS The request was successfully processed\r | |
1113 | \r | |
1114 | **/\r | |
1115 | EFI_STATUS\r | |
1116 | TableTrailer (\r | |
1117 | IN int SocketFD,\r | |
1118 | IN WSDT_PORT * pPort,\r | |
1119 | OUT BOOLEAN *pbDone\r | |
1120 | );\r | |
1121 | \r | |
1122 | /**\r | |
1123 | HTTP port creation timer routine\r | |
1124 | \r | |
1125 | This routine polls the socket layer waiting for the initial network connection\r | |
1126 | which will enable the creation of the HTTP port. The socket layer will manage\r | |
1127 | the coming and going of the network connections after that until the last network\r | |
1128 | connection is broken.\r | |
1129 | \r | |
1130 | @param [in] pWebServer The web server control structure address.\r | |
1131 | \r | |
1132 | **/\r | |
1133 | VOID\r | |
1134 | WebServerTimer (\r | |
1135 | IN DT_WEB_SERVER * pWebServer\r | |
1136 | );\r | |
1137 | \r | |
1138 | /**\r | |
1139 | Start the web server port creation timer\r | |
1140 | \r | |
1141 | @param [in] pWebServer The web server control structure address.\r | |
1142 | \r | |
1143 | @retval EFI_SUCCESS The timer was successfully started.\r | |
1144 | @retval EFI_ALREADY_STARTED The timer is already running.\r | |
1145 | @retval Other The timer failed to start.\r | |
1146 | \r | |
1147 | **/\r | |
1148 | EFI_STATUS\r | |
1149 | WebServerTimerStart (\r | |
1150 | IN DT_WEB_SERVER * pWebServer\r | |
1151 | );\r | |
1152 | \r | |
1153 | /**\r | |
1154 | Stop the web server port creation timer\r | |
1155 | \r | |
1156 | @param [in] pWebServer The web server control structure address.\r | |
1157 | \r | |
1158 | @retval EFI_SUCCESS The HTTP port timer is stopped\r | |
1159 | @retval Other Failed to stop the HTTP port timer\r | |
1160 | \r | |
1161 | **/\r | |
1162 | EFI_STATUS\r | |
1163 | WebServerTimerStop (\r | |
1164 | IN DT_WEB_SERVER * pWebServer\r | |
1165 | );\r | |
1166 | \r | |
1167 | //------------------------------------------------------------------------------\r | |
1168 | // Driver Binding Protocol Support\r | |
1169 | //------------------------------------------------------------------------------\r | |
1170 | \r | |
1171 | /**\r | |
1172 | Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and\r | |
1173 | closing the DevicePath and PciIo protocols on Controller.\r | |
1174 | \r | |
1175 | @param [in] pThis Protocol instance pointer.\r | |
1176 | @param [in] Controller Handle of device to stop driver on.\r | |
1177 | @param [in] NumberOfChildren How many children need to be stopped.\r | |
1178 | @param [in] pChildHandleBuffer Not used.\r | |
1179 | \r | |
1180 | @retval EFI_SUCCESS This driver is removed Controller.\r | |
1181 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
1182 | @retval other This driver was not removed from this device.\r | |
1183 | \r | |
1184 | **/\r | |
1185 | EFI_STATUS\r | |
1186 | EFIAPI\r | |
1187 | DriverStop (\r | |
1188 | IN EFI_DRIVER_BINDING_PROTOCOL * pThis,\r | |
1189 | IN EFI_HANDLE Controller,\r | |
1190 | IN UINTN NumberOfChildren,\r | |
1191 | IN EFI_HANDLE * pChildHandleBuffer\r | |
1192 | );\r | |
1193 | \r | |
1194 | //------------------------------------------------------------------------------\r | |
1195 | // EFI Component Name Protocol Support\r | |
1196 | //------------------------------------------------------------------------------\r | |
1197 | \r | |
1198 | /**\r | |
1199 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
1200 | \r | |
1201 | This function retrieves the user readable name of a driver in the form of a\r | |
1202 | Unicode string. If the driver specified by This has a user readable name in\r | |
1203 | the language specified by Language, then a pointer to the driver name is\r | |
1204 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
1205 | by This does not support the language specified by Language,\r | |
1206 | then EFI_UNSUPPORTED is returned.\r | |
1207 | \r | |
1208 | @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
1209 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
1210 | @param [in] pLanguage A pointer to a Null-terminated ASCII string\r | |
1211 | array indicating the language. This is the\r | |
1212 | language of the driver name that the caller is\r | |
1213 | requesting, and it must match one of the\r | |
1214 | languages specified in SupportedLanguages. The\r | |
1215 | number of languages supported by a driver is up\r | |
1216 | to the driver writer. Language is specified\r | |
1217 | in RFC 3066 or ISO 639-2 language code format.\r | |
1218 | @param [out] ppDriverName A pointer to the Unicode string to return.\r | |
1219 | This Unicode string is the name of the\r | |
1220 | driver specified by This in the language\r | |
1221 | specified by Language.\r | |
1222 | \r | |
1223 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
1224 | This and the language specified by Language was\r | |
1225 | returned in DriverName.\r | |
1226 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
1227 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
1228 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
1229 | the language specified by Language.\r | |
1230 | \r | |
1231 | **/\r | |
1232 | EFI_STATUS\r | |
1233 | EFIAPI\r | |
1234 | GetDriverName (\r | |
1235 | IN EFI_COMPONENT_NAME_PROTOCOL * pThis,\r | |
1236 | IN CHAR8 * pLanguage,\r | |
1237 | OUT CHAR16 ** ppDriverName\r | |
1238 | );\r | |
1239 | \r | |
1240 | \r | |
1241 | /**\r | |
1242 | Retrieves a Unicode string that is the user readable name of the controller\r | |
1243 | that is being managed by a driver.\r | |
1244 | \r | |
1245 | This function retrieves the user readable name of the controller specified by\r | |
1246 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
1247 | driver specified by This has a user readable name in the language specified by\r | |
1248 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
1249 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
1250 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
1251 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
1252 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
1253 | \r | |
1254 | @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
1255 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
1256 | @param [in] ControllerHandle The handle of a controller that the driver\r | |
1257 | specified by This is managing. This handle\r | |
1258 | specifies the controller whose name is to be\r | |
1259 | returned.\r | |
1260 | @param [in] ChildHandle The handle of the child controller to retrieve\r | |
1261 | the name of. This is an optional parameter that\r | |
1262 | may be NULL. It will be NULL for device\r | |
1263 | drivers. It will also be NULL for a bus drivers\r | |
1264 | that wish to retrieve the name of the bus\r | |
1265 | controller. It will not be NULL for a bus\r | |
1266 | driver that wishes to retrieve the name of a\r | |
1267 | child controller.\r | |
1268 | @param [in] pLanguage A pointer to a Null-terminated ASCII string\r | |
1269 | array indicating the language. This is the\r | |
1270 | language of the driver name that the caller is\r | |
1271 | requesting, and it must match one of the\r | |
1272 | languages specified in SupportedLanguages. The\r | |
1273 | number of languages supported by a driver is up\r | |
1274 | to the driver writer. Language is specified in\r | |
1275 | RFC 3066 or ISO 639-2 language code format.\r | |
1276 | @param [out] ppControllerName A pointer to the Unicode string to return.\r | |
1277 | This Unicode string is the name of the\r | |
1278 | controller specified by ControllerHandle and\r | |
1279 | ChildHandle in the language specified by\r | |
1280 | Language from the point of view of the driver\r | |
1281 | specified by This.\r | |
1282 | \r | |
1283 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
1284 | the language specified by Language for the\r | |
1285 | driver specified by This was returned in\r | |
1286 | DriverName.\r | |
1287 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
1288 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
1289 | EFI_HANDLE.\r | |
1290 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
1291 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
1292 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
1293 | managing the controller specified by\r | |
1294 | ControllerHandle and ChildHandle.\r | |
1295 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
1296 | the language specified by Language.\r | |
1297 | \r | |
1298 | **/\r | |
1299 | EFI_STATUS\r | |
1300 | EFIAPI\r | |
1301 | GetControllerName (\r | |
1302 | IN EFI_COMPONENT_NAME_PROTOCOL * pThis,\r | |
1303 | IN EFI_HANDLE ControllerHandle,\r | |
1304 | IN OPTIONAL EFI_HANDLE ChildHandle,\r | |
1305 | IN CHAR8 * pLanguage,\r | |
1306 | OUT CHAR16 ** ppControllerName\r | |
1307 | );\r | |
1308 | \r | |
1309 | //------------------------------------------------------------------------------\r | |
1310 | \r | |
1311 | #endif // _WEB_SERVER_H_\r |