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 <Library/BaseMemoryLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/UefiApplicationEntryPoint.h>
28 #include <Library/UefiBootServicesTableLib.h>
29 #include <Library/UefiLib.h>
30 #include <Protocol/BlockIo.h>
32 #include <netinet/in.h>
34 #include <sys/EfiSysCall.h>
36 #include <sys/socket.h>
38 #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
39 #pragma warning ( disable : 4054 )
40 #pragma warning ( disable : 4152 )
41 #endif // defined(_MSC_VER)
43 //------------------------------------------------------------------------------
45 //------------------------------------------------------------------------------
47 #define PAGE_ACPI_APIC L"/APIC"
48 #define PAGE_ACPI_BGRT L"/BGRT"
49 #define PAGE_ACPI_DSDT L"/DSDT"
50 #define PAGE_ACPI_FADT L"/FADT"
51 #define PAGE_ACPI_HPET L"/HPET"
52 #define PAGE_ACPI_MCFG L"/MCFG"
53 #define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"
54 #define PAGE_ACPI_RSDP_30 L"/RSDP3.0"
55 #define PAGE_ACPI_RSDT L"/RSDT"
56 #define PAGE_ACPI_SSDT L"/SSDT"
57 #define PAGE_ACPI_TCPA L"/TCPA"
58 #define PAGE_ACPI_UEFI L"/UEFI"
59 #define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"
60 #define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"
61 #define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"
62 #define PAGE_RUNTIME_SERVICES_TABLE L"/RuntimeServicesTable"
64 //------------------------------------------------------------------------------
66 //------------------------------------------------------------------------------
68 #define APIC_SIGNATURE 0x43495041
69 #define BGRT_SIGNATURE 0x54524742
70 #define DSDT_SIGNATURE 0x54445344
71 #define FADT_SIGNATURE 0x50434146
72 #define HPET_SIGNATURE 0x54455048
73 #define MCFG_SIGNATURE 0x4746434d
74 #define SSDT_SIGNATURE 0x54445353
75 #define TCPA_SIGNATURE 0x41504354
76 #define UEFI_SIGNATURE 0x49464555
78 //------------------------------------------------------------------------------
80 //------------------------------------------------------------------------------
82 #if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
83 #define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry
84 #define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit
85 #define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value
86 #define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value
87 #define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value
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
92 #define DBG_EXIT_DEC(Status)
93 #define DBG_EXIT_HEX(Status)
94 #define DBG_EXIT_STATUS(Status)
95 #define DBG_EXIT_TF(Status)
98 #define DIM(x) ( sizeof ( x ) / sizeof ( x[0] )) ///< Compute the number of entries in an array
100 //------------------------------------------------------------------------------
102 //------------------------------------------------------------------------------
104 #define DEBUG_SOCKET_POLL 0x00080000 ///< Display the socket poll messages
105 #define DEBUG_PORT_WORK 0x00040000 ///< Display the port work messages
106 #define DEBUG_SERVER_LISTEN 0x00020000 ///< Display the socket poll messages
107 #define DEBUG_HTTP_PORT 0x00010000 ///< Display HTTP port related messages
108 #define DEBUG_REQUEST 0x00008000 ///< Display the HTTP request messages
110 #define HTTP_PORT_POLL_DELAY ( 2 * 1000 ) ///< Delay in milliseconds for attempts to open the HTTP port
111 #define CLIENT_POLL_DELAY 50 ///< Delay in milliseconds between client polls
113 #define TPL_WEB_SERVER TPL_CALLBACK ///< TPL for routine synchronization
118 This macro which is enabled when debug is enabled verifies that
119 the new TPL value is >= the current TPL value.
125 #if !defined(MDEPKG_NDEBUG)
127 #define VERIFY_TPL(tpl) \
129 EFI_TPL PreviousTpl; \
131 PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \
132 gBS->RestoreTPL ( PreviousTpl ); \
133 if ( PreviousTpl > tpl ) { \
134 DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \
135 ASSERT ( PreviousTpl <= tpl ); \
139 #else // MDEPKG_NDEBUG
141 #define VERIFY_TPL(tpl)
143 #endif // MDEPKG_NDEBUG
145 #define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
147 #define SPACES_ADDRESS_TO_DATA 2
148 #define BYTES_ON_A_LINE 16
149 #define SPACES_BETWEEN_BYTES 1
150 #define SPACES_DATA_TO_ASCII 2
153 //------------------------------------------------------------------------------
154 // Protocol Declarations
155 //------------------------------------------------------------------------------
157 extern EFI_COMPONENT_NAME_PROTOCOL gComponentName
; ///< Component name protocol declaration
158 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
; ///< Component name 2 protocol declaration
159 extern EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
; ///< Driver binding protocol declaration
161 //------------------------------------------------------------------------------
163 //------------------------------------------------------------------------------
166 Port control structure
172 size_t RequestLength
; ///< Request length in bytes
173 size_t TxBytes
; ///< Bytes in the TX buffer
174 UINT8 Request
[ 65536 ]; ///< Page request
175 UINT8 RxBuffer
[ 65536 ]; ///< Receive buffer
176 UINT8 TxBuffer
[ 65536 ]; ///< Transmit buffer
180 Web server control structure
183 UINTN Signature
; ///< Structure identification
188 EFI_HANDLE ImageHandle
; ///< Image handle
191 // HTTP port management
193 BOOLEAN bRunning
; ///< Web server running
194 EFI_EVENT TimerEvent
; ///< Timer to open HTTP port
195 int HttpListenPort
; ///< File descriptor for the HTTP listen port over TCP4
196 int HttpListenPort6
; ///< File descriptor for the HTTP listen port over TCP6
199 // Client port management
201 nfds_t MaxEntries
; ///< Maximum entries in the PortList array
202 nfds_t Entries
; ///< The current number of entries in the PortList array
203 struct pollfd
* pFdList
; ///< List of socket file descriptors
204 WSDT_PORT
** ppPortList
; ///< List of port management structures
207 //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
209 extern DT_WEB_SERVER mWebServer
;
212 Process an HTTP request
214 @param [in] SocketFD The socket's file descriptor to add to the list.
215 @param [in] pPort The WSDT_PORT structure address
216 @param [out] pbDone Address to receive the request completion status
218 @retval EFI_SUCCESS The request was successfully processed
225 IN WSDT_PORT
* pPort
,
230 Data structure to delcare page support routines
233 UINT16
* pPageName
; ///< Name of the page
234 PFN_RESPONSE pfnResponse
; ///< Routine to generate the response
235 UINT16
* pDescription
; ///< Description of the page
238 extern CONST DT_PAGE mPageList
[]; ///< List of pages
239 extern CONST UINTN mPageCount
; ///< Number of pages
241 //------------------------------------------------------------------------------
243 //------------------------------------------------------------------------------
246 Respond with the APIC table
248 @param [in] SocketFD The socket's file descriptor to add to the list.
249 @param [in] pPort The WSDT_PORT structure address
250 @param [out] pbDone Address to receive the request completion status
252 @retval EFI_SUCCESS The request was successfully processed
258 IN WSDT_PORT
* pPort
,
263 Respond with the BGRT table
265 @param [in] SocketFD The socket's file descriptor to add to the list.
266 @param [in] pPort The WSDT_PORT structure address
267 @param [out] pbDone Address to receive the request completion status
269 @retval EFI_SUCCESS The request was successfully processed
275 IN WSDT_PORT
* pPort
,
280 Respond with the ACPI DSDT table
282 @param [in] SocketFD The socket's file descriptor to add to the list.
283 @param [in] pPort The WSDT_PORT structure address
284 @param [out] pbDone Address to receive the request completion status
286 @retval EFI_SUCCESS The request was successfully processed
292 IN WSDT_PORT
* pPort
,
297 Respond with the ACPI FADT table
299 @param [in] SocketFD The socket's file descriptor to add to the list.
300 @param [in] pPort The WSDT_PORT structure address
301 @param [out] pbDone Address to receive the request completion status
303 @retval EFI_SUCCESS The request was successfully processed
309 IN WSDT_PORT
* pPort
,
314 Respond with the HPET table
316 @param [in] SocketFD The socket's file descriptor to add to the list.
317 @param [in] pPort The WSDT_PORT structure address
318 @param [out] pbDone Address to receive the request completion status
320 @retval EFI_SUCCESS The request was successfully processed
326 IN WSDT_PORT
* pPort
,
331 Respond with the MCFG table
333 @param [in] SocketFD The socket's file descriptor to add to the list.
334 @param [in] pPort The WSDT_PORT structure address
335 @param [out] pbDone Address to receive the request completion status
337 @retval EFI_SUCCESS The request was successfully processed
343 IN WSDT_PORT
* pPort
,
348 Respond with the ACPI RSDP 1.0b table
350 @param [in] SocketFD The socket's file descriptor to add to the list.
351 @param [in] pPort The WSDT_PORT structure address
352 @param [out] pbDone Address to receive the request completion status
354 @retval EFI_SUCCESS The request was successfully processed
360 IN WSDT_PORT
* pPort
,
365 Respond with the ACPI RSDP 3.0 table
367 @param [in] SocketFD The socket's file descriptor to add to the list.
368 @param [in] pPort The WSDT_PORT structure address
369 @param [out] pbDone Address to receive the request completion status
371 @retval EFI_SUCCESS The request was successfully processed
377 IN WSDT_PORT
* pPort
,
382 Respond with the ACPI RSDT table
384 @param [in] SocketFD The socket's file descriptor to add to the list.
385 @param [in] pPort The WSDT_PORT structure address
386 @param [out] pbDone Address to receive the request completion status
388 @retval EFI_SUCCESS The request was successfully processed
394 IN WSDT_PORT
* pPort
,
399 Respond with the SSDT table
401 @param [in] SocketFD The socket's file descriptor to add to the list.
402 @param [in] pPort The WSDT_PORT structure address
403 @param [out] pbDone Address to receive the request completion status
405 @retval EFI_SUCCESS The request was successfully processed
411 IN WSDT_PORT
* pPort
,
416 Respond with the TCPA table
418 @param [in] SocketFD The socket's file descriptor to add to the list.
419 @param [in] pPort The WSDT_PORT structure address
420 @param [out] pbDone Address to receive the request completion status
422 @retval EFI_SUCCESS The request was successfully processed
428 IN WSDT_PORT
* pPort
,
433 Respond with the UEFI table
435 @param [in] SocketFD The socket's file descriptor to add to the list.
436 @param [in] pPort The WSDT_PORT structure address
437 @param [out] pbDone Address to receive the request completion status
439 @retval EFI_SUCCESS The request was successfully processed
445 IN WSDT_PORT
* pPort
,
450 Respond with the boot services table
452 @param [in] SocketFD The socket's file descriptor to add to the list.
453 @param [in] pPort The WSDT_PORT structure address
454 @param [out] pbDone Address to receive the request completion status
456 @retval EFI_SUCCESS The request was successfully processed
460 BootServicesTablePage (
462 IN WSDT_PORT
* pPort
,
467 Respond with the configuration tables
469 @param [in] SocketFD The socket's file descriptor to add to the list.
470 @param [in] pPort The WSDT_PORT structure address
471 @param [out] pbDone Address to receive the request completion status
473 @retval EFI_SUCCESS The request was successfully processed
477 ConfigurationTablePage (
479 IN WSDT_PORT
* pPort
,
484 Respond with the DHCP options
486 @param [in] SocketFD The socket's file descriptor to add to the list.
487 @param [in] pPort The WSDT_PORT structure address
488 @param [out] pbDone Address to receive the request completion status
490 @retval EFI_SUCCESS The request was successfully processed
496 IN WSDT_PORT
* pPort
,
501 Respond with the DXE services table
503 @param [in] SocketFD The socket's file descriptor to add to the list.
504 @param [in] pPort The WSDT_PORT structure address
505 @param [out] pbDone Address to receive the request completion status
507 @retval EFI_SUCCESS The request was successfully processed
511 DxeServicesTablePage (
513 IN WSDT_PORT
* pPort
,
518 Respond with the Exit page
520 @param [in] SocketFD The socket's file descriptor to add to the list.
521 @param [in] pPort The WSDT_PORT structure address
522 @param [out] pbDone Address to receive the request completion status
524 @retval EFI_SUCCESS The request was successfully processed
530 IN WSDT_PORT
* pPort
,
535 Respond with the firmware status
537 @param [in] SocketFD The socket's file descriptor to add to the list.
538 @param [in] pPort The WSDT_PORT structure address
539 @param [out] pbDone Address to receive the request completion status
541 @retval EFI_SUCCESS The request was successfully processed
547 IN WSDT_PORT
* pPort
,
552 Respond with the handles in the system
554 @param [in] SocketFD The socket's file descriptor to add to the list.
555 @param [in] pPort The WSDT_PORT structure address
556 @param [out] pbDone Address to receive the request completion status
558 @retval EFI_SUCCESS The request was successfully processed
564 IN WSDT_PORT
* pPort
,
569 Respond with the Hello World page
571 @param [in] SocketFD The socket's file descriptor to add to the list.
572 @param [in] pPort The WSDT_PORT structure address
573 @param [out] pbDone Address to receive the request completion status
575 @retval EFI_SUCCESS The request was successfully processed
581 IN WSDT_PORT
* pPort
,
586 Respond with the list of known pages
588 @param [in] SocketFD The socket's file descriptor to add to the list.
589 @param [in] pPort The WSDT_PORT structure address
590 @param [out] pbDone Address to receive the request completion status
592 @retval EFI_SUCCESS The request was successfully processed
598 IN WSDT_PORT
* pPort
,
603 Page to display the memory map
605 @param [in] SocketFD The socket's file descriptor to add to the list.
606 @param [in] pPort The WSDT_PORT structure address
607 @param [out] pbDone Address to receive the request completion status
609 @retval EFI_SUCCESS The request was successfully processed
615 IN WSDT_PORT
* pPort
,
620 Display the memory type registers
622 @param [in] SocketFD The socket's file descriptor to add to the list.
623 @param [in] pPort The WSDT_PORT structure address
624 @param [out] pbDone Address to receive the request completion status
626 @retval EFI_SUCCESS The request was successfully processed
630 MemoryTypeRegistersPage (
632 IN WSDT_PORT
* pPort
,
637 Respond with the Ports page
639 @param [in] SocketFD The socket's file descriptor to add to the list.
640 @param [in] pPort The WSDT_PORT structure address
641 @param [out] pbDone Address to receive the request completion status
643 @retval EFI_SUCCESS The request was successfully processed
649 IN WSDT_PORT
* pPort
,
654 Page to reboot the system
656 @param [in] SocketFD The socket's file descriptor to add to the list.
657 @param [in] pPort The WSDT_PORT structure address
658 @param [out] pbDone Address to receive the request completion status
660 @retval EFI_SUCCESS The request was successfully processed
666 IN WSDT_PORT
* pPort
,
671 Respond with the runtime services table
673 @param [in] SocketFD The socket's file descriptor to add to the list.
674 @param [in] pPort The WSDT_PORT structure address
675 @param [out] pbDone Address to receive the request completion status
677 @retval EFI_SUCCESS The request was successfully processed
681 RuntimeSservicesTablePage (
683 IN WSDT_PORT
* pPort
,
688 Respond with the system table
690 @param [in] SocketFD The socket's file descriptor to add to the list.
691 @param [in] pPort The WSDT_PORT structure address
692 @param [out] pbDone Address to receive the request completion status
694 @retval EFI_SUCCESS The request was successfully processed
700 IN WSDT_PORT
* pPort
,
704 //------------------------------------------------------------------------------
706 //------------------------------------------------------------------------------
709 Display the EFI Table Header
711 @param [in] SocketFD The socket's file descriptor to add to the list.
712 @param [in] pPort The WSDT_PORT structure address
713 @param [in] pHeader Address of the EFI_TABLE_HEADER structure
715 @retval EFI_SUCCESS The request was successfully processed
721 IN WSDT_PORT
* pPort
,
722 IN EFI_TABLE_HEADER
* pHeader
726 Buffer the HTTP page header
728 @param [in] SocketFD The socket's file descriptor to add to the list.
729 @param [in] pPort The WSDT_PORT structure address
730 @param [in] pTitle A zero terminated Unicode title string
732 @retval EFI_SUCCESS The request was successfully processed
738 IN WSDT_PORT
* pPort
,
739 IN CONST CHAR16
* pTitle
743 Buffer and send the HTTP page trailer
745 @param [in] SocketFD The socket's file descriptor to add to the list.
746 @param [in] pPort The WSDT_PORT structure address
747 @param [out] pbDone Address to receive the request completion status
749 @retval EFI_SUCCESS The request was successfully processed
755 IN WSDT_PORT
* pPort
,
760 Process an HTTP request
762 @param [in] SocketFD The socket's file descriptor to add to the list.
763 @param [in] pPort The WSDT_PORT structure address
764 @param [out] pbDone Address to receive the request completion status
766 @retval EFI_SUCCESS The request was successfully processed
772 IN WSDT_PORT
* pPort
,
777 Buffer data for sending
779 @param [in] SocketFD The socket's file descriptor to add to the list.
780 @param [in] pPort The WSDT_PORT structure address
781 @param [in] LengthInBytes Length of valid data in the buffer
782 @param [in] pBuffer Buffer of data to send
784 @retval EFI_SUCCESS The request was successfully processed
790 IN WSDT_PORT
* pPort
,
791 IN
size_t LengthInBytes
,
792 IN CONST UINT8
* pBuffer
798 @param [in] SocketFD The socket's file descriptor to add to the list.
799 @param [in] pPort The WSDT_PORT structure address
800 @param [in] pString A zero terminated Unicode string
802 @retval EFI_SUCCESS The request was successfully processed
808 IN WSDT_PORT
* pPort
,
809 IN CONST
char * pString
815 @param [in] SocketFD The socket's file descriptor to add to the list.
816 @param [in] pPort The WSDT_PORT structure address
817 @param [in] Data The data byte to send
819 @retval EFI_SUCCESS The request was successfully processed
825 IN WSDT_PORT
* pPort
,
832 @param [in] SocketFD The socket's file descriptor to add to the list.
833 @param [in] pPort The WSDT_PORT structure address
834 @param [in] Character Character to display
835 @param [in] pReplacement Replacement character string
837 @retval EFI_SUCCESS The request was successfully processed
843 IN WSDT_PORT
* pPort
,
845 IN CHAR8
* pReplacement
851 @param [in] SocketFD The socket's file descriptor to add to the list.
852 @param [in] pPort The WSDT_PORT structure address
853 @param [in] ByteCount The number of bytes to display
854 @param [in] pData Address of the byte array
856 @retval EFI_SUCCESS The request was successfully processed
862 IN WSDT_PORT
* pPort
,
864 IN CONST UINT8
* pData
868 Display a row containing a GUID value
870 @param [in] SocketFD The socket's file descriptor to add to the list.
871 @param [in] pPort The WSDT_PORT structure address
872 @param [in] pGuid Address of the GUID to display
874 @retval EFI_SUCCESS The request was successfully processed
880 IN WSDT_PORT
* pPort
,
881 IN CONST EFI_GUID
* pGuid
885 Output a hex value to the HTML page
887 @param [in] SocketFD Socket file descriptor
888 @param [in] pPort The WSDT_PORT structure address
889 @param [in] Bits Number of bits to display
890 @param [in] Value Value to display
892 @retval EFI_SUCCESS Successfully displayed the address
897 IN WSDT_PORT
* pPort
,
903 Output a hex value to the HTML page
905 @param [in] SocketFD Socket file descriptor
906 @param [in] pPort The WSDT_PORT structure address
907 @param [in] Value Value to display
909 @retval EFI_SUCCESS Successfully displayed the address
914 IN WSDT_PORT
* pPort
,
919 Output an IP address to the HTML page
921 @param [in] SocketFD Socket file descriptor
922 @param [in] pPort The WSDT_PORT structure address
923 @param [in] pAddress Address of the socket address
925 @retval EFI_SUCCESS Successfully displayed the address
930 IN WSDT_PORT
* pPort
,
931 IN
struct sockaddr_in6
* pAddress
935 Send a Unicode string
937 @param [in] SocketFD The socket's file descriptor to add to the list.
938 @param [in] pPort The WSDT_PORT structure address
939 @param [in] pString A zero terminated Unicode string
941 @retval EFI_SUCCESS The request was successfully processed
945 HttpSendUnicodeString (
947 IN WSDT_PORT
* pPort
,
948 IN CONST UINT16
* pString
952 Output a value to the HTML page
954 @param [in] SocketFD Socket file descriptor
955 @param [in] pPort The WSDT_PORT structure address
956 @param [in] Value Value to display
958 @retval EFI_SUCCESS Successfully displayed the address
963 IN WSDT_PORT
* pPort
,
968 Display a row containing a decimal value
970 @param [in] SocketFD The socket's file descriptor to add to the list.
971 @param [in] pPort The WSDT_PORT structure address
972 @param [in] pName Address of a zero terminated name string
973 @param [in] Value The value to display
975 @retval EFI_SUCCESS The request was successfully processed
981 IN WSDT_PORT
* pPort
,
982 IN CONST CHAR8
* pName
,
987 Display a row containing a GUID value
989 @param [in] SocketFD The socket's file descriptor to add to the list.
990 @param [in] pPort The WSDT_PORT structure address
991 @param [in] pName Address of a zero terminated name string
992 @param [in] pGuid Address of the GUID to display
994 @retval EFI_SUCCESS The request was successfully processed
1000 IN WSDT_PORT
* pPort
,
1001 IN CONST CHAR8
* pName
,
1002 IN CONST EFI_GUID
* pGuid
1006 Display a row containing a hex value
1008 @param [in] SocketFD The socket's file descriptor to add to the list.
1009 @param [in] pPort The WSDT_PORT structure address
1010 @param [in] pName Address of a zero terminated name string
1011 @param [in] Value The value to display
1012 @param [in] pWebPage Address of a zero terminated web page name
1014 @retval EFI_SUCCESS The request was successfully processed
1020 IN WSDT_PORT
* pPort
,
1021 IN CONST CHAR8
* pName
,
1023 IN CONST CHAR16
* pWebPage
1027 Display a row containing a pointer
1029 @param [in] SocketFD The socket's file descriptor to add to the list.
1030 @param [in] pPort The WSDT_PORT structure address
1031 @param [in] pName Address of a zero terminated name string
1032 @param [in] pAddress The address to display
1033 @param [in] pWebPage Address of a zero terminated web page name
1035 @retval EFI_SUCCESS The request was successfully processed
1041 IN WSDT_PORT
* pPort
,
1042 IN CONST CHAR8
* pName
,
1043 IN CONST VOID
* pAddress
,
1044 IN CONST CHAR16
* pWebPage
1048 Display a row containing a revision
1050 @param [in] SocketFD The socket's file descriptor to add to the list.
1051 @param [in] pPort The WSDT_PORT structure address
1052 @param [in] pName Address of a zero terminated name string
1053 @param [in] Revision The revision to display
1055 @retval EFI_SUCCESS The request was successfully processed
1061 IN WSDT_PORT
* pPort
,
1062 IN CONST CHAR8
* pName
,
1067 Display a row containing a unicode string
1069 @param [in] SocketFD The socket's file descriptor to add to the list.
1070 @param [in] pPort The WSDT_PORT structure address
1071 @param [in] pName Address of a zero terminated name string
1072 @param [in] pString Address of a zero terminated unicode string
1074 @retval EFI_SUCCESS The request was successfully processed
1080 IN WSDT_PORT
* pPort
,
1081 IN CONST CHAR8
* pName
,
1082 IN CONST CHAR16
* pString
1086 Start the table page
1088 @param [in] SocketFD The socket's file descriptor to add to the list.
1089 @param [in] pPort The WSDT_PORT structure address
1090 @param [in] pName Address of a zero terminated name string
1091 @param [in] pTable Address of the table
1093 @retval EFI_SUCCESS The request was successfully processed
1099 IN WSDT_PORT
* pPort
,
1100 IN CONST CHAR16
* pName
,
1101 IN CONST VOID
* pTable
1107 @param [in] SocketFD The socket's file descriptor to add to the list.
1108 @param [in] pPort The WSDT_PORT structure address
1109 @param [out] pbDone Address to receive the request completion status
1111 @retval EFI_SUCCESS The request was successfully processed
1117 IN WSDT_PORT
* pPort
,
1122 HTTP port creation timer routine
1124 This routine polls the socket layer waiting for the initial network connection
1125 which will enable the creation of the HTTP port. The socket layer will manage
1126 the coming and going of the network connections after that until the last network
1127 connection is broken.
1129 @param [in] pWebServer The web server control structure address.
1134 IN DT_WEB_SERVER
* pWebServer
1138 Start the web server port creation timer
1140 @param [in] pWebServer The web server control structure address.
1142 @retval EFI_SUCCESS The timer was successfully started.
1143 @retval EFI_ALREADY_STARTED The timer is already running.
1144 @retval Other The timer failed to start.
1148 WebServerTimerStart (
1149 IN DT_WEB_SERVER
* pWebServer
1153 Stop the web server port creation timer
1155 @param [in] pWebServer The web server control structure address.
1157 @retval EFI_SUCCESS The HTTP port timer is stopped
1158 @retval Other Failed to stop the HTTP port timer
1162 WebServerTimerStop (
1163 IN DT_WEB_SERVER
* pWebServer
1166 //------------------------------------------------------------------------------
1167 // Driver Binding Protocol Support
1168 //------------------------------------------------------------------------------
1171 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
1172 closing the DevicePath and PciIo protocols on Controller.
1174 @param [in] pThis Protocol instance pointer.
1175 @param [in] Controller Handle of device to stop driver on.
1176 @param [in] NumberOfChildren How many children need to be stopped.
1177 @param [in] pChildHandleBuffer Not used.
1179 @retval EFI_SUCCESS This driver is removed Controller.
1180 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
1181 @retval other This driver was not removed from this device.
1187 IN EFI_DRIVER_BINDING_PROTOCOL
* pThis
,
1188 IN EFI_HANDLE Controller
,
1189 IN UINTN NumberOfChildren
,
1190 IN EFI_HANDLE
* pChildHandleBuffer
1193 //------------------------------------------------------------------------------
1194 // EFI Component Name Protocol Support
1195 //------------------------------------------------------------------------------
1198 Retrieves a Unicode string that is the user readable name of the driver.
1200 This function retrieves the user readable name of a driver in the form of a
1201 Unicode string. If the driver specified by This has a user readable name in
1202 the language specified by Language, then a pointer to the driver name is
1203 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1204 by This does not support the language specified by Language,
1205 then EFI_UNSUPPORTED is returned.
1207 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1208 EFI_COMPONENT_NAME_PROTOCOL instance.
1209 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1210 array indicating the language. This is the
1211 language of the driver name that the caller is
1212 requesting, and it must match one of the
1213 languages specified in SupportedLanguages. The
1214 number of languages supported by a driver is up
1215 to the driver writer. Language is specified
1216 in RFC 3066 or ISO 639-2 language code format.
1217 @param [out] ppDriverName A pointer to the Unicode string to return.
1218 This Unicode string is the name of the
1219 driver specified by This in the language
1220 specified by Language.
1222 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1223 This and the language specified by Language was
1224 returned in DriverName.
1225 @retval EFI_INVALID_PARAMETER Language is NULL.
1226 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1227 @retval EFI_UNSUPPORTED The driver specified by This does not support
1228 the language specified by Language.
1234 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1235 IN CHAR8
* pLanguage
,
1236 OUT CHAR16
** ppDriverName
1241 Retrieves a Unicode string that is the user readable name of the controller
1242 that is being managed by a driver.
1244 This function retrieves the user readable name of the controller specified by
1245 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1246 driver specified by This has a user readable name in the language specified by
1247 Language, then a pointer to the controller name is returned in ControllerName,
1248 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1249 managing the controller specified by ControllerHandle and ChildHandle,
1250 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1251 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1253 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1254 EFI_COMPONENT_NAME_PROTOCOL instance.
1255 @param [in] ControllerHandle The handle of a controller that the driver
1256 specified by This is managing. This handle
1257 specifies the controller whose name is to be
1259 @param [in] ChildHandle The handle of the child controller to retrieve
1260 the name of. This is an optional parameter that
1261 may be NULL. It will be NULL for device
1262 drivers. It will also be NULL for a bus drivers
1263 that wish to retrieve the name of the bus
1264 controller. It will not be NULL for a bus
1265 driver that wishes to retrieve the name of a
1267 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1268 array indicating the language. This is the
1269 language of the driver name that the caller is
1270 requesting, and it must match one of the
1271 languages specified in SupportedLanguages. The
1272 number of languages supported by a driver is up
1273 to the driver writer. Language is specified in
1274 RFC 3066 or ISO 639-2 language code format.
1275 @param [out] ppControllerName A pointer to the Unicode string to return.
1276 This Unicode string is the name of the
1277 controller specified by ControllerHandle and
1278 ChildHandle in the language specified by
1279 Language from the point of view of the driver
1282 @retval EFI_SUCCESS The Unicode string for the user readable name in
1283 the language specified by Language for the
1284 driver specified by This was returned in
1286 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1287 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1289 @retval EFI_INVALID_PARAMETER Language is NULL.
1290 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1291 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1292 managing the controller specified by
1293 ControllerHandle and ChildHandle.
1294 @retval EFI_UNSUPPORTED The driver specified by This does not support
1295 the language specified by Language.
1301 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1302 IN EFI_HANDLE ControllerHandle
,
1303 IN OPTIONAL EFI_HANDLE ChildHandle
,
1304 IN CHAR8
* pLanguage
,
1305 OUT CHAR16
** ppControllerName
1308 //------------------------------------------------------------------------------
1310 #endif // _WEB_SERVER_H_