blob: ec6074fd3072da4622fad0c93aa61ce690589686 [file] [log] [blame]
Patrick Venture189d44e2018-07-09 12:30:59 -07001#include "ncsi_util.hpp"
2
Eddie Jamesfa1f5c02020-09-17 15:12:46 -05003#include <fmt/format.h>
Ratan Guptabbe45792018-03-23 00:22:55 +05304#include <linux/ncsi.h>
Ratan Guptabbe45792018-03-23 00:22:55 +05305#include <netlink/genl/ctrl.h>
Gunnar Mills57d9c502018-09-14 14:42:34 -05006#include <netlink/genl/genl.h>
7#include <netlink/netlink.h>
Ratan Guptabbe45792018-03-23 00:22:55 +05308
Eddie Jamesfa1f5c02020-09-17 15:12:46 -05009#include <iomanip>
Manojkiran Edae5a867a2020-06-01 18:08:30 +053010#include <iostream>
Ratan Guptabbe45792018-03-23 00:22:55 +053011#include <phosphor-logging/elog-errors.hpp>
12#include <phosphor-logging/log.hpp>
Patrick Venture189d44e2018-07-09 12:30:59 -070013#include <xyz/openbmc_project/Common/error.hpp>
Ratan Guptabbe45792018-03-23 00:22:55 +053014
15namespace phosphor
16{
17namespace network
18{
19namespace ncsi
20{
21
22using namespace phosphor::logging;
23using namespace sdbusplus::xyz::openbmc_project::Common::Error;
24
Gunnar Mills57d9c502018-09-14 14:42:34 -050025using CallBack = int (*)(struct nl_msg* msg, void* arg);
Ratan Guptaaac603e2018-03-23 00:25:54 +053026
27namespace internal
28{
Ratan Guptabbe45792018-03-23 00:22:55 +053029
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050030struct NCSIPacketHeader
31{
32 uint8_t MCID;
33 uint8_t revision;
34 uint8_t reserved;
35 uint8_t id;
36 uint8_t type;
37 uint8_t channel;
38 uint16_t length;
39 uint32_t rsvd[2];
40};
41
42class Command
43{
44 public:
45 Command() = delete;
46 ~Command() = default;
47 Command(const Command&) = delete;
48 Command& operator=(const Command&) = delete;
49 Command(Command&&) = default;
50 Command& operator=(Command&&) = default;
51 Command(
52 int c, int nc = DEFAULT_VALUE,
53 std::span<const unsigned char> p = std::span<const unsigned char>()) :
54 cmd(c),
55 ncsi_cmd(nc), payload(p)
56 {
57 }
58
59 int cmd;
60 int ncsi_cmd;
61 std::span<const unsigned char> payload;
62};
63
Ratan Guptabbe45792018-03-23 00:22:55 +053064using nlMsgPtr = std::unique_ptr<nl_msg, decltype(&::nlmsg_free)>;
65using nlSocketPtr = std::unique_ptr<nl_sock, decltype(&::nl_socket_free)>;
66
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050067CallBack infoCallBack = [](struct nl_msg* msg, void* arg) {
Ratan Guptaaac603e2018-03-23 00:25:54 +053068 using namespace phosphor::network::ncsi;
69 auto nlh = nlmsg_hdr(msg);
70
Gunnar Mills57d9c502018-09-14 14:42:34 -050071 struct nlattr* tb[NCSI_ATTR_MAX + 1] = {nullptr};
72 struct nla_policy ncsiPolicy[NCSI_ATTR_MAX + 1] = {
William A. Kennington III05368f12021-05-13 18:40:47 -070073 {NLA_UNSPEC, 0, 0}, {NLA_U32, 0, 0}, {NLA_NESTED, 0, 0},
74 {NLA_U32, 0, 0}, {NLA_U32, 0, 0},
Ratan Guptaaac603e2018-03-23 00:25:54 +053075 };
76
Gunnar Mills57d9c502018-09-14 14:42:34 -050077 struct nlattr* packagetb[NCSI_PKG_ATTR_MAX + 1] = {nullptr};
78 struct nla_policy packagePolicy[NCSI_PKG_ATTR_MAX + 1] = {
William A. Kennington III05368f12021-05-13 18:40:47 -070079 {NLA_UNSPEC, 0, 0}, {NLA_NESTED, 0, 0}, {NLA_U32, 0, 0},
80 {NLA_FLAG, 0, 0}, {NLA_NESTED, 0, 0},
Ratan Guptaaac603e2018-03-23 00:25:54 +053081 };
82
Gunnar Mills57d9c502018-09-14 14:42:34 -050083 struct nlattr* channeltb[NCSI_CHANNEL_ATTR_MAX + 1] = {nullptr};
84 struct nla_policy channelPolicy[NCSI_CHANNEL_ATTR_MAX + 1] = {
William A. Kennington III05368f12021-05-13 18:40:47 -070085 {NLA_UNSPEC, 0, 0}, {NLA_NESTED, 0, 0}, {NLA_U32, 0, 0},
86 {NLA_FLAG, 0, 0}, {NLA_NESTED, 0, 0}, {NLA_UNSPEC, 0, 0},
Ratan Guptaaac603e2018-03-23 00:25:54 +053087 };
88
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050089 *(int*)arg = 0;
90
Ratan Guptaaac603e2018-03-23 00:25:54 +053091 auto ret = genlmsg_parse(nlh, 0, tb, NCSI_ATTR_MAX, ncsiPolicy);
92 if (!tb[NCSI_ATTR_PACKAGE_LIST])
93 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +053094 std::cerr << "No Packages" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +053095 return -1;
96 }
97
98 auto attrTgt = static_cast<nlattr*>(nla_data(tb[NCSI_ATTR_PACKAGE_LIST]));
99 if (!attrTgt)
100 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530101 std::cerr << "Package list attribute is null" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530102 return -1;
103 }
104
105 auto rem = nla_len(tb[NCSI_ATTR_PACKAGE_LIST]);
106 nla_for_each_nested(attrTgt, tb[NCSI_ATTR_PACKAGE_LIST], rem)
107 {
108 ret = nla_parse_nested(packagetb, NCSI_PKG_ATTR_MAX, attrTgt,
109 packagePolicy);
110 if (ret < 0)
111 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530112 std::cerr << "Failed to parse package nested" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530113 return -1;
114 }
115
116 if (packagetb[NCSI_PKG_ATTR_ID])
117 {
118 auto attrID = nla_get_u32(packagetb[NCSI_PKG_ATTR_ID]);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530119 std::cout << "Package has id : " << std::hex << attrID << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530120 }
121 else
122 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530123 std::cout << "Package with no id" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530124 }
125
126 if (packagetb[NCSI_PKG_ATTR_FORCED])
127 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530128 std::cout << "This package is forced" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530129 }
130
131 auto channelListTarget = static_cast<nlattr*>(
Gunnar Mills57d9c502018-09-14 14:42:34 -0500132 nla_data(packagetb[NCSI_PKG_ATTR_CHANNEL_LIST]));
Ratan Guptaaac603e2018-03-23 00:25:54 +0530133
134 auto channelrem = nla_len(packagetb[NCSI_PKG_ATTR_CHANNEL_LIST]);
135 nla_for_each_nested(channelListTarget,
136 packagetb[NCSI_PKG_ATTR_CHANNEL_LIST], channelrem)
137 {
138 ret = nla_parse_nested(channeltb, NCSI_CHANNEL_ATTR_MAX,
139 channelListTarget, channelPolicy);
140 if (ret < 0)
141 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530142 std::cerr << "Failed to parse channel nested" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530143 return -1;
144 }
145
146 if (channeltb[NCSI_CHANNEL_ATTR_ID])
147 {
148 auto channel = nla_get_u32(channeltb[NCSI_CHANNEL_ATTR_ID]);
149 if (channeltb[NCSI_CHANNEL_ATTR_ACTIVE])
150 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530151 std::cout << "Channel Active : " << std::hex << channel
152 << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530153 }
154 else
155 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530156 std::cout << "Channel Not Active : " << std::hex << channel
157 << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530158 }
159
160 if (channeltb[NCSI_CHANNEL_ATTR_FORCED])
161 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530162 std::cout << "Channel is forced" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530163 }
Ratan Guptaaac603e2018-03-23 00:25:54 +0530164 }
165 else
166 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530167 std::cout << "Channel with no ID" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530168 }
Ratan Guptaed5d7ff2018-03-23 00:27:52 +0530169
Ratan Guptaaac603e2018-03-23 00:25:54 +0530170 if (channeltb[NCSI_CHANNEL_ATTR_VERSION_MAJOR])
171 {
Gunnar Mills57d9c502018-09-14 14:42:34 -0500172 auto major =
173 nla_get_u32(channeltb[NCSI_CHANNEL_ATTR_VERSION_MAJOR]);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530174 std::cout << "Channel Major Version : " << std::hex << major
175 << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530176 }
177 if (channeltb[NCSI_CHANNEL_ATTR_VERSION_MINOR])
178 {
Gunnar Mills57d9c502018-09-14 14:42:34 -0500179 auto minor =
180 nla_get_u32(channeltb[NCSI_CHANNEL_ATTR_VERSION_MINOR]);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530181 std::cout << "Channel Minor Version : " << std::hex << minor
182 << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530183 }
184 if (channeltb[NCSI_CHANNEL_ATTR_VERSION_STR])
185 {
Gunnar Mills57d9c502018-09-14 14:42:34 -0500186 auto str =
187 nla_get_string(channeltb[NCSI_CHANNEL_ATTR_VERSION_STR]);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530188 std::cout << "Channel Version Str :" << str << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530189 }
190 if (channeltb[NCSI_CHANNEL_ATTR_LINK_STATE])
191 {
Ratan Guptaed5d7ff2018-03-23 00:27:52 +0530192
Gunnar Mills57d9c502018-09-14 14:42:34 -0500193 auto link =
194 nla_get_u32(channeltb[NCSI_CHANNEL_ATTR_LINK_STATE]);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530195 std::cout << "Channel Link State : " << std::hex << link
196 << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530197 }
198 if (channeltb[NCSI_CHANNEL_ATTR_VLAN_LIST])
199 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530200 std::cout << "Active Vlan ids" << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530201 auto vids = channeltb[NCSI_CHANNEL_ATTR_VLAN_LIST];
202 auto vid = static_cast<nlattr*>(nla_data(vids));
203 auto len = nla_len(vids);
204 while (nla_ok(vid, len))
205 {
206 auto id = nla_get_u16(vid);
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530207 std::cout << "VID : " << id << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530208 vid = nla_next(vid, &len);
209 }
210 }
Ratan Guptaaac603e2018-03-23 00:25:54 +0530211 }
Ratan Guptaaac603e2018-03-23 00:25:54 +0530212 }
213 return (int)NL_SKIP;
214};
215
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500216CallBack sendCallBack = [](struct nl_msg* msg, void* arg) {
217 using namespace phosphor::network::ncsi;
218 auto nlh = nlmsg_hdr(msg);
219 struct nlattr* tb[NCSI_ATTR_MAX + 1] = {nullptr};
220 static struct nla_policy ncsiPolicy[NCSI_ATTR_MAX + 1] = {
221 {NLA_UNSPEC, 0, 0}, {NLA_U32, 0, 0}, {NLA_NESTED, 0, 0},
222 {NLA_U32, 0, 0}, {NLA_U32, 0, 0}, {NLA_BINARY, 0, 0},
223 {NLA_FLAG, 0, 0}, {NLA_U32, 0, 0}, {NLA_U32, 0, 0},
224 };
225
226 *(int*)arg = 0;
227
228 auto ret = genlmsg_parse(nlh, 0, tb, NCSI_ATTR_MAX, ncsiPolicy);
229 if (ret)
230 {
231 std::cerr << "Failed to parse package" << std::endl;
232 return ret;
233 }
234
235 auto data_len = nla_len(tb[NCSI_ATTR_DATA]) - sizeof(NCSIPacketHeader);
236 unsigned char* data =
237 (unsigned char*)nla_data(tb[NCSI_ATTR_DATA]) + sizeof(NCSIPacketHeader);
238 auto s = std::span<const unsigned char>(data, data_len);
239
240 // Dump the response to stdout. Enhancement: option to save response data
241 std::cout << "Response : " << std::dec << data_len << " bytes" << std::endl;
242 fmt::print("{:02x}", fmt::join(s.begin(), s.end(), " "));
243 std::cout << std::endl;
244
245 return 0;
246};
247
248int applyCmd(int ifindex, const Command& cmd, int package = DEFAULT_VALUE,
Ratan Guptaaac603e2018-03-23 00:25:54 +0530249 int channel = DEFAULT_VALUE, int flags = NONE,
250 CallBack function = nullptr)
Ratan Guptabbe45792018-03-23 00:22:55 +0530251{
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500252 int cb_ret = 0;
Gunnar Mills57d9c502018-09-14 14:42:34 -0500253 nlSocketPtr socket(nl_socket_alloc(), &::nl_socket_free);
Johnathan Manteyd49c5c62021-06-23 09:14:42 -0700254 if (socket == nullptr)
255 {
256 log<level::ERR>("Unable to allocate memory for the socket.");
257 return -ENOMEM;
258 }
259
Ratan Guptabbe45792018-03-23 00:22:55 +0530260 auto ret = genl_connect(socket.get());
261 if (ret < 0)
262 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530263 std::cerr << "Failed to open the socket , RC : " << ret << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530264 return ret;
265 }
266
267 auto driverID = genl_ctrl_resolve(socket.get(), "NCSI");
268 if (driverID < 0)
269 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530270 std::cerr << "Failed to resolve, RC : " << ret << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530271 return driverID;
272 }
273
274 nlMsgPtr msg(nlmsg_alloc(), &::nlmsg_free);
Johnathan Manteyd49c5c62021-06-23 09:14:42 -0700275 if (msg == nullptr)
276 {
277 log<level::ERR>("Unable to allocate memory for the message.");
278 return -ENOMEM;
279 }
Ratan Guptabbe45792018-03-23 00:22:55 +0530280
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500281 auto msgHdr = genlmsg_put(msg.get(), 0, 0, driverID, 0, flags, cmd.cmd, 0);
Ratan Guptabbe45792018-03-23 00:22:55 +0530282 if (!msgHdr)
283 {
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500284 std::cerr << "Unable to add the netlink headers , COMMAND : " << cmd.cmd
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530285 << std::endl;
Johnathan Manteyd49c5c62021-06-23 09:14:42 -0700286 return -ENOMEM;
Ratan Guptabbe45792018-03-23 00:22:55 +0530287 }
288
289 if (package != DEFAULT_VALUE)
290 {
291 ret = nla_put_u32(msg.get(), ncsi_nl_attrs::NCSI_ATTR_PACKAGE_ID,
292 package);
293 if (ret < 0)
294 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530295 std::cerr << "Failed to set the attribute , RC : " << ret
296 << "PACKAGE " << std::hex << package << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530297 return ret;
298 }
299 }
300
301 if (channel != DEFAULT_VALUE)
302 {
303 ret = nla_put_u32(msg.get(), ncsi_nl_attrs::NCSI_ATTR_CHANNEL_ID,
304 channel);
305 if (ret < 0)
306 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530307 std::cerr << "Failed to set the attribute , RC : " << ret
308 << "CHANNEL : " << std::hex << channel << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530309 return ret;
310 }
311 }
312
313 ret = nla_put_u32(msg.get(), ncsi_nl_attrs::NCSI_ATTR_IFINDEX, ifindex);
314 if (ret < 0)
315 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530316 std::cerr << "Failed to set the attribute , RC : " << ret
317 << "INTERFACE : " << std::hex << ifindex << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530318 return ret;
319 }
320
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500321 if (cmd.ncsi_cmd != DEFAULT_VALUE)
322 {
323 std::vector<unsigned char> pl(sizeof(NCSIPacketHeader) +
324 cmd.payload.size());
325 NCSIPacketHeader* hdr = (NCSIPacketHeader*)pl.data();
326
327 std::copy(cmd.payload.begin(), cmd.payload.end(),
328 pl.begin() + sizeof(NCSIPacketHeader));
329
330 hdr->type = cmd.ncsi_cmd;
331 hdr->length = htons(cmd.payload.size());
332
333 ret = nla_put(msg.get(), ncsi_nl_attrs::NCSI_ATTR_DATA, pl.size(),
334 pl.data());
335 if (ret < 0)
336 {
337 std::cerr << "Failed to set the data attribute, RC : " << ret
338 << std::endl;
339 return ret;
340 }
341
342 nl_socket_disable_seq_check(socket.get());
343 }
344
Ratan Guptaaac603e2018-03-23 00:25:54 +0530345 if (function)
346 {
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500347 cb_ret = 1;
348
Ratan Guptaaac603e2018-03-23 00:25:54 +0530349 // Add a callback function to the socket
Gunnar Mills57d9c502018-09-14 14:42:34 -0500350 nl_socket_modify_cb(socket.get(), NL_CB_VALID, NL_CB_CUSTOM, function,
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500351 &cb_ret);
Ratan Guptaaac603e2018-03-23 00:25:54 +0530352 }
Ratan Guptabbe45792018-03-23 00:22:55 +0530353
354 ret = nl_send_auto(socket.get(), msg.get());
355 if (ret < 0)
356 {
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530357 std::cerr << "Failed to send the message , RC : " << ret << std::endl;
Ratan Guptabbe45792018-03-23 00:22:55 +0530358 return ret;
359 }
360
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500361 do
Ratan Guptabbe45792018-03-23 00:22:55 +0530362 {
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500363 ret = nl_recvmsgs_default(socket.get());
364 if (ret < 0)
365 {
366 std::cerr << "Failed to receive the message , RC : " << ret
367 << std::endl;
368 break;
369 }
370 } while (cb_ret);
371
Ratan Guptabbe45792018-03-23 00:22:55 +0530372 return ret;
373}
374
Gunnar Mills57d9c502018-09-14 14:42:34 -0500375} // namespace internal
Ratan Guptabbe45792018-03-23 00:22:55 +0530376
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500377int sendOemCommand(int ifindex, int package, int channel,
378 std::span<const unsigned char> payload)
379{
380 constexpr auto cmd = 0x50;
381
382 std::cout << "Send OEM Command, CHANNEL : " << std::hex << channel
383 << ", PACKAGE : " << std::hex << package
384 << ", IFINDEX: " << std::hex << ifindex << std::endl;
385 if (!payload.empty())
386 {
387 std::cout << "Payload :";
388 for (auto& i : payload)
389 {
390 std::cout << " " << std::hex << std::setfill('0') << std::setw(2)
391 << (int)i;
392 }
393 std::cout << std::endl;
394 }
395
396 return internal::applyCmd(
397 ifindex,
398 internal::Command(ncsi_nl_commands::NCSI_CMD_SEND_CMD, cmd, payload),
399 package, channel, NONE, internal::sendCallBack);
400}
401
Ratan Guptabbe45792018-03-23 00:22:55 +0530402int setChannel(int ifindex, int package, int channel)
403{
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530404 std::cout << "Set Channel : " << std::hex << channel
405 << ", PACKAGE : " << std::hex << package
406 << ", IFINDEX : " << std::hex << ifindex << std::endl;
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500407 return internal::applyCmd(
408 ifindex, internal::Command(ncsi_nl_commands::NCSI_CMD_SET_INTERFACE),
409 package, channel);
Ratan Guptabbe45792018-03-23 00:22:55 +0530410}
411
412int clearInterface(int ifindex)
413{
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530414 std::cout << "ClearInterface , IFINDEX :" << std::hex << ifindex
415 << std::endl;
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500416 return internal::applyCmd(
417 ifindex, internal::Command(ncsi_nl_commands::NCSI_CMD_CLEAR_INTERFACE));
Ratan Guptabbe45792018-03-23 00:22:55 +0530418}
419
Ratan Guptaaac603e2018-03-23 00:25:54 +0530420int getInfo(int ifindex, int package)
421{
Manojkiran Edae5a867a2020-06-01 18:08:30 +0530422 std::cout << "Get Info , PACKAGE : " << std::hex << package
423 << ", IFINDEX : " << std::hex << ifindex << std::endl;
Ratan Guptaaac603e2018-03-23 00:25:54 +0530424 if (package == DEFAULT_VALUE)
425 {
Eddie Jamesfa1f5c02020-09-17 15:12:46 -0500426 return internal::applyCmd(
427 ifindex, internal::Command(ncsi_nl_commands::NCSI_CMD_PKG_INFO),
428 package, DEFAULT_VALUE, NLM_F_DUMP, internal::infoCallBack);
Ratan Guptaaac603e2018-03-23 00:25:54 +0530429 }
430 else
431 {
432 return internal::applyCmd(ifindex, ncsi_nl_commands::NCSI_CMD_PKG_INFO,
433 package, DEFAULT_VALUE, NONE,
434 internal::infoCallBack);
435 }
436}
437
Gunnar Mills57d9c502018-09-14 14:42:34 -0500438} // namespace ncsi
439} // namespace network
440} // namespace phosphor