]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/WebServer/WebServer.h
Merged socket development branch:
[mirror_edk2.git] / AppPkg / Applications / Sockets / WebServer / WebServer.h
index 6078df0362acc2269fa3268d51b807fdb14b5b45..a5dcea49698ff9fd907ea74c622202f855571852 100644 (file)
@@ -86,7 +86,7 @@
 \r
 #define DEBUG_SOCKET_POLL       0x00080000  ///<  Display the socket poll messages\r
 #define DEBUG_PORT_WORK         0x00040000  ///<  Display the port work messages\r
-#define DEBUG_SERVER_TIMER      0x00020000  ///<  Display the socket poll messages\r
+#define DEBUG_SERVER_LISTEN     0x00020000  ///<  Display the socket poll messages\r
 #define DEBUG_HTTP_PORT         0x00010000  ///<  Display HTTP port related messages\r
 #define DEBUG_REQUEST           0x00008000  ///<  Display the HTTP request messages\r
 \r
 \r
 #endif  //  MDEPKG_NDEBUG\r
 \r
-#define WEB_SERVER_SIGNATURE        SIGNATURE_32('W','e','b','S') ///<  DT_WEB_SERVER memory signature\r
+#define WEB_SERVER_SIGNATURE        SIGNATURE_32 ('W','e','b','S')  ///<  DT_WEB_SERVER memory signature\r
 \r
 #define SPACES_ADDRESS_TO_DATA      2\r
 #define BYTES_ON_A_LINE             16\r
@@ -154,9 +154,9 @@ typedef struct {
   //\r
   size_t    RequestLength;      ///<  Request length in bytes\r
   size_t    TxBytes;            ///<  Bytes in the TX buffer\r
-  UINT8     Request [ 65536 ];  ///<  Page request\r
-  UINT8     RxBuffer [ 65536 ]; ///<  Receive buffer\r
-  UINT8     TxBuffer [ 65536 ]; ///<  Transmit buffer\r
+  UINT8     Request[ 65536 ];   ///<  Page request\r
+  UINT8     RxBuffer[ 65536 ];  ///<  Receive buffer\r
+  UINT8     TxBuffer[ 65536 ];  ///<  Transmit buffer\r
 } WSDT_PORT;\r
 \r
 /**\r
@@ -173,9 +173,10 @@ typedef struct {
   //\r
   //  HTTP port management\r
   //\r
-  BOOLEAN   bTimerRunning;      ///<  Port creation timer status\r
+  BOOLEAN   bRunning;           ///<  Web server running\r
   EFI_EVENT TimerEvent;         ///<  Timer to open HTTP port\r
-  int       HttpListenPort;     ///<  File descriptor for the HTTP listen port\r
+  int       HttpListenPort;     ///<  File descriptor for the HTTP listen port over TCP4\r
+  int       HttpListenPort6;    ///<  File descriptor for the HTTP listen port over TCP6\r
 \r
   //\r
   //  Client port management\r
@@ -186,7 +187,7 @@ typedef struct {
   WSDT_PORT ** ppPortList;      ///<  List of port management structures\r
 } DT_WEB_SERVER;\r
 \r
-//#define SERVER_FROM_SERVICE(a) CR(a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding\r
+//#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE)  ///< Locate DT_LAYER from service binding\r
 \r
 extern DT_WEB_SERVER mWebServer;\r
 \r
@@ -217,7 +218,7 @@ typedef struct {
   UINT16 * pDescription;      ///<  Description of the page\r
 } DT_PAGE;\r
 \r
-extern CONST DT_PAGE mPageList [];  ///<  List of pages\r
+extern CONST DT_PAGE mPageList[];   ///<  List of pages\r
 extern CONST UINTN mPageCount;      ///<  Number of pages\r
 \r
 //------------------------------------------------------------------------------\r
@@ -377,6 +378,23 @@ DxeServicesTablePage (
   OUT BOOLEAN * pbDone\r
   );\r
 \r
+/**\r
+  Respond with the Exit page\r
+\r
+  @param [in] SocketFD      The socket's file descriptor to add to the list.\r
+  @param [in] pPort         The WSDT_PORT structure address\r
+  @param [out] pbDone       Address to receive the request completion status\r
+\r
+  @retval EFI_SUCCESS       The request was successfully processed\r
+\r
+**/\r
+EFI_STATUS\r
+ExitPage (\r
+  IN int SocketFD,\r
+  IN WSDT_PORT * pPort,\r
+  OUT BOOLEAN * pbDone\r
+  );\r
+\r
 /**\r
   Respond with the firmware status\r
 \r
@@ -445,6 +463,23 @@ IndexPage (
   OUT BOOLEAN * pbDone\r
   );\r
 \r
+/**\r
+  Respond with the Ports page\r
+\r
+  @param [in] SocketFD      The socket's file descriptor to add to the list.\r
+  @param [in] pPort         The WSDT_PORT structure address\r
+  @param [out] pbDone       Address to receive the request completion status\r
+\r
+  @retval EFI_SUCCESS       The request was successfully processed\r
+\r
+**/\r
+EFI_STATUS\r
+PortsPage (\r
+  IN int SocketFD,\r
+  IN WSDT_PORT * pPort,\r
+  OUT BOOLEAN * pbDone\r
+  );\r
+\r
 /**\r
   Page to reboot the system\r
 \r
@@ -723,7 +758,7 @@ EFI_STATUS
 HttpSendIpAddress (\r
   IN int SocketFD,\r
   IN WSDT_PORT * pPort,\r
-  IN struct sockaddr_in * pAddress\r
+  IN struct sockaddr_in6 * pAddress\r
   );\r
 \r
 /**\r