]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/WebServer/Reboot.c
2 This file contains an 'Intel UEFI Application' and is
3 licensed for Intel CPUs and chipsets under the terms of your
4 license agreement with Intel or your vendor. This file may
5 be modified by the user, subject to additional terms of the
10 Copyright (c) 2011 Intel Corporation. All rights reserved
11 This software and associated documentation (if any) is furnished
12 under a license and may only be used or copied in accordance
13 with the terms of the license. Except as permitted by such
14 license, no part of this software or documentation may be
15 reproduced, stored in a retrieval system, or transmitted in any
16 form or by any means without the express written consent of
26 #include <WebServer.h>
27 #include <Library/UefiRuntimeServicesTableLib.h>
31 Page to reboot the system
33 @param [in] SocketFD The socket's file descriptor to add to the list.
34 @param [in] pPort The WSDT_PORT structure address
35 @param [out] pbDone Address to receive the request completion status
37 @retval EFI_SUCCESS The request was successfully processed
52 // Send the Hello World page
56 // Send the page header
58 Status
= HttpPageHeader ( SocketFD
, pPort
, L
"Reboot" );
59 if ( EFI_ERROR ( Status
)) {
66 Status
= HttpSendAnsiString ( SocketFD
,
70 " Ouch! The system is rebooting!\r\n" );
71 if ( EFI_ERROR ( Status
)) {
76 // Send the page trailer
78 Status
= HttpPageTrailer ( SocketFD
, pPort
, pbDone
);
79 if ( EFI_ERROR ( Status
)) {
84 // Deliver the data to the remote system by
90 // Attempt to reboot the system
92 DEBUG (( DEBUG_REQUEST
, "Reseting System\r\n" ));
93 gRT
->ResetSystem ( EfiResetCold
,
101 // Return the operation status
103 DBG_EXIT_STATUS ( Status
);