2 Definitions for the web server.
4 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #define _WEB_SERVER_H_
15 #include <Guid/EventGroup.h>
17 #include <Library/BaseMemoryLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/MemoryAllocationLib.h>
20 #include <Library/PcdLib.h>
21 #include <Library/UefiApplicationEntryPoint.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/UefiLib.h>
24 #include <Protocol/BlockIo.h>
26 #include <netinet/in.h>
28 #include <sys/EfiSysCall.h>
30 #include <sys/socket.h>
32 #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
33 #pragma warning ( disable : 4054 )
34 #pragma warning ( disable : 4152 )
35 #endif // defined(_MSC_VER)
37 //------------------------------------------------------------------------------
39 //------------------------------------------------------------------------------
41 #define PAGE_ACPI_APIC L"/APIC"
42 #define PAGE_ACPI_BGRT L"/BGRT"
43 #define PAGE_ACPI_DSDT L"/DSDT"
44 #define PAGE_ACPI_FADT L"/FADT"
45 #define PAGE_ACPI_HPET L"/HPET"
46 #define PAGE_ACPI_MCFG L"/MCFG"
47 #define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"
48 #define PAGE_ACPI_RSDP_30 L"/RSDP3.0"
49 #define PAGE_ACPI_RSDT L"/RSDT"
50 #define PAGE_ACPI_SSDT L"/SSDT"
51 #define PAGE_ACPI_TCPA L"/TCPA"
52 #define PAGE_ACPI_UEFI L"/UEFI"
53 #define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"
54 #define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"
55 #define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"
56 #define PAGE_RUNTIME_SERVICES_TABLE L"/RuntimeServicesTable"
58 //------------------------------------------------------------------------------
60 //------------------------------------------------------------------------------
62 #define APIC_SIGNATURE 0x43495041
63 #define BGRT_SIGNATURE 0x54524742
64 #define DSDT_SIGNATURE 0x54445344
65 #define FADT_SIGNATURE 0x50434146
66 #define HPET_SIGNATURE 0x54455048
67 #define MCFG_SIGNATURE 0x4746434d
68 #define SSDT_SIGNATURE 0x54445353
69 #define TCPA_SIGNATURE 0x41504354
70 #define UEFI_SIGNATURE 0x49464555
72 //------------------------------------------------------------------------------
74 //------------------------------------------------------------------------------
76 #if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
77 #define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry
78 #define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit
79 #define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value
80 #define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value
81 #define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value
82 #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
86 #define DBG_EXIT_DEC(Status)
87 #define DBG_EXIT_HEX(Status)
88 #define DBG_EXIT_STATUS(Status)
89 #define DBG_EXIT_TF(Status)
92 #define DIM(x) ( sizeof ( x ) / sizeof ( x[0] )) ///< Compute the number of entries in an array
94 //------------------------------------------------------------------------------
96 //------------------------------------------------------------------------------
98 #define DEBUG_SOCKET_POLL 0x00080000 ///< Display the socket poll messages
99 #define DEBUG_PORT_WORK 0x00040000 ///< Display the port work messages
100 #define DEBUG_SERVER_LISTEN 0x00020000 ///< Display the socket poll messages
101 #define DEBUG_HTTP_PORT 0x00010000 ///< Display HTTP port related messages
102 #define DEBUG_REQUEST 0x00008000 ///< Display the HTTP request messages
104 #define HTTP_PORT_POLL_DELAY ( 2 * 1000 ) ///< Delay in milliseconds for attempts to open the HTTP port
105 #define CLIENT_POLL_DELAY 50 ///< Delay in milliseconds between client polls
107 #define TPL_WEB_SERVER TPL_CALLBACK ///< TPL for routine synchronization
112 This macro which is enabled when debug is enabled verifies that
113 the new TPL value is >= the current TPL value.
119 #if !defined(MDEPKG_NDEBUG)
121 #define VERIFY_TPL(tpl) \
123 EFI_TPL PreviousTpl; \
125 PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \
126 gBS->RestoreTPL ( PreviousTpl ); \
127 if ( PreviousTpl > tpl ) { \
128 DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \
129 ASSERT ( PreviousTpl <= tpl ); \
133 #else // MDEPKG_NDEBUG
135 #define VERIFY_TPL(tpl)
137 #endif // MDEPKG_NDEBUG
139 #define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
141 #define SPACES_ADDRESS_TO_DATA 2
142 #define BYTES_ON_A_LINE 16
143 #define SPACES_BETWEEN_BYTES 1
144 #define SPACES_DATA_TO_ASCII 2
147 //------------------------------------------------------------------------------
148 // Protocol Declarations
149 //------------------------------------------------------------------------------
151 extern EFI_COMPONENT_NAME_PROTOCOL gComponentName
; ///< Component name protocol declaration
152 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
; ///< Component name 2 protocol declaration
153 extern EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
; ///< Driver binding protocol declaration
155 //------------------------------------------------------------------------------
157 //------------------------------------------------------------------------------
160 Port control structure
166 size_t RequestLength
; ///< Request length in bytes
167 size_t TxBytes
; ///< Bytes in the TX buffer
168 UINT8 Request
[ 65536 ]; ///< Page request
169 UINT8 RxBuffer
[ 65536 ]; ///< Receive buffer
170 UINT8 TxBuffer
[ 65536 ]; ///< Transmit buffer
174 Web server control structure
177 UINTN Signature
; ///< Structure identification
182 EFI_HANDLE ImageHandle
; ///< Image handle
185 // HTTP port management
187 BOOLEAN bRunning
; ///< Web server running
188 EFI_EVENT TimerEvent
; ///< Timer to open HTTP port
189 int HttpListenPort
; ///< File descriptor for the HTTP listen port over TCP4
190 int HttpListenPort6
; ///< File descriptor for the HTTP listen port over TCP6
193 // Client port management
195 nfds_t MaxEntries
; ///< Maximum entries in the PortList array
196 nfds_t Entries
; ///< The current number of entries in the PortList array
197 struct pollfd
* pFdList
; ///< List of socket file descriptors
198 WSDT_PORT
** ppPortList
; ///< List of port management structures
201 //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
203 extern DT_WEB_SERVER mWebServer
;
206 Process an HTTP request
208 @param [in] SocketFD The socket's file descriptor to add to the list.
209 @param [in] pPort The WSDT_PORT structure address
210 @param [out] pbDone Address to receive the request completion status
212 @retval EFI_SUCCESS The request was successfully processed
219 IN WSDT_PORT
* pPort
,
224 Data structure to delcare page support routines
227 UINT16
* pPageName
; ///< Name of the page
228 PFN_RESPONSE pfnResponse
; ///< Routine to generate the response
229 UINT16
* pDescription
; ///< Description of the page
232 extern CONST DT_PAGE mPageList
[]; ///< List of pages
233 extern CONST UINTN mPageCount
; ///< Number of pages
235 //------------------------------------------------------------------------------
237 //------------------------------------------------------------------------------
240 Respond with the APIC table
242 @param [in] SocketFD The socket's file descriptor to add to the list.
243 @param [in] pPort The WSDT_PORT structure address
244 @param [out] pbDone Address to receive the request completion status
246 @retval EFI_SUCCESS The request was successfully processed
252 IN WSDT_PORT
* pPort
,
257 Respond with the BGRT table
259 @param [in] SocketFD The socket's file descriptor to add to the list.
260 @param [in] pPort The WSDT_PORT structure address
261 @param [out] pbDone Address to receive the request completion status
263 @retval EFI_SUCCESS The request was successfully processed
269 IN WSDT_PORT
* pPort
,
274 Respond with the ACPI DSDT table
276 @param [in] SocketFD The socket's file descriptor to add to the list.
277 @param [in] pPort The WSDT_PORT structure address
278 @param [out] pbDone Address to receive the request completion status
280 @retval EFI_SUCCESS The request was successfully processed
286 IN WSDT_PORT
* pPort
,
291 Respond with the ACPI FADT table
293 @param [in] SocketFD The socket's file descriptor to add to the list.
294 @param [in] pPort The WSDT_PORT structure address
295 @param [out] pbDone Address to receive the request completion status
297 @retval EFI_SUCCESS The request was successfully processed
303 IN WSDT_PORT
* pPort
,
308 Respond with the HPET table
310 @param [in] SocketFD The socket's file descriptor to add to the list.
311 @param [in] pPort The WSDT_PORT structure address
312 @param [out] pbDone Address to receive the request completion status
314 @retval EFI_SUCCESS The request was successfully processed
320 IN WSDT_PORT
* pPort
,
325 Respond with the MCFG table
327 @param [in] SocketFD The socket's file descriptor to add to the list.
328 @param [in] pPort The WSDT_PORT structure address
329 @param [out] pbDone Address to receive the request completion status
331 @retval EFI_SUCCESS The request was successfully processed
337 IN WSDT_PORT
* pPort
,
342 Respond with the ACPI RSDP 1.0b table
344 @param [in] SocketFD The socket's file descriptor to add to the list.
345 @param [in] pPort The WSDT_PORT structure address
346 @param [out] pbDone Address to receive the request completion status
348 @retval EFI_SUCCESS The request was successfully processed
354 IN WSDT_PORT
* pPort
,
359 Respond with the ACPI RSDP 3.0 table
361 @param [in] SocketFD The socket's file descriptor to add to the list.
362 @param [in] pPort The WSDT_PORT structure address
363 @param [out] pbDone Address to receive the request completion status
365 @retval EFI_SUCCESS The request was successfully processed
371 IN WSDT_PORT
* pPort
,
376 Respond with the ACPI RSDT table
378 @param [in] SocketFD The socket's file descriptor to add to the list.
379 @param [in] pPort The WSDT_PORT structure address
380 @param [out] pbDone Address to receive the request completion status
382 @retval EFI_SUCCESS The request was successfully processed
388 IN WSDT_PORT
* pPort
,
393 Respond with the SSDT table
395 @param [in] SocketFD The socket's file descriptor to add to the list.
396 @param [in] pPort The WSDT_PORT structure address
397 @param [out] pbDone Address to receive the request completion status
399 @retval EFI_SUCCESS The request was successfully processed
405 IN WSDT_PORT
* pPort
,
410 Respond with the TCPA table
412 @param [in] SocketFD The socket's file descriptor to add to the list.
413 @param [in] pPort The WSDT_PORT structure address
414 @param [out] pbDone Address to receive the request completion status
416 @retval EFI_SUCCESS The request was successfully processed
422 IN WSDT_PORT
* pPort
,
427 Respond with the UEFI table
429 @param [in] SocketFD The socket's file descriptor to add to the list.
430 @param [in] pPort The WSDT_PORT structure address
431 @param [out] pbDone Address to receive the request completion status
433 @retval EFI_SUCCESS The request was successfully processed
439 IN WSDT_PORT
* pPort
,
444 Respond with the boot services table
446 @param [in] SocketFD The socket's file descriptor to add to the list.
447 @param [in] pPort The WSDT_PORT structure address
448 @param [out] pbDone Address to receive the request completion status
450 @retval EFI_SUCCESS The request was successfully processed
454 BootServicesTablePage (
456 IN WSDT_PORT
* pPort
,
461 Respond with the configuration tables
463 @param [in] SocketFD The socket's file descriptor to add to the list.
464 @param [in] pPort The WSDT_PORT structure address
465 @param [out] pbDone Address to receive the request completion status
467 @retval EFI_SUCCESS The request was successfully processed
471 ConfigurationTablePage (
473 IN WSDT_PORT
* pPort
,
478 Respond with the DHCP options
480 @param [in] SocketFD The socket's file descriptor to add to the list.
481 @param [in] pPort The WSDT_PORT structure address
482 @param [out] pbDone Address to receive the request completion status
484 @retval EFI_SUCCESS The request was successfully processed
490 IN WSDT_PORT
* pPort
,
495 Respond with the DXE services table
497 @param [in] SocketFD The socket's file descriptor to add to the list.
498 @param [in] pPort The WSDT_PORT structure address
499 @param [out] pbDone Address to receive the request completion status
501 @retval EFI_SUCCESS The request was successfully processed
505 DxeServicesTablePage (
507 IN WSDT_PORT
* pPort
,
512 Respond with the Exit page
514 @param [in] SocketFD The socket's file descriptor to add to the list.
515 @param [in] pPort The WSDT_PORT structure address
516 @param [out] pbDone Address to receive the request completion status
518 @retval EFI_SUCCESS The request was successfully processed
524 IN WSDT_PORT
* pPort
,
529 Respond with the firmware status
531 @param [in] SocketFD The socket's file descriptor to add to the list.
532 @param [in] pPort The WSDT_PORT structure address
533 @param [out] pbDone Address to receive the request completion status
535 @retval EFI_SUCCESS The request was successfully processed
541 IN WSDT_PORT
* pPort
,
546 Respond with the handles in the system
548 @param [in] SocketFD The socket's file descriptor to add to the list.
549 @param [in] pPort The WSDT_PORT structure address
550 @param [out] pbDone Address to receive the request completion status
552 @retval EFI_SUCCESS The request was successfully processed
558 IN WSDT_PORT
* pPort
,
563 Respond with the Hello World page
565 @param [in] SocketFD The socket's file descriptor to add to the list.
566 @param [in] pPort The WSDT_PORT structure address
567 @param [out] pbDone Address to receive the request completion status
569 @retval EFI_SUCCESS The request was successfully processed
575 IN WSDT_PORT
* pPort
,
580 Respond with the list of known pages
582 @param [in] SocketFD The socket's file descriptor to add to the list.
583 @param [in] pPort The WSDT_PORT structure address
584 @param [out] pbDone Address to receive the request completion status
586 @retval EFI_SUCCESS The request was successfully processed
592 IN WSDT_PORT
* pPort
,
597 Page to display the memory map
599 @param [in] SocketFD The socket's file descriptor to add to the list.
600 @param [in] pPort The WSDT_PORT structure address
601 @param [out] pbDone Address to receive the request completion status
603 @retval EFI_SUCCESS The request was successfully processed
609 IN WSDT_PORT
* pPort
,
614 Display the memory type registers
616 @param [in] SocketFD The socket's file descriptor to add to the list.
617 @param [in] pPort The WSDT_PORT structure address
618 @param [out] pbDone Address to receive the request completion status
620 @retval EFI_SUCCESS The request was successfully processed
624 MemoryTypeRegistersPage (
626 IN WSDT_PORT
* pPort
,
631 Respond with the Ports page
633 @param [in] SocketFD The socket's file descriptor to add to the list.
634 @param [in] pPort The WSDT_PORT structure address
635 @param [out] pbDone Address to receive the request completion status
637 @retval EFI_SUCCESS The request was successfully processed
643 IN WSDT_PORT
* pPort
,
648 Page to reboot the system
650 @param [in] SocketFD The socket's file descriptor to add to the list.
651 @param [in] pPort The WSDT_PORT structure address
652 @param [out] pbDone Address to receive the request completion status
654 @retval EFI_SUCCESS The request was successfully processed
660 IN WSDT_PORT
* pPort
,
665 Respond with the runtime services table
667 @param [in] SocketFD The socket's file descriptor to add to the list.
668 @param [in] pPort The WSDT_PORT structure address
669 @param [out] pbDone Address to receive the request completion status
671 @retval EFI_SUCCESS The request was successfully processed
675 RuntimeSservicesTablePage (
677 IN WSDT_PORT
* pPort
,
682 Respond with the system table
684 @param [in] SocketFD The socket's file descriptor to add to the list.
685 @param [in] pPort The WSDT_PORT structure address
686 @param [out] pbDone Address to receive the request completion status
688 @retval EFI_SUCCESS The request was successfully processed
694 IN WSDT_PORT
* pPort
,
698 //------------------------------------------------------------------------------
700 //------------------------------------------------------------------------------
703 Display the EFI Table Header
705 @param [in] SocketFD The socket's file descriptor to add to the list.
706 @param [in] pPort The WSDT_PORT structure address
707 @param [in] pHeader Address of the EFI_TABLE_HEADER structure
709 @retval EFI_SUCCESS The request was successfully processed
715 IN WSDT_PORT
* pPort
,
716 IN EFI_TABLE_HEADER
* pHeader
720 Buffer the HTTP page header
722 @param [in] SocketFD The socket's file descriptor to add to the list.
723 @param [in] pPort The WSDT_PORT structure address
724 @param [in] pTitle A zero terminated Unicode title string
726 @retval EFI_SUCCESS The request was successfully processed
732 IN WSDT_PORT
* pPort
,
733 IN CONST CHAR16
* pTitle
737 Buffer and send the HTTP page trailer
739 @param [in] SocketFD The socket's file descriptor to add to the list.
740 @param [in] pPort The WSDT_PORT structure address
741 @param [out] pbDone Address to receive the request completion status
743 @retval EFI_SUCCESS The request was successfully processed
749 IN WSDT_PORT
* pPort
,
754 Process an HTTP request
756 @param [in] SocketFD The socket's file descriptor to add to the list.
757 @param [in] pPort The WSDT_PORT structure address
758 @param [out] pbDone Address to receive the request completion status
760 @retval EFI_SUCCESS The request was successfully processed
766 IN WSDT_PORT
* pPort
,
771 Buffer data for sending
773 @param [in] SocketFD The socket's file descriptor to add to the list.
774 @param [in] pPort The WSDT_PORT structure address
775 @param [in] LengthInBytes Length of valid data in the buffer
776 @param [in] pBuffer Buffer of data to send
778 @retval EFI_SUCCESS The request was successfully processed
784 IN WSDT_PORT
* pPort
,
785 IN
size_t LengthInBytes
,
786 IN CONST UINT8
* pBuffer
792 @param [in] SocketFD The socket's file descriptor to add to the list.
793 @param [in] pPort The WSDT_PORT structure address
794 @param [in] pString A zero terminated Unicode string
796 @retval EFI_SUCCESS The request was successfully processed
802 IN WSDT_PORT
* pPort
,
803 IN CONST
char * pString
809 @param [in] SocketFD The socket's file descriptor to add to the list.
810 @param [in] pPort The WSDT_PORT structure address
811 @param [in] Data The data byte to send
813 @retval EFI_SUCCESS The request was successfully processed
819 IN WSDT_PORT
* pPort
,
826 @param [in] SocketFD The socket's file descriptor to add to the list.
827 @param [in] pPort The WSDT_PORT structure address
828 @param [in] Character Character to display
829 @param [in] pReplacement Replacement character string
831 @retval EFI_SUCCESS The request was successfully processed
837 IN WSDT_PORT
* pPort
,
839 IN CHAR8
* pReplacement
845 @param [in] SocketFD The socket's file descriptor to add to the list.
846 @param [in] pPort The WSDT_PORT structure address
847 @param [in] ByteCount The number of bytes to display
848 @param [in] pData Address of the byte array
850 @retval EFI_SUCCESS The request was successfully processed
856 IN WSDT_PORT
* pPort
,
858 IN CONST UINT8
* pData
862 Display a row containing a GUID value
864 @param [in] SocketFD The socket's file descriptor to add to the list.
865 @param [in] pPort The WSDT_PORT structure address
866 @param [in] pGuid Address of the GUID to display
868 @retval EFI_SUCCESS The request was successfully processed
874 IN WSDT_PORT
* pPort
,
875 IN CONST EFI_GUID
* pGuid
879 Output a hex value to the HTML page
881 @param [in] SocketFD Socket file descriptor
882 @param [in] pPort The WSDT_PORT structure address
883 @param [in] Bits Number of bits to display
884 @param [in] Value Value to display
886 @retval EFI_SUCCESS Successfully displayed the address
891 IN WSDT_PORT
* pPort
,
897 Output a hex value to the HTML page
899 @param [in] SocketFD Socket file descriptor
900 @param [in] pPort The WSDT_PORT structure address
901 @param [in] Value Value to display
903 @retval EFI_SUCCESS Successfully displayed the address
908 IN WSDT_PORT
* pPort
,
913 Output an IP address to the HTML page
915 @param [in] SocketFD Socket file descriptor
916 @param [in] pPort The WSDT_PORT structure address
917 @param [in] pAddress Address of the socket address
919 @retval EFI_SUCCESS Successfully displayed the address
924 IN WSDT_PORT
* pPort
,
925 IN
struct sockaddr_in6
* pAddress
929 Send a Unicode string
931 @param [in] SocketFD The socket's file descriptor to add to the list.
932 @param [in] pPort The WSDT_PORT structure address
933 @param [in] pString A zero terminated Unicode string
935 @retval EFI_SUCCESS The request was successfully processed
939 HttpSendUnicodeString (
941 IN WSDT_PORT
* pPort
,
942 IN CONST UINT16
* pString
946 Output a value to the HTML page
948 @param [in] SocketFD Socket file descriptor
949 @param [in] pPort The WSDT_PORT structure address
950 @param [in] Value Value to display
952 @retval EFI_SUCCESS Successfully displayed the address
957 IN WSDT_PORT
* pPort
,
962 Display a row containing a decimal value
964 @param [in] SocketFD The socket's file descriptor to add to the list.
965 @param [in] pPort The WSDT_PORT structure address
966 @param [in] pName Address of a zero terminated name string
967 @param [in] Value The value to display
969 @retval EFI_SUCCESS The request was successfully processed
975 IN WSDT_PORT
* pPort
,
976 IN CONST CHAR8
* pName
,
981 Display a row containing a GUID value
983 @param [in] SocketFD The socket's file descriptor to add to the list.
984 @param [in] pPort The WSDT_PORT structure address
985 @param [in] pName Address of a zero terminated name string
986 @param [in] pGuid Address of the GUID to display
988 @retval EFI_SUCCESS The request was successfully processed
994 IN WSDT_PORT
* pPort
,
995 IN CONST CHAR8
* pName
,
996 IN CONST EFI_GUID
* pGuid
1000 Display a row containing a hex value
1002 @param [in] SocketFD The socket's file descriptor to add to the list.
1003 @param [in] pPort The WSDT_PORT structure address
1004 @param [in] pName Address of a zero terminated name string
1005 @param [in] Value The value to display
1006 @param [in] pWebPage Address of a zero terminated web page name
1008 @retval EFI_SUCCESS The request was successfully processed
1014 IN WSDT_PORT
* pPort
,
1015 IN CONST CHAR8
* pName
,
1017 IN CONST CHAR16
* pWebPage
1021 Display a row containing a pointer
1023 @param [in] SocketFD The socket's file descriptor to add to the list.
1024 @param [in] pPort The WSDT_PORT structure address
1025 @param [in] pName Address of a zero terminated name string
1026 @param [in] pAddress The address to display
1027 @param [in] pWebPage Address of a zero terminated web page name
1029 @retval EFI_SUCCESS The request was successfully processed
1035 IN WSDT_PORT
* pPort
,
1036 IN CONST CHAR8
* pName
,
1037 IN CONST VOID
* pAddress
,
1038 IN CONST CHAR16
* pWebPage
1042 Display a row containing a revision
1044 @param [in] SocketFD The socket's file descriptor to add to the list.
1045 @param [in] pPort The WSDT_PORT structure address
1046 @param [in] pName Address of a zero terminated name string
1047 @param [in] Revision The revision to display
1049 @retval EFI_SUCCESS The request was successfully processed
1055 IN WSDT_PORT
* pPort
,
1056 IN CONST CHAR8
* pName
,
1061 Display a row containing a unicode string
1063 @param [in] SocketFD The socket's file descriptor to add to the list.
1064 @param [in] pPort The WSDT_PORT structure address
1065 @param [in] pName Address of a zero terminated name string
1066 @param [in] pString Address of a zero terminated unicode string
1068 @retval EFI_SUCCESS The request was successfully processed
1074 IN WSDT_PORT
* pPort
,
1075 IN CONST CHAR8
* pName
,
1076 IN CONST CHAR16
* pString
1080 Start the table page
1082 @param [in] SocketFD The socket's file descriptor to add to the list.
1083 @param [in] pPort The WSDT_PORT structure address
1084 @param [in] pName Address of a zero terminated name string
1085 @param [in] pTable Address of the table
1087 @retval EFI_SUCCESS The request was successfully processed
1093 IN WSDT_PORT
* pPort
,
1094 IN CONST CHAR16
* pName
,
1095 IN CONST VOID
* pTable
1101 @param [in] SocketFD The socket's file descriptor to add to the list.
1102 @param [in] pPort The WSDT_PORT structure address
1103 @param [out] pbDone Address to receive the request completion status
1105 @retval EFI_SUCCESS The request was successfully processed
1111 IN WSDT_PORT
* pPort
,
1116 HTTP port creation timer routine
1118 This routine polls the socket layer waiting for the initial network connection
1119 which will enable the creation of the HTTP port. The socket layer will manage
1120 the coming and going of the network connections after that until the last network
1121 connection is broken.
1123 @param [in] pWebServer The web server control structure address.
1128 IN DT_WEB_SERVER
* pWebServer
1132 Start the web server port creation timer
1134 @param [in] pWebServer The web server control structure address.
1136 @retval EFI_SUCCESS The timer was successfully started.
1137 @retval EFI_ALREADY_STARTED The timer is already running.
1138 @retval Other The timer failed to start.
1142 WebServerTimerStart (
1143 IN DT_WEB_SERVER
* pWebServer
1147 Stop the web server port creation timer
1149 @param [in] pWebServer The web server control structure address.
1151 @retval EFI_SUCCESS The HTTP port timer is stopped
1152 @retval Other Failed to stop the HTTP port timer
1156 WebServerTimerStop (
1157 IN DT_WEB_SERVER
* pWebServer
1160 //------------------------------------------------------------------------------
1161 // Driver Binding Protocol Support
1162 //------------------------------------------------------------------------------
1165 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
1166 closing the DevicePath and PciIo protocols on Controller.
1168 @param [in] pThis Protocol instance pointer.
1169 @param [in] Controller Handle of device to stop driver on.
1170 @param [in] NumberOfChildren How many children need to be stopped.
1171 @param [in] pChildHandleBuffer Not used.
1173 @retval EFI_SUCCESS This driver is removed Controller.
1174 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
1175 @retval other This driver was not removed from this device.
1181 IN EFI_DRIVER_BINDING_PROTOCOL
* pThis
,
1182 IN EFI_HANDLE Controller
,
1183 IN UINTN NumberOfChildren
,
1184 IN EFI_HANDLE
* pChildHandleBuffer
1187 //------------------------------------------------------------------------------
1188 // EFI Component Name Protocol Support
1189 //------------------------------------------------------------------------------
1192 Retrieves a Unicode string that is the user readable name of the driver.
1194 This function retrieves the user readable name of a driver in the form of a
1195 Unicode string. If the driver specified by This has a user readable name in
1196 the language specified by Language, then a pointer to the driver name is
1197 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1198 by This does not support the language specified by Language,
1199 then EFI_UNSUPPORTED is returned.
1201 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1202 EFI_COMPONENT_NAME_PROTOCOL instance.
1203 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1204 array indicating the language. This is the
1205 language of the driver name that the caller is
1206 requesting, and it must match one of the
1207 languages specified in SupportedLanguages. The
1208 number of languages supported by a driver is up
1209 to the driver writer. Language is specified
1210 in RFC 3066 or ISO 639-2 language code format.
1211 @param [out] ppDriverName A pointer to the Unicode string to return.
1212 This Unicode string is the name of the
1213 driver specified by This in the language
1214 specified by Language.
1216 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1217 This and the language specified by Language was
1218 returned in DriverName.
1219 @retval EFI_INVALID_PARAMETER Language is NULL.
1220 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1221 @retval EFI_UNSUPPORTED The driver specified by This does not support
1222 the language specified by Language.
1228 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1229 IN CHAR8
* pLanguage
,
1230 OUT CHAR16
** ppDriverName
1235 Retrieves a Unicode string that is the user readable name of the controller
1236 that is being managed by a driver.
1238 This function retrieves the user readable name of the controller specified by
1239 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1240 driver specified by This has a user readable name in the language specified by
1241 Language, then a pointer to the controller name is returned in ControllerName,
1242 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1243 managing the controller specified by ControllerHandle and ChildHandle,
1244 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1245 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1247 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1248 EFI_COMPONENT_NAME_PROTOCOL instance.
1249 @param [in] ControllerHandle The handle of a controller that the driver
1250 specified by This is managing. This handle
1251 specifies the controller whose name is to be
1253 @param [in] ChildHandle The handle of the child controller to retrieve
1254 the name of. This is an optional parameter that
1255 may be NULL. It will be NULL for device
1256 drivers. It will also be NULL for a bus drivers
1257 that wish to retrieve the name of the bus
1258 controller. It will not be NULL for a bus
1259 driver that wishes to retrieve the name of a
1261 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1262 array indicating the language. This is the
1263 language of the driver name that the caller is
1264 requesting, and it must match one of the
1265 languages specified in SupportedLanguages. The
1266 number of languages supported by a driver is up
1267 to the driver writer. Language is specified in
1268 RFC 3066 or ISO 639-2 language code format.
1269 @param [out] ppControllerName A pointer to the Unicode string to return.
1270 This Unicode string is the name of the
1271 controller specified by ControllerHandle and
1272 ChildHandle in the language specified by
1273 Language from the point of view of the driver
1276 @retval EFI_SUCCESS The Unicode string for the user readable name in
1277 the language specified by Language for the
1278 driver specified by This was returned in
1280 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1281 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1283 @retval EFI_INVALID_PARAMETER Language is NULL.
1284 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1285 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1286 managing the controller specified by
1287 ControllerHandle and ChildHandle.
1288 @retval EFI_UNSUPPORTED The driver specified by This does not support
1289 the language specified by Language.
1295 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1296 IN EFI_HANDLE ControllerHandle
,
1297 IN OPTIONAL EFI_HANDLE ChildHandle
,
1298 IN CHAR8
* pLanguage
,
1299 OUT CHAR16
** ppControllerName
1302 //------------------------------------------------------------------------------
1304 #endif // _WEB_SERVER_H_