summaryrefslogtreecommitdiffstats
path: root/ipmid.C
diff options
context:
space:
mode:
Diffstat (limited to 'ipmid.C')
-rw-r--r--ipmid.C11
1 files changed, 8 insertions, 3 deletions
diff --git a/ipmid.C b/ipmid.C
index 0c7be7b..6b1eacc 100644
--- a/ipmid.C
+++ b/ipmid.C
@@ -15,6 +15,7 @@
sd_bus *bus = NULL;
+
FILE *ipmiio, *ipmidbus, *ipmicmddetails;
void print_usage(void) {
@@ -367,6 +368,10 @@ void ipmi_register_callback_handlers(const char* ipmi_lib_path)
return;
}
+sd_bus *ipmid_get_sd_bus_connection(void) {
+ return bus;
+}
+
int main(int argc, char *argv[])
{
sd_bus_slot *slot = NULL;
@@ -402,9 +407,6 @@ int main(int argc, char *argv[])
}
- // Register all the handlers that provider implementation to IPMI commands.
- ipmi_register_callback_handlers(HOST_IPMI_LIB_PATH);
-
/* Connect to system bus */
r = sd_bus_open_system(&bus);
if (r < 0) {
@@ -413,6 +415,9 @@ int main(int argc, char *argv[])
goto finish;
}
+ // Register all the handlers that provider implementation to IPMI commands.
+ ipmi_register_callback_handlers(HOST_IPMI_LIB_PATH);
+
r = sd_bus_add_match(bus, &slot, FILTER, handle_ipmi_command, NULL);
if (r < 0) {
fprintf(stderr, "Failed: sd_bus_add_match: %s : %s\n", strerror(-r), FILTER);
OpenPOWER on IntegriCloud