// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "handler_impl.hpp"
#include "ipmi.hpp"

#include <ipmid/api.h>

#include <ipmid/api-types.hpp>
#include <ipmid/handler.hpp>
#include <ipmid/iana.hpp>
#include <stdplus/print.hpp>

#include <cstdint>
#include <cstdio>
#include <functional>
#include <span>

namespace oem
{
namespace google
{
constexpr int sysCmd = 50;
} // namespace google
} // namespace oem

namespace google
{
namespace ipmi
{

void setupGoogleOemSysCommands() __attribute__((constructor));

void setupGoogleOemSysCommands()
{
    static Handler handlerImpl;

    stdplus::print(
        stderr, "Registering OEM:[{:#08X}], Cmd:[{:#04X}] for Sys Commands\n",
        oem::googOemNumber, oem::google::sysCmd);

    ::ipmi::registerOemHandler(
        ::ipmi::prioOemBase, oem::googOemNumber, oem::google::sysCmd,
        ::ipmi::Privilege::User,
        [](::ipmi::Context::ptr ctx, uint8_t cmd,
           const std::vector<uint8_t>& data) {
            return handleSysCommand(&handlerImpl, ctx, cmd, data);
        });
}

} // namespace ipmi
} // namespace google
