]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/WebServer/Reboot.c
2fc8fecf63b40897ab426683f427e2642fd9888a
5 Copyright (c) 2011-2012, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <WebServer.h>
17 #include <Library/UefiRuntimeServicesTableLib.h>
21 Page to reboot the system
23 @param [in] SocketFD The socket's file descriptor to add to the list.
24 @param [in] pPort The WSDT_PORT structure address
25 @param [out] pbDone Address to receive the request completion status
27 @retval EFI_SUCCESS The request was successfully processed
42 // Send the Reboot page
46 // Send the page header
48 Status
= HttpPageHeader ( SocketFD
, pPort
, L
"Reboot" );
49 if ( EFI_ERROR ( Status
)) {
56 Status
= HttpSendAnsiString ( SocketFD
,
60 " Ouch! The system is rebooting!\r\n" );
61 if ( EFI_ERROR ( Status
)) {
66 // Send the page trailer
68 Status
= HttpPageTrailer ( SocketFD
, pPort
, pbDone
);
69 if ( EFI_ERROR ( Status
)) {
74 // Deliver the data to the remote system by
80 // Attempt to reboot the system
82 DEBUG (( DEBUG_REQUEST
, "Reseting System\r\n" ));
83 gRT
->ResetSystem ( EfiResetCold
,
91 // Return the operation status
93 DBG_EXIT_STATUS ( Status
);