2 Definitions for the web server.
4 Copyright (c) 2011-2012, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _WEB_SERVER_H_
16 #define _WEB_SERVER_H_
21 #include <Guid/EventGroup.h>
23 #include <Register/Msr.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/MemoryAllocationLib.h>
27 #include <Library/PcdLib.h>
28 #include <Library/UefiApplicationEntryPoint.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/UefiLib.h>
31 #include <Protocol/BlockIo.h>
33 #include <netinet/in.h>
35 #include <sys/EfiSysCall.h>
37 #include <sys/socket.h>
39 #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
40 #pragma warning ( disable : 4054 )
41 #pragma warning ( disable : 4152 )
42 #endif // defined(_MSC_VER)
44 //------------------------------------------------------------------------------
46 //------------------------------------------------------------------------------
48 #define PAGE_ACPI_APIC L"/APIC"
49 #define PAGE_ACPI_BGRT L"/BGRT"
50 #define PAGE_ACPI_DSDT L"/DSDT"
51 #define PAGE_ACPI_FADT L"/FADT"
52 #define PAGE_ACPI_HPET L"/HPET"
53 #define PAGE_ACPI_MCFG L"/MCFG"
54 #define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"
55 #define PAGE_ACPI_RSDP_30 L"/RSDP3.0"
56 #define PAGE_ACPI_RSDT L"/RSDT"
57 #define PAGE_ACPI_SSDT L"/SSDT"
58 #define PAGE_ACPI_TCPA L"/TCPA"
59 #define PAGE_ACPI_UEFI L"/UEFI"
60 #define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"
61 #define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"
62 #define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"
63 #define PAGE_RUNTIME_SERVICES_TABLE L"/RuntimeServicesTable"
65 //------------------------------------------------------------------------------
67 //------------------------------------------------------------------------------
69 #define APIC_SIGNATURE 0x43495041
70 #define BGRT_SIGNATURE 0x54524742
71 #define DSDT_SIGNATURE 0x54445344
72 #define FADT_SIGNATURE 0x50434146
73 #define HPET_SIGNATURE 0x54455048
74 #define MCFG_SIGNATURE 0x4746434d
75 #define SSDT_SIGNATURE 0x54445353
76 #define TCPA_SIGNATURE 0x41504354
77 #define UEFI_SIGNATURE 0x49464555
79 //------------------------------------------------------------------------------
81 //------------------------------------------------------------------------------
83 #if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
84 #define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry
85 #define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit
86 #define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value
87 #define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value
88 #define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value
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
93 #define DBG_EXIT_DEC(Status)
94 #define DBG_EXIT_HEX(Status)
95 #define DBG_EXIT_STATUS(Status)
96 #define DBG_EXIT_TF(Status)
99 #define DIM(x) ( sizeof ( x ) / sizeof ( x[0] )) ///< Compute the number of entries in an array
101 //------------------------------------------------------------------------------
103 //------------------------------------------------------------------------------
105 #define DEBUG_SOCKET_POLL 0x00080000 ///< Display the socket poll messages
106 #define DEBUG_PORT_WORK 0x00040000 ///< Display the port work messages
107 #define DEBUG_SERVER_LISTEN 0x00020000 ///< Display the socket poll messages
108 #define DEBUG_HTTP_PORT 0x00010000 ///< Display HTTP port related messages
109 #define DEBUG_REQUEST 0x00008000 ///< Display the HTTP request messages
111 #define HTTP_PORT_POLL_DELAY ( 2 * 1000 ) ///< Delay in milliseconds for attempts to open the HTTP port
112 #define CLIENT_POLL_DELAY 50 ///< Delay in milliseconds between client polls
114 #define TPL_WEB_SERVER TPL_CALLBACK ///< TPL for routine synchronization
119 This macro which is enabled when debug is enabled verifies that
120 the new TPL value is >= the current TPL value.
126 #if !defined(MDEPKG_NDEBUG)
128 #define VERIFY_TPL(tpl) \
130 EFI_TPL PreviousTpl; \
132 PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \
133 gBS->RestoreTPL ( PreviousTpl ); \
134 if ( PreviousTpl > tpl ) { \
135 DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \
136 ASSERT ( PreviousTpl <= tpl ); \
140 #else // MDEPKG_NDEBUG
142 #define VERIFY_TPL(tpl)
144 #endif // MDEPKG_NDEBUG
146 #define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
148 #define SPACES_ADDRESS_TO_DATA 2
149 #define BYTES_ON_A_LINE 16
150 #define SPACES_BETWEEN_BYTES 1
151 #define SPACES_DATA_TO_ASCII 2
154 //------------------------------------------------------------------------------
155 // Protocol Declarations
156 //------------------------------------------------------------------------------
158 extern EFI_COMPONENT_NAME_PROTOCOL gComponentName
; ///< Component name protocol declaration
159 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
; ///< Component name 2 protocol declaration
160 extern EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
; ///< Driver binding protocol declaration
162 //------------------------------------------------------------------------------
164 //------------------------------------------------------------------------------
167 Port control structure
173 size_t RequestLength
; ///< Request length in bytes
174 size_t TxBytes
; ///< Bytes in the TX buffer
175 UINT8 Request
[ 65536 ]; ///< Page request
176 UINT8 RxBuffer
[ 65536 ]; ///< Receive buffer
177 UINT8 TxBuffer
[ 65536 ]; ///< Transmit buffer
181 Web server control structure
184 UINTN Signature
; ///< Structure identification
189 EFI_HANDLE ImageHandle
; ///< Image handle
192 // HTTP port management
194 BOOLEAN bRunning
; ///< Web server running
195 EFI_EVENT TimerEvent
; ///< Timer to open HTTP port
196 int HttpListenPort
; ///< File descriptor for the HTTP listen port over TCP4
197 int HttpListenPort6
; ///< File descriptor for the HTTP listen port over TCP6
200 // Client port management
202 nfds_t MaxEntries
; ///< Maximum entries in the PortList array
203 nfds_t Entries
; ///< The current number of entries in the PortList array
204 struct pollfd
* pFdList
; ///< List of socket file descriptors
205 WSDT_PORT
** ppPortList
; ///< List of port management structures
208 //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
210 extern DT_WEB_SERVER mWebServer
;
213 Process an HTTP request
215 @param [in] SocketFD The socket's file descriptor to add to the list.
216 @param [in] pPort The WSDT_PORT structure address
217 @param [out] pbDone Address to receive the request completion status
219 @retval EFI_SUCCESS The request was successfully processed
226 IN WSDT_PORT
* pPort
,
231 Data structure to delcare page support routines
234 UINT16
* pPageName
; ///< Name of the page
235 PFN_RESPONSE pfnResponse
; ///< Routine to generate the response
236 UINT16
* pDescription
; ///< Description of the page
239 extern CONST DT_PAGE mPageList
[]; ///< List of pages
240 extern CONST UINTN mPageCount
; ///< Number of pages
242 //------------------------------------------------------------------------------
244 //------------------------------------------------------------------------------
247 Respond with the APIC table
249 @param [in] SocketFD The socket's file descriptor to add to the list.
250 @param [in] pPort The WSDT_PORT structure address
251 @param [out] pbDone Address to receive the request completion status
253 @retval EFI_SUCCESS The request was successfully processed
259 IN WSDT_PORT
* pPort
,
264 Respond with the BGRT table
266 @param [in] SocketFD The socket's file descriptor to add to the list.
267 @param [in] pPort The WSDT_PORT structure address
268 @param [out] pbDone Address to receive the request completion status
270 @retval EFI_SUCCESS The request was successfully processed
276 IN WSDT_PORT
* pPort
,
281 Respond with the ACPI DSDT table
283 @param [in] SocketFD The socket's file descriptor to add to the list.
284 @param [in] pPort The WSDT_PORT structure address
285 @param [out] pbDone Address to receive the request completion status
287 @retval EFI_SUCCESS The request was successfully processed
293 IN WSDT_PORT
* pPort
,
298 Respond with the ACPI FADT table
300 @param [in] SocketFD The socket's file descriptor to add to the list.
301 @param [in] pPort The WSDT_PORT structure address
302 @param [out] pbDone Address to receive the request completion status
304 @retval EFI_SUCCESS The request was successfully processed
310 IN WSDT_PORT
* pPort
,
315 Respond with the HPET table
317 @param [in] SocketFD The socket's file descriptor to add to the list.
318 @param [in] pPort The WSDT_PORT structure address
319 @param [out] pbDone Address to receive the request completion status
321 @retval EFI_SUCCESS The request was successfully processed
327 IN WSDT_PORT
* pPort
,
332 Respond with the MCFG table
334 @param [in] SocketFD The socket's file descriptor to add to the list.
335 @param [in] pPort The WSDT_PORT structure address
336 @param [out] pbDone Address to receive the request completion status
338 @retval EFI_SUCCESS The request was successfully processed
344 IN WSDT_PORT
* pPort
,
349 Respond with the ACPI RSDP 1.0b table
351 @param [in] SocketFD The socket's file descriptor to add to the list.
352 @param [in] pPort The WSDT_PORT structure address
353 @param [out] pbDone Address to receive the request completion status
355 @retval EFI_SUCCESS The request was successfully processed
361 IN WSDT_PORT
* pPort
,
366 Respond with the ACPI RSDP 3.0 table
368 @param [in] SocketFD The socket's file descriptor to add to the list.
369 @param [in] pPort The WSDT_PORT structure address
370 @param [out] pbDone Address to receive the request completion status
372 @retval EFI_SUCCESS The request was successfully processed
378 IN WSDT_PORT
* pPort
,
383 Respond with the ACPI RSDT table
385 @param [in] SocketFD The socket's file descriptor to add to the list.
386 @param [in] pPort The WSDT_PORT structure address
387 @param [out] pbDone Address to receive the request completion status
389 @retval EFI_SUCCESS The request was successfully processed
395 IN WSDT_PORT
* pPort
,
400 Respond with the SSDT table
402 @param [in] SocketFD The socket's file descriptor to add to the list.
403 @param [in] pPort The WSDT_PORT structure address
404 @param [out] pbDone Address to receive the request completion status
406 @retval EFI_SUCCESS The request was successfully processed
412 IN WSDT_PORT
* pPort
,
417 Respond with the TCPA table
419 @param [in] SocketFD The socket's file descriptor to add to the list.
420 @param [in] pPort The WSDT_PORT structure address
421 @param [out] pbDone Address to receive the request completion status
423 @retval EFI_SUCCESS The request was successfully processed
429 IN WSDT_PORT
* pPort
,
434 Respond with the UEFI table
436 @param [in] SocketFD The socket's file descriptor to add to the list.
437 @param [in] pPort The WSDT_PORT structure address
438 @param [out] pbDone Address to receive the request completion status
440 @retval EFI_SUCCESS The request was successfully processed
446 IN WSDT_PORT
* pPort
,
451 Respond with the boot services table
453 @param [in] SocketFD The socket's file descriptor to add to the list.
454 @param [in] pPort The WSDT_PORT structure address
455 @param [out] pbDone Address to receive the request completion status
457 @retval EFI_SUCCESS The request was successfully processed
461 BootServicesTablePage (
463 IN WSDT_PORT
* pPort
,
468 Respond with the configuration tables
470 @param [in] SocketFD The socket's file descriptor to add to the list.
471 @param [in] pPort The WSDT_PORT structure address
472 @param [out] pbDone Address to receive the request completion status
474 @retval EFI_SUCCESS The request was successfully processed
478 ConfigurationTablePage (
480 IN WSDT_PORT
* pPort
,
485 Respond with the DHCP options
487 @param [in] SocketFD The socket's file descriptor to add to the list.
488 @param [in] pPort The WSDT_PORT structure address
489 @param [out] pbDone Address to receive the request completion status
491 @retval EFI_SUCCESS The request was successfully processed
497 IN WSDT_PORT
* pPort
,
502 Respond with the DXE services table
504 @param [in] SocketFD The socket's file descriptor to add to the list.
505 @param [in] pPort The WSDT_PORT structure address
506 @param [out] pbDone Address to receive the request completion status
508 @retval EFI_SUCCESS The request was successfully processed
512 DxeServicesTablePage (
514 IN WSDT_PORT
* pPort
,
519 Respond with the Exit page
521 @param [in] SocketFD The socket's file descriptor to add to the list.
522 @param [in] pPort The WSDT_PORT structure address
523 @param [out] pbDone Address to receive the request completion status
525 @retval EFI_SUCCESS The request was successfully processed
531 IN WSDT_PORT
* pPort
,
536 Respond with the firmware status
538 @param [in] SocketFD The socket's file descriptor to add to the list.
539 @param [in] pPort The WSDT_PORT structure address
540 @param [out] pbDone Address to receive the request completion status
542 @retval EFI_SUCCESS The request was successfully processed
548 IN WSDT_PORT
* pPort
,
553 Respond with the handles in the system
555 @param [in] SocketFD The socket's file descriptor to add to the list.
556 @param [in] pPort The WSDT_PORT structure address
557 @param [out] pbDone Address to receive the request completion status
559 @retval EFI_SUCCESS The request was successfully processed
565 IN WSDT_PORT
* pPort
,
570 Respond with the Hello World page
572 @param [in] SocketFD The socket's file descriptor to add to the list.
573 @param [in] pPort The WSDT_PORT structure address
574 @param [out] pbDone Address to receive the request completion status
576 @retval EFI_SUCCESS The request was successfully processed
582 IN WSDT_PORT
* pPort
,
587 Respond with the list of known pages
589 @param [in] SocketFD The socket's file descriptor to add to the list.
590 @param [in] pPort The WSDT_PORT structure address
591 @param [out] pbDone Address to receive the request completion status
593 @retval EFI_SUCCESS The request was successfully processed
599 IN WSDT_PORT
* pPort
,
604 Page to display the memory map
606 @param [in] SocketFD The socket's file descriptor to add to the list.
607 @param [in] pPort The WSDT_PORT structure address
608 @param [out] pbDone Address to receive the request completion status
610 @retval EFI_SUCCESS The request was successfully processed
616 IN WSDT_PORT
* pPort
,
621 Display the memory type registers
623 @param [in] SocketFD The socket's file descriptor to add to the list.
624 @param [in] pPort The WSDT_PORT structure address
625 @param [out] pbDone Address to receive the request completion status
627 @retval EFI_SUCCESS The request was successfully processed
631 MemoryTypeRegistersPage (
633 IN WSDT_PORT
* pPort
,
638 Respond with the Ports page
640 @param [in] SocketFD The socket's file descriptor to add to the list.
641 @param [in] pPort The WSDT_PORT structure address
642 @param [out] pbDone Address to receive the request completion status
644 @retval EFI_SUCCESS The request was successfully processed
650 IN WSDT_PORT
* pPort
,
655 Page to reboot the system
657 @param [in] SocketFD The socket's file descriptor to add to the list.
658 @param [in] pPort The WSDT_PORT structure address
659 @param [out] pbDone Address to receive the request completion status
661 @retval EFI_SUCCESS The request was successfully processed
667 IN WSDT_PORT
* pPort
,
672 Respond with the runtime services table
674 @param [in] SocketFD The socket's file descriptor to add to the list.
675 @param [in] pPort The WSDT_PORT structure address
676 @param [out] pbDone Address to receive the request completion status
678 @retval EFI_SUCCESS The request was successfully processed
682 RuntimeSservicesTablePage (
684 IN WSDT_PORT
* pPort
,
689 Respond with the system table
691 @param [in] SocketFD The socket's file descriptor to add to the list.
692 @param [in] pPort The WSDT_PORT structure address
693 @param [out] pbDone Address to receive the request completion status
695 @retval EFI_SUCCESS The request was successfully processed
701 IN WSDT_PORT
* pPort
,
705 //------------------------------------------------------------------------------
707 //------------------------------------------------------------------------------
710 Display the EFI Table Header
712 @param [in] SocketFD The socket's file descriptor to add to the list.
713 @param [in] pPort The WSDT_PORT structure address
714 @param [in] pHeader Address of the EFI_TABLE_HEADER structure
716 @retval EFI_SUCCESS The request was successfully processed
722 IN WSDT_PORT
* pPort
,
723 IN EFI_TABLE_HEADER
* pHeader
727 Buffer the HTTP page header
729 @param [in] SocketFD The socket's file descriptor to add to the list.
730 @param [in] pPort The WSDT_PORT structure address
731 @param [in] pTitle A zero terminated Unicode title string
733 @retval EFI_SUCCESS The request was successfully processed
739 IN WSDT_PORT
* pPort
,
740 IN CONST CHAR16
* pTitle
744 Buffer and send the HTTP page trailer
746 @param [in] SocketFD The socket's file descriptor to add to the list.
747 @param [in] pPort The WSDT_PORT structure address
748 @param [out] pbDone Address to receive the request completion status
750 @retval EFI_SUCCESS The request was successfully processed
756 IN WSDT_PORT
* pPort
,
761 Process an HTTP request
763 @param [in] SocketFD The socket's file descriptor to add to the list.
764 @param [in] pPort The WSDT_PORT structure address
765 @param [out] pbDone Address to receive the request completion status
767 @retval EFI_SUCCESS The request was successfully processed
773 IN WSDT_PORT
* pPort
,
778 Buffer data for sending
780 @param [in] SocketFD The socket's file descriptor to add to the list.
781 @param [in] pPort The WSDT_PORT structure address
782 @param [in] LengthInBytes Length of valid data in the buffer
783 @param [in] pBuffer Buffer of data to send
785 @retval EFI_SUCCESS The request was successfully processed
791 IN WSDT_PORT
* pPort
,
792 IN
size_t LengthInBytes
,
793 IN CONST UINT8
* pBuffer
799 @param [in] SocketFD The socket's file descriptor to add to the list.
800 @param [in] pPort The WSDT_PORT structure address
801 @param [in] pString A zero terminated Unicode string
803 @retval EFI_SUCCESS The request was successfully processed
809 IN WSDT_PORT
* pPort
,
810 IN CONST
char * pString
816 @param [in] SocketFD The socket's file descriptor to add to the list.
817 @param [in] pPort The WSDT_PORT structure address
818 @param [in] Data The data byte to send
820 @retval EFI_SUCCESS The request was successfully processed
826 IN WSDT_PORT
* pPort
,
833 @param [in] SocketFD The socket's file descriptor to add to the list.
834 @param [in] pPort The WSDT_PORT structure address
835 @param [in] Character Character to display
836 @param [in] pReplacement Replacement character string
838 @retval EFI_SUCCESS The request was successfully processed
844 IN WSDT_PORT
* pPort
,
846 IN CHAR8
* pReplacement
852 @param [in] SocketFD The socket's file descriptor to add to the list.
853 @param [in] pPort The WSDT_PORT structure address
854 @param [in] ByteCount The number of bytes to display
855 @param [in] pData Address of the byte array
857 @retval EFI_SUCCESS The request was successfully processed
863 IN WSDT_PORT
* pPort
,
865 IN CONST UINT8
* pData
869 Display a row containing a GUID value
871 @param [in] SocketFD The socket's file descriptor to add to the list.
872 @param [in] pPort The WSDT_PORT structure address
873 @param [in] pGuid Address of the GUID to display
875 @retval EFI_SUCCESS The request was successfully processed
881 IN WSDT_PORT
* pPort
,
882 IN CONST EFI_GUID
* pGuid
886 Output a hex value to the HTML page
888 @param [in] SocketFD Socket file descriptor
889 @param [in] pPort The WSDT_PORT structure address
890 @param [in] Bits Number of bits to display
891 @param [in] Value Value to display
893 @retval EFI_SUCCESS Successfully displayed the address
898 IN WSDT_PORT
* pPort
,
904 Output a hex value to the HTML page
906 @param [in] SocketFD Socket file descriptor
907 @param [in] pPort The WSDT_PORT structure address
908 @param [in] Value Value to display
910 @retval EFI_SUCCESS Successfully displayed the address
915 IN WSDT_PORT
* pPort
,
920 Output an IP address to the HTML page
922 @param [in] SocketFD Socket file descriptor
923 @param [in] pPort The WSDT_PORT structure address
924 @param [in] pAddress Address of the socket address
926 @retval EFI_SUCCESS Successfully displayed the address
931 IN WSDT_PORT
* pPort
,
932 IN
struct sockaddr_in6
* pAddress
936 Send a Unicode string
938 @param [in] SocketFD The socket's file descriptor to add to the list.
939 @param [in] pPort The WSDT_PORT structure address
940 @param [in] pString A zero terminated Unicode string
942 @retval EFI_SUCCESS The request was successfully processed
946 HttpSendUnicodeString (
948 IN WSDT_PORT
* pPort
,
949 IN CONST UINT16
* pString
953 Output a value to the HTML page
955 @param [in] SocketFD Socket file descriptor
956 @param [in] pPort The WSDT_PORT structure address
957 @param [in] Value Value to display
959 @retval EFI_SUCCESS Successfully displayed the address
964 IN WSDT_PORT
* pPort
,
969 Display a row containing a decimal value
971 @param [in] SocketFD The socket's file descriptor to add to the list.
972 @param [in] pPort The WSDT_PORT structure address
973 @param [in] pName Address of a zero terminated name string
974 @param [in] Value The value to display
976 @retval EFI_SUCCESS The request was successfully processed
982 IN WSDT_PORT
* pPort
,
983 IN CONST CHAR8
* pName
,
988 Display a row containing a GUID value
990 @param [in] SocketFD The socket's file descriptor to add to the list.
991 @param [in] pPort The WSDT_PORT structure address
992 @param [in] pName Address of a zero terminated name string
993 @param [in] pGuid Address of the GUID to display
995 @retval EFI_SUCCESS The request was successfully processed
1001 IN WSDT_PORT
* pPort
,
1002 IN CONST CHAR8
* pName
,
1003 IN CONST EFI_GUID
* pGuid
1007 Display a row containing a hex value
1009 @param [in] SocketFD The socket's file descriptor to add to the list.
1010 @param [in] pPort The WSDT_PORT structure address
1011 @param [in] pName Address of a zero terminated name string
1012 @param [in] Value The value to display
1013 @param [in] pWebPage Address of a zero terminated web page name
1015 @retval EFI_SUCCESS The request was successfully processed
1021 IN WSDT_PORT
* pPort
,
1022 IN CONST CHAR8
* pName
,
1024 IN CONST CHAR16
* pWebPage
1028 Display a row containing a pointer
1030 @param [in] SocketFD The socket's file descriptor to add to the list.
1031 @param [in] pPort The WSDT_PORT structure address
1032 @param [in] pName Address of a zero terminated name string
1033 @param [in] pAddress The address to display
1034 @param [in] pWebPage Address of a zero terminated web page name
1036 @retval EFI_SUCCESS The request was successfully processed
1042 IN WSDT_PORT
* pPort
,
1043 IN CONST CHAR8
* pName
,
1044 IN CONST VOID
* pAddress
,
1045 IN CONST CHAR16
* pWebPage
1049 Display a row containing a revision
1051 @param [in] SocketFD The socket's file descriptor to add to the list.
1052 @param [in] pPort The WSDT_PORT structure address
1053 @param [in] pName Address of a zero terminated name string
1054 @param [in] Revision The revision to display
1056 @retval EFI_SUCCESS The request was successfully processed
1062 IN WSDT_PORT
* pPort
,
1063 IN CONST CHAR8
* pName
,
1068 Display a row containing a unicode string
1070 @param [in] SocketFD The socket's file descriptor to add to the list.
1071 @param [in] pPort The WSDT_PORT structure address
1072 @param [in] pName Address of a zero terminated name string
1073 @param [in] pString Address of a zero terminated unicode string
1075 @retval EFI_SUCCESS The request was successfully processed
1081 IN WSDT_PORT
* pPort
,
1082 IN CONST CHAR8
* pName
,
1083 IN CONST CHAR16
* pString
1087 Start the table page
1089 @param [in] SocketFD The socket's file descriptor to add to the list.
1090 @param [in] pPort The WSDT_PORT structure address
1091 @param [in] pName Address of a zero terminated name string
1092 @param [in] pTable Address of the table
1094 @retval EFI_SUCCESS The request was successfully processed
1100 IN WSDT_PORT
* pPort
,
1101 IN CONST CHAR16
* pName
,
1102 IN CONST VOID
* pTable
1108 @param [in] SocketFD The socket's file descriptor to add to the list.
1109 @param [in] pPort The WSDT_PORT structure address
1110 @param [out] pbDone Address to receive the request completion status
1112 @retval EFI_SUCCESS The request was successfully processed
1118 IN WSDT_PORT
* pPort
,
1123 HTTP port creation timer routine
1125 This routine polls the socket layer waiting for the initial network connection
1126 which will enable the creation of the HTTP port. The socket layer will manage
1127 the coming and going of the network connections after that until the last network
1128 connection is broken.
1130 @param [in] pWebServer The web server control structure address.
1135 IN DT_WEB_SERVER
* pWebServer
1139 Start the web server port creation timer
1141 @param [in] pWebServer The web server control structure address.
1143 @retval EFI_SUCCESS The timer was successfully started.
1144 @retval EFI_ALREADY_STARTED The timer is already running.
1145 @retval Other The timer failed to start.
1149 WebServerTimerStart (
1150 IN DT_WEB_SERVER
* pWebServer
1154 Stop the web server port creation timer
1156 @param [in] pWebServer The web server control structure address.
1158 @retval EFI_SUCCESS The HTTP port timer is stopped
1159 @retval Other Failed to stop the HTTP port timer
1163 WebServerTimerStop (
1164 IN DT_WEB_SERVER
* pWebServer
1167 //------------------------------------------------------------------------------
1168 // Driver Binding Protocol Support
1169 //------------------------------------------------------------------------------
1172 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
1173 closing the DevicePath and PciIo protocols on Controller.
1175 @param [in] pThis Protocol instance pointer.
1176 @param [in] Controller Handle of device to stop driver on.
1177 @param [in] NumberOfChildren How many children need to be stopped.
1178 @param [in] pChildHandleBuffer Not used.
1180 @retval EFI_SUCCESS This driver is removed Controller.
1181 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
1182 @retval other This driver was not removed from this device.
1188 IN EFI_DRIVER_BINDING_PROTOCOL
* pThis
,
1189 IN EFI_HANDLE Controller
,
1190 IN UINTN NumberOfChildren
,
1191 IN EFI_HANDLE
* pChildHandleBuffer
1194 //------------------------------------------------------------------------------
1195 // EFI Component Name Protocol Support
1196 //------------------------------------------------------------------------------
1199 Retrieves a Unicode string that is the user readable name of the driver.
1201 This function retrieves the user readable name of a driver in the form of a
1202 Unicode string. If the driver specified by This has a user readable name in
1203 the language specified by Language, then a pointer to the driver name is
1204 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1205 by This does not support the language specified by Language,
1206 then EFI_UNSUPPORTED is returned.
1208 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1209 EFI_COMPONENT_NAME_PROTOCOL instance.
1210 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1211 array indicating the language. This is the
1212 language of the driver name that the caller is
1213 requesting, and it must match one of the
1214 languages specified in SupportedLanguages. The
1215 number of languages supported by a driver is up
1216 to the driver writer. Language is specified
1217 in RFC 3066 or ISO 639-2 language code format.
1218 @param [out] ppDriverName A pointer to the Unicode string to return.
1219 This Unicode string is the name of the
1220 driver specified by This in the language
1221 specified by Language.
1223 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1224 This and the language specified by Language was
1225 returned in DriverName.
1226 @retval EFI_INVALID_PARAMETER Language is NULL.
1227 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1228 @retval EFI_UNSUPPORTED The driver specified by This does not support
1229 the language specified by Language.
1235 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1236 IN CHAR8
* pLanguage
,
1237 OUT CHAR16
** ppDriverName
1242 Retrieves a Unicode string that is the user readable name of the controller
1243 that is being managed by a driver.
1245 This function retrieves the user readable name of the controller specified by
1246 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1247 driver specified by This has a user readable name in the language specified by
1248 Language, then a pointer to the controller name is returned in ControllerName,
1249 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1250 managing the controller specified by ControllerHandle and ChildHandle,
1251 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1252 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1254 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1255 EFI_COMPONENT_NAME_PROTOCOL instance.
1256 @param [in] ControllerHandle The handle of a controller that the driver
1257 specified by This is managing. This handle
1258 specifies the controller whose name is to be
1260 @param [in] ChildHandle The handle of the child controller to retrieve
1261 the name of. This is an optional parameter that
1262 may be NULL. It will be NULL for device
1263 drivers. It will also be NULL for a bus drivers
1264 that wish to retrieve the name of the bus
1265 controller. It will not be NULL for a bus
1266 driver that wishes to retrieve the name of a
1268 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1269 array indicating the language. This is the
1270 language of the driver name that the caller is
1271 requesting, and it must match one of the
1272 languages specified in SupportedLanguages. The
1273 number of languages supported by a driver is up
1274 to the driver writer. Language is specified in
1275 RFC 3066 or ISO 639-2 language code format.
1276 @param [out] ppControllerName A pointer to the Unicode string to return.
1277 This Unicode string is the name of the
1278 controller specified by ControllerHandle and
1279 ChildHandle in the language specified by
1280 Language from the point of view of the driver
1283 @retval EFI_SUCCESS The Unicode string for the user readable name in
1284 the language specified by Language for the
1285 driver specified by This was returned in
1287 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1288 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1290 @retval EFI_INVALID_PARAMETER Language is NULL.
1291 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1292 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1293 managing the controller specified by
1294 ControllerHandle and ChildHandle.
1295 @retval EFI_UNSUPPORTED The driver specified by This does not support
1296 the language specified by Language.
1302 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1303 IN EFI_HANDLE ControllerHandle
,
1304 IN OPTIONAL EFI_HANDLE ChildHandle
,
1305 IN CHAR8
* pLanguage
,
1306 OUT CHAR16
** ppControllerName
1309 //------------------------------------------------------------------------------
1311 #endif // _WEB_SERVER_H_