]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/WebServer/Reboot.c
8657484bb6a05aa57d60ea0a7a1fa254d326ff6f
5 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <WebServer.h>
11 #include <Library/UefiRuntimeServicesTableLib.h>
15 Page to reboot the system
17 @param [in] SocketFD The socket's file descriptor to add to the list.
18 @param [in] pPort The WSDT_PORT structure address
19 @param [out] pbDone Address to receive the request completion status
21 @retval EFI_SUCCESS The request was successfully processed
36 // Send the Reboot page
40 // Send the page header
42 Status
= HttpPageHeader ( SocketFD
, pPort
, L
"Reboot" );
43 if ( EFI_ERROR ( Status
)) {
50 Status
= HttpSendAnsiString ( SocketFD
,
54 " Ouch! The system is rebooting!\r\n" );
55 if ( EFI_ERROR ( Status
)) {
60 // Send the page trailer
62 Status
= HttpPageTrailer ( SocketFD
, pPort
, pbDone
);
63 if ( EFI_ERROR ( Status
)) {
68 // Deliver the data to the remote system by
74 // Attempt to reboot the system
76 DEBUG (( DEBUG_REQUEST
, "Reseting System\r\n" ));
77 gRT
->ResetSystem ( EfiResetCold
,
85 // Return the operation status
87 DBG_EXIT_STATUS ( Status
);