1*a92d0e6bSJohn Wedig // Copyright 2023 Google LLC
2*a92d0e6bSJohn Wedig //
3*a92d0e6bSJohn Wedig // Licensed under the Apache License, Version 2.0 (the "License");
4*a92d0e6bSJohn Wedig // you may not use this file except in compliance with the License.
5*a92d0e6bSJohn Wedig // You may obtain a copy of the License at
6*a92d0e6bSJohn Wedig //
7*a92d0e6bSJohn Wedig //      http://www.apache.org/licenses/LICENSE-2.0
8*a92d0e6bSJohn Wedig //
9*a92d0e6bSJohn Wedig // Unless required by applicable law or agreed to in writing, software
10*a92d0e6bSJohn Wedig // distributed under the License is distributed on an "AS IS" BASIS,
11*a92d0e6bSJohn Wedig // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*a92d0e6bSJohn Wedig // See the License for the specific language governing permissions and
13*a92d0e6bSJohn Wedig // limitations under the License.
14*a92d0e6bSJohn Wedig 
15*a92d0e6bSJohn Wedig #include "linux_boot_done.hpp"
16*a92d0e6bSJohn Wedig 
17*a92d0e6bSJohn Wedig #include "commands.hpp"
18*a92d0e6bSJohn Wedig #include "errors.hpp"
19*a92d0e6bSJohn Wedig #include "handler.hpp"
20*a92d0e6bSJohn Wedig 
21*a92d0e6bSJohn Wedig #include <ipmid/api-types.hpp>
22*a92d0e6bSJohn Wedig 
23*a92d0e6bSJohn Wedig #include <span>
24*a92d0e6bSJohn Wedig #include <vector>
25*a92d0e6bSJohn Wedig 
26*a92d0e6bSJohn Wedig namespace google
27*a92d0e6bSJohn Wedig {
28*a92d0e6bSJohn Wedig namespace ipmi
29*a92d0e6bSJohn Wedig {
30*a92d0e6bSJohn Wedig 
linuxBootDone(std::span<const uint8_t>,HandlerInterface * handler)31*a92d0e6bSJohn Wedig Resp linuxBootDone(std::span<const uint8_t>, HandlerInterface* handler)
32*a92d0e6bSJohn Wedig {
33*a92d0e6bSJohn Wedig     try
34*a92d0e6bSJohn Wedig     {
35*a92d0e6bSJohn Wedig         handler->linuxBootDone();
36*a92d0e6bSJohn Wedig     }
37*a92d0e6bSJohn Wedig     catch (const IpmiException& e)
38*a92d0e6bSJohn Wedig     {
39*a92d0e6bSJohn Wedig         return ::ipmi::response(e.getIpmiError());
40*a92d0e6bSJohn Wedig     }
41*a92d0e6bSJohn Wedig 
42*a92d0e6bSJohn Wedig     return ::ipmi::responseSuccess(SysOEMCommands::SysLinuxBootDone,
43*a92d0e6bSJohn Wedig                                    std::vector<std::uint8_t>{});
44*a92d0e6bSJohn Wedig }
45*a92d0e6bSJohn Wedig } // namespace ipmi
46*a92d0e6bSJohn Wedig } // namespace google
47