blob: 6a346ba9c06ae0125b4d588d6d600d6355881189 [file] [log] [blame]
Patrick Venturef085d912019-03-15 08:50:00 -07001/*
2 * Copyright 2019 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "handler.hpp"
18
19// The phosphor-host-ipmi daemon requires a configuration that maps
20// the if_name to the IPMI LAN channel. However, that doesn't strictly
21// define which is meant to be used for NCSI.
22#ifndef NCSI_IPMI_CHANNEL
23#define NCSI_IPMI_CHANNEL 1
24#endif
25
26#ifndef NCSI_IF_NAME
27#define NCSI_IF_NAME eth0
28#endif
29
30// To deal with receiving a string without quotes.
31#define QUOTE(name) #name
32#define STR(macro) QUOTE(macro)
33#define NCSI_IF_NAME_STR STR(NCSI_IF_NAME)
34
35namespace google
36{
37namespace ipmi
38{
39
40std::tuple<std::uint8_t, std::string> Handler::getEthDetails() const
41{
42 return std::make_tuple(NCSI_IPMI_CHANNEL, NCSI_IF_NAME_STR);
43}
44
45Handler handlerImpl;
46
47} // namespace ipmi
48} // namespace google