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