blob: 0739d06504c5517ecff03575e8664a55cea1b99e [file] [log] [blame]
Adriana Kobylak5d6481f2015-10-29 21:44:55 -05001#include <stdio.h>
2#include <string.h>
3#include <stdint.h>
Hariharasubramanian R83951912016-01-20 07:06:36 -06004#include <arpa/inet.h>
tomjose26e17732016-03-03 08:52:51 -06005#include <string>
Adriana Kobylak5d6481f2015-10-29 21:44:55 -05006
7#include "ipmid-api.h"
Patrick Williams53a360e2016-08-12 22:01:02 -05008#include "ipmid.hpp"
Adriana Kobylak5d6481f2015-10-29 21:44:55 -05009#include "transporthandler.h"
10
Hariharasubramanian R83951912016-01-20 07:06:36 -060011#define SYSTEMD_NETWORKD_DBUS 1
12
13#ifdef SYSTEMD_NETWORKD_DBUS
14#include <systemd/sd-bus.h>
Sergey Solomineb9b8142016-08-23 09:07:28 -050015#include <mapper.h>
Hariharasubramanian R83951912016-01-20 07:06:36 -060016#endif
17
18// OpenBMC System Manager dbus framework
Hariharasubramanian R83951912016-01-20 07:06:36 -060019const char *obj = "/org/openbmc/NetworkManager/Interface";
20const char *ifc = "org.openbmc.NetworkManager";
21
tomjose26e17732016-03-03 08:52:51 -060022const char *nwinterface = "eth0";
23
Adriana Kobylake08fbc62016-02-09 16:17:23 -060024const int SIZE_MAC = 18; //xx:xx:xx:xx:xx:xx
Adriana Kobylake08fbc62016-02-09 16:17:23 -060025
tomjose26e17732016-03-03 08:52:51 -060026char new_ipaddr [INET_ADDRSTRLEN] = "";
27char new_netmask [INET_ADDRSTRLEN] = "";
28char new_gateway [INET_ADDRSTRLEN] = "";
Hariharasubramanian R83951912016-01-20 07:06:36 -060029
tomjose26e17732016-03-03 08:52:51 -060030const uint8_t SET_COMPLETE = 0;
31const uint8_t SET_IN_PROGRESS = 1;
32const uint8_t SET_COMMIT_WRITE = 2; //Optional
33const uint8_t SET_IN_PROGRESS_RESERVED = 3; //Reserved
34
35// Status of Set-In-Progress Parameter (# 0)
36uint8_t lan_set_in_progress = SET_COMPLETE;
37
38
Hariharasubramanian R83951912016-01-20 07:06:36 -060039
Adriana Kobylak5d6481f2015-10-29 21:44:55 -050040void register_netfn_transport_functions() __attribute__((constructor));
41
tomjose26e17732016-03-03 08:52:51 -060042// Helper Function to get IP Address/NetMask/Gateway from Network Manager or Cache
43// based on Set-In-Progress State
44ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t * data)
45{
46 sd_bus *bus = ipmid_get_sd_bus_connection();
47 sd_bus_message *reply = NULL;
48 sd_bus_error error = SD_BUS_ERROR_NULL;
49 int family;
50 unsigned char prefixlen;
51 char* ipaddr = NULL;
52 unsigned long mask = 0xFFFFFFFF;
53 char* gateway = NULL;
54 int r = 0;
55 ipmi_ret_t rc = IPMI_CC_OK;
Sergey Solomineb9b8142016-08-23 09:07:28 -050056 char *app = NULL;
tomjose26e17732016-03-03 08:52:51 -060057
Sergey Solomineb9b8142016-08-23 09:07:28 -050058 r = mapper_get_service(bus, obj, &app);
59 if (r < 0) {
60 fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
61 goto cleanup;
62 }
tomjose26e17732016-03-03 08:52:51 -060063 r = sd_bus_call_method(bus, app, obj, ifc, "GetAddress4", &error,
64 &reply, "s", nwinterface);
65 if(r < 0)
66 {
67 fprintf(stderr, "Failed to call Get Method: %s\n", strerror(-r));
68 rc = IPMI_CC_UNSPECIFIED_ERROR;
69 goto cleanup;
70 }
71
72 r = sd_bus_message_read(reply, "iyss", &family, &prefixlen, &ipaddr, &gateway);
73 if(r < 0)
74 {
75 fprintf(stderr, "Failed to get a response: %s\n", strerror(-rc));
76 rc = IPMI_CC_RESPONSE_ERROR;
77 goto cleanup;
78 }
79
80 printf("N/W data from HW %s:%d:%s:%s\n", family==AF_INET?"IPv4":"IPv6", prefixlen, ipaddr,gateway);
81 printf("N/W data from Cache: %s:%s:%s\n", new_ipaddr, new_netmask, new_gateway);
82
83 if(lan_param == LAN_PARM_IP)
84 {
85 if(lan_set_in_progress == SET_COMPLETE)
86 {
87 std::string ipaddrstr(ipaddr);
88 inet_pton(AF_INET, ipaddrstr.c_str(),(void *)data);
89 }
90 else if(lan_set_in_progress == SET_IN_PROGRESS)
91 {
92 inet_pton(AF_INET, new_ipaddr, (void *)data);
93 }
94 }
95 else if(lan_param == LAN_PARM_SUBNET)
96 {
97 if(lan_set_in_progress == SET_COMPLETE)
98 {
99 mask = htonl(mask<<(32-prefixlen));
100 memcpy(data, &mask, 4);
101 }
102 else if(lan_set_in_progress == SET_IN_PROGRESS)
103 {
104 inet_pton(AF_INET, new_netmask, (void *)data);
105 }
106 }
107 else if(lan_param == LAN_PARM_GATEWAY)
108 {
109 if(lan_set_in_progress == SET_COMPLETE)
110 {
111 std::string gatewaystr(gateway);
112 inet_pton(AF_INET, gatewaystr.c_str(), (void *)data);
113 }
114 else if(lan_set_in_progress == SET_IN_PROGRESS)
115 {
116 inet_pton(AF_INET, new_gateway,(void *)data);
117 }
118 }
119 else
120 {
121 rc = IPMI_CC_PARM_OUT_OF_RANGE;
122 }
123
124cleanup:
125 sd_bus_error_free(&error);
126 reply = sd_bus_message_unref(reply);
Sergey Solomineb9b8142016-08-23 09:07:28 -0500127 free(app);
tomjose26e17732016-03-03 08:52:51 -0600128
129 return rc;
130}
131
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500132ipmi_ret_t ipmi_transport_wildcard(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
133 ipmi_request_t request, ipmi_response_t response,
134 ipmi_data_len_t data_len, ipmi_context_t context)
135{
136 printf("Handling TRANSPORT WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
137 // Status code.
138 ipmi_ret_t rc = IPMI_CC_OK;
139 *data_len = 0;
140 return rc;
141}
142
143struct set_lan_t {
144 uint8_t channel;
145 uint8_t parameter;
146 uint8_t data[8]; // Per IPMI spec, not expecting more than this size
147} __attribute__ ((packed));
148
149ipmi_ret_t ipmi_transport_set_lan(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
150 ipmi_request_t request, ipmi_response_t response,
151 ipmi_data_len_t data_len, ipmi_context_t context)
152{
153 ipmi_ret_t rc = IPMI_CC_OK;
154 *data_len = 0;
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600155 sd_bus *bus = ipmid_get_sd_bus_connection();
vishwa1eaea4f2016-02-26 11:57:40 -0600156 sd_bus_message *reply = NULL;
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600157 sd_bus_error error = SD_BUS_ERROR_NULL;
158 int r = 0;
Sergey Solomineb9b8142016-08-23 09:07:28 -0500159 char *app = NULL;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500160
161 printf("IPMI SET_LAN\n");
162
163 set_lan_t *reqptr = (set_lan_t*) request;
164
165 // TODO Use dbus interface once available. For now use cmd line.
166 // TODO Add the rest of the parameters like setting auth type
167 // TODO Add error handling
168
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600169 if (reqptr->parameter == LAN_PARM_IP)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500170 {
tomjose26e17732016-03-03 08:52:51 -0600171 snprintf(new_ipaddr, INET_ADDRSTRLEN, "%d.%d.%d.%d",
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600172 reqptr->data[0], reqptr->data[1], reqptr->data[2], reqptr->data[3]);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500173 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600174 else if (reqptr->parameter == LAN_PARM_MAC)
Adriana Kobylakd54a9dd2016-02-03 17:25:54 -0600175 {
tomjose26e17732016-03-03 08:52:51 -0600176 char mac[SIZE_MAC];
Adriana Kobylakd54a9dd2016-02-03 17:25:54 -0600177
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600178 snprintf(mac, SIZE_MAC, "%02x:%02x:%02x:%02x:%02x:%02x",
Adriana Kobylakd54a9dd2016-02-03 17:25:54 -0600179 reqptr->data[0],
180 reqptr->data[1],
181 reqptr->data[2],
182 reqptr->data[3],
183 reqptr->data[4],
184 reqptr->data[5]);
185
Sergey Solomineb9b8142016-08-23 09:07:28 -0500186 r = mapper_get_service(bus, obj, &app);
187 if (r < 0) {
188 fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
189 goto finish;
190 }
tomjose26e17732016-03-03 08:52:51 -0600191 r = sd_bus_call_method(bus, app, obj, ifc, "SetHwAddress", &error,
192 &reply, "ss", nwinterface, mac);
193 if(r < 0)
194 {
195 fprintf(stderr, "Failed to call the method: %s\n", strerror(-r));
196 rc = IPMI_CC_UNSPECIFIED_ERROR;
Adriana Kobylakd54a9dd2016-02-03 17:25:54 -0600197 }
198 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600199 else if (reqptr->parameter == LAN_PARM_SUBNET)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500200 {
tomjose26e17732016-03-03 08:52:51 -0600201 snprintf(new_netmask, INET_ADDRSTRLEN, "%d.%d.%d.%d",
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600202 reqptr->data[0], reqptr->data[1], reqptr->data[2], reqptr->data[3]);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500203 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600204 else if (reqptr->parameter == LAN_PARM_GATEWAY)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500205 {
tomjose26e17732016-03-03 08:52:51 -0600206 snprintf(new_gateway, INET_ADDRSTRLEN, "%d.%d.%d.%d",
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600207 reqptr->data[0], reqptr->data[1], reqptr->data[2], reqptr->data[3]);
Hariharasubramanian R83951912016-01-20 07:06:36 -0600208 }
tomjose26e17732016-03-03 08:52:51 -0600209 else if (reqptr->parameter == LAN_PARM_INPROGRESS)
Hariharasubramanian R83951912016-01-20 07:06:36 -0600210 {
tomjose26e17732016-03-03 08:52:51 -0600211 if(reqptr->data[0] == SET_COMPLETE) // Set Complete
Hariharasubramanian R83951912016-01-20 07:06:36 -0600212 {
tomjose26e17732016-03-03 08:52:51 -0600213 lan_set_in_progress = SET_COMPLETE;
214 // Apply the IP settings once IP Address, Netmask and Gateway is set
215 if (!strcmp(new_ipaddr, "") || !strcmp (new_netmask, "") || !strcmp (new_gateway, ""))
216 {
217 printf("ERROR: Incomplete LAN Parameters\n");
218 }
219 else
220 {
Hariharasubramanian R83951912016-01-20 07:06:36 -0600221
tomjose26e17732016-03-03 08:52:51 -0600222 r = sd_bus_call_method(bus, // On the System Bus
223 app, // Service to contact
224 obj, // Object path
225 ifc, // Interface name
226 "SetAddress4", // Method to be called
227 &error, // object to return error
228 &reply, // Response message on success
229 "ssss", // input message (Interface, IP Address, Netmask, Gateway)
230 nwinterface, // eth0
231 new_ipaddr,
232 new_netmask,
233 new_gateway);
234 if(r < 0)
235 {
236 fprintf(stderr, "Failed to set network data %s:%s:%s %s\n", new_ipaddr, new_netmask, new_gateway, error.message);
237 rc = IPMI_CC_UNSPECIFIED_ERROR;
238 }
239 memset(new_ipaddr, 0, INET_ADDRSTRLEN);
240 memset(new_netmask, 0, INET_ADDRSTRLEN);
241 memset(new_gateway, 0, INET_ADDRSTRLEN);
242 }
Hariharasubramanian R83951912016-01-20 07:06:36 -0600243 }
tomjose26e17732016-03-03 08:52:51 -0600244 else if(reqptr->data[0] == SET_IN_PROGRESS) // Set In Progress
Hariharasubramanian R83951912016-01-20 07:06:36 -0600245 {
tomjose26e17732016-03-03 08:52:51 -0600246 lan_set_in_progress = SET_IN_PROGRESS;
vishwa1eaea4f2016-02-26 11:57:40 -0600247 }
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500248 }
249 else
250 {
251 fprintf(stderr, "Unsupported parameter 0x%x\n", reqptr->parameter);
vishwa1eaea4f2016-02-26 11:57:40 -0600252 rc = IPMI_CC_PARM_NOT_SUPPORTED;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500253 }
254
Sergey Solomineb9b8142016-08-23 09:07:28 -0500255finish:
vishwa1eaea4f2016-02-26 11:57:40 -0600256 sd_bus_error_free(&error);
257 reply = sd_bus_message_unref(reply);
Sergey Solomineb9b8142016-08-23 09:07:28 -0500258 free(app);
vishwa1eaea4f2016-02-26 11:57:40 -0600259
tomjose26e17732016-03-03 08:52:51 -0600260 return rc;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500261}
262
263struct get_lan_t {
264 uint8_t rev_channel;
265 uint8_t parameter;
266 uint8_t parameter_set;
267 uint8_t parameter_block;
268} __attribute__ ((packed));
269
270ipmi_ret_t ipmi_transport_get_lan(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
271 ipmi_request_t request, ipmi_response_t response,
272 ipmi_data_len_t data_len, ipmi_context_t context)
273{
274 ipmi_ret_t rc = IPMI_CC_OK;
275 *data_len = 0;
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600276 sd_bus *bus = ipmid_get_sd_bus_connection();
vishwa1eaea4f2016-02-26 11:57:40 -0600277 sd_bus_message *reply = NULL;
Adriana Kobylak9355f612016-02-08 17:30:37 -0600278 sd_bus_error error = SD_BUS_ERROR_NULL;
279 int r = 0;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500280 const uint8_t current_revision = 0x11; // Current rev per IPMI Spec 2.0
tomjose26e17732016-03-03 08:52:51 -0600281 int i = 0;
Sergey Solomineb9b8142016-08-23 09:07:28 -0500282 char *app = NULL;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500283
284 printf("IPMI GET_LAN\n");
285
286 get_lan_t *reqptr = (get_lan_t*) request;
287
288 if (reqptr->rev_channel & 0x80) // Revision is bit 7
289 {
290 // Only current revision was requested
291 *data_len = sizeof(current_revision);
292 memcpy(response, &current_revision, *data_len);
293 return IPMI_CC_OK;
294 }
295
296 // TODO Use dbus interface once available. For now use ip cmd.
297 // TODO Add the rest of the parameters, like gateway
298
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600299 if (reqptr->parameter == LAN_PARM_INPROGRESS)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500300 {
tomjose26e17732016-03-03 08:52:51 -0600301 uint8_t buf[] = {current_revision, lan_set_in_progress};
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500302 *data_len = sizeof(buf);
303 memcpy(response, &buf, *data_len);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500304 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600305 else if (reqptr->parameter == LAN_PARM_AUTHSUPPORT)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500306 {
307 uint8_t buf[] = {current_revision,0x04};
308 *data_len = sizeof(buf);
309 memcpy(response, &buf, *data_len);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500310 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600311 else if (reqptr->parameter == LAN_PARM_AUTHENABLES)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500312 {
313 uint8_t buf[] = {current_revision,0x04,0x04,0x04,0x04,0x04};
314 *data_len = sizeof(buf);
315 memcpy(response, &buf, *data_len);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500316 }
tomjose26e17732016-03-03 08:52:51 -0600317 else if ((reqptr->parameter == LAN_PARM_IP) || (reqptr->parameter == LAN_PARM_SUBNET) || (reqptr->parameter == LAN_PARM_GATEWAY))
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500318 {
tomjose26e17732016-03-03 08:52:51 -0600319 uint8_t buf[5];
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500320
tomjose26e17732016-03-03 08:52:51 -0600321 *data_len = sizeof(current_revision);
322 memcpy(buf, &current_revision, *data_len);
323
324 if(getNetworkData(reqptr->parameter, &buf[1]) == IPMI_CC_OK)
vishwa1eaea4f2016-02-26 11:57:40 -0600325 {
tomjose26e17732016-03-03 08:52:51 -0600326 *data_len = sizeof(buf);
327 memcpy(response, &buf, *data_len);
Adriana Kobylak342df102016-02-10 13:48:16 -0600328 }
tomjose26e17732016-03-03 08:52:51 -0600329 else
Hariharasubramanian R83951912016-01-20 07:06:36 -0600330 {
tomjose26e17732016-03-03 08:52:51 -0600331 rc = IPMI_CC_UNSPECIFIED_ERROR;
Hariharasubramanian R83951912016-01-20 07:06:36 -0600332 }
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500333 }
Adriana Kobylake08fbc62016-02-09 16:17:23 -0600334 else if (reqptr->parameter == LAN_PARM_MAC)
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500335 {
336 //string to parse: link/ether xx:xx:xx:xx:xx:xx
tomjose26e17732016-03-03 08:52:51 -0600337 uint8_t buf[7];
Adriana Kobylak9355f612016-02-08 17:30:37 -0600338 char *eaddr1 = NULL;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500339
Sergey Solomineb9b8142016-08-23 09:07:28 -0500340 r = mapper_get_service(bus, obj, &app);
341 if (r < 0) {
342 fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
343 goto cleanup;
344 }
tomjose26e17732016-03-03 08:52:51 -0600345 r = sd_bus_call_method(bus, app, obj, ifc, "GetHwAddress", &error,
346 &reply, "s", nwinterface);
347 if(r < 0)
vishwa1eaea4f2016-02-26 11:57:40 -0600348 {
tomjose26e17732016-03-03 08:52:51 -0600349 fprintf(stderr, "Failed to call Get Method: %s\n", strerror(-r));
350 rc = IPMI_CC_UNSPECIFIED_ERROR;
351 goto cleanup;
Hariharasubramanian R83951912016-01-20 07:06:36 -0600352 }
tomjose26e17732016-03-03 08:52:51 -0600353
Adriana Kobylak9355f612016-02-08 17:30:37 -0600354 r = sd_bus_message_read(reply, "s", &eaddr1);
vishwa1eaea4f2016-02-26 11:57:40 -0600355 if (r < 0)
356 {
Adriana Kobylak9355f612016-02-08 17:30:37 -0600357 fprintf(stderr, "Failed to get a response: %s", strerror(-r));
tomjose26e17732016-03-03 08:52:51 -0600358 rc = IPMI_CC_UNSPECIFIED_ERROR;
359 goto cleanup;
Adriana Kobylak9355f612016-02-08 17:30:37 -0600360 }
361 if (eaddr1 == NULL)
362 {
363 fprintf(stderr, "Failed to get a valid response: %s", strerror(-r));
tomjose26e17732016-03-03 08:52:51 -0600364 rc = IPMI_CC_UNSPECIFIED_ERROR;
365 goto cleanup;
Adriana Kobylak9355f612016-02-08 17:30:37 -0600366 }
Hariharasubramanian R83951912016-01-20 07:06:36 -0600367
368 memcpy((void*)&buf[0], &current_revision, 1);
Adriana Kobylak9355f612016-02-08 17:30:37 -0600369
370 char *tokptr = NULL;
371 char* digit = strtok_r(eaddr1, ":", &tokptr);
372 if (digit == NULL)
373 {
374 fprintf(stderr, "Unexpected MAC format: %s", eaddr1);
vishwa1eaea4f2016-02-26 11:57:40 -0600375 rc = IPMI_CC_RESPONSE_ERROR;
tomjose26e17732016-03-03 08:52:51 -0600376 goto cleanup;
Adriana Kobylak9355f612016-02-08 17:30:37 -0600377 }
378
379 i=0;
380 while (digit != NULL)
381 {
382 int resp_byte = strtoul(digit, NULL, 16);
383 memcpy((void*)&buf[i+1], &resp_byte, 1);
384 i++;
385 digit = strtok_r(NULL, ":", &tokptr);
386 }
Hariharasubramanian R83951912016-01-20 07:06:36 -0600387
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500388 *data_len = sizeof(buf);
389 memcpy(response, &buf, *data_len);
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500390 }
391 else
392 {
393 fprintf(stderr, "Unsupported parameter 0x%x\n", reqptr->parameter);
vishwa1eaea4f2016-02-26 11:57:40 -0600394 rc = IPMI_CC_PARM_NOT_SUPPORTED;
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500395 }
396
tomjose26e17732016-03-03 08:52:51 -0600397cleanup:
vishwa1eaea4f2016-02-26 11:57:40 -0600398 sd_bus_error_free(&error);
399 reply = sd_bus_message_unref(reply);
Sergey Solomineb9b8142016-08-23 09:07:28 -0500400 free(app);
vishwa1eaea4f2016-02-26 11:57:40 -0600401
Adriana Kobylak5d6481f2015-10-29 21:44:55 -0500402 return rc;
403}
404
405void register_netfn_transport_functions()
406{
407 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_WILDCARD);
408 ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_WILDCARD, NULL, ipmi_transport_wildcard);
409
410 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_SET_LAN);
411 ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_LAN, NULL, ipmi_transport_set_lan);
412
413 printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_GET_LAN);
414 ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_LAN, NULL, ipmi_transport_get_lan);
415
416 return;
417}