OLD | NEW |
1 /* | 1 /* |
2 * dhcpcd-dbus | 2 * dhcpcd-dbus |
3 * Copyright 2009 Roy Marples <roy@marples.name> | 3 * Copyright 2009 Roy Marples <roy@marples.name> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 dbus_connection_send(con, reply, NULL); | 465 dbus_connection_send(con, reply, NULL); |
466 dbus_message_unref(reply); | 466 dbus_message_unref(reply); |
467 return DBUS_HANDLER_RESULT_HANDLED; | 467 return DBUS_HANDLER_RESULT_HANDLED; |
468 } | 468 } |
469 | 469 |
470 static DBusHandlerResult | 470 static DBusHandlerResult |
471 msg_handler(DBusConnection *con, DBusMessage *msg, _unused void *data) | 471 msg_handler(DBusConnection *con, DBusMessage *msg, _unused void *data) |
472 { | 472 { |
473 #define IsMethod(msg, method) \ | 473 #define IsMethod(msg, method) \ |
474 dbus_message_is_method_call(msg, DHCPCD_SERVICE, method) | 474 dbus_message_is_method_call(msg, DHCPCD_SERVICE, method) |
475 » if (IsMethod(msg, "Introspect")) { | 475 » if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, |
| 476 "Introspect")) { |
476 return introspect(con, msg); | 477 return introspect(con, msg); |
477 } else if (IsMethod(msg, "GetVersion")) { | 478 } else if (IsMethod(msg, "GetVersion")) { |
478 return version(con, msg, VERSION); | 479 return version(con, msg, VERSION); |
479 } else if (IsMethod(msg, "GetInterfaces")) { | 480 } else if (IsMethod(msg, "GetInterfaces")) { |
480 return dhcpcd_get_interfaces(con, msg); | 481 return dhcpcd_get_interfaces(con, msg); |
481 } else if (IsMethod(msg, "GetStatus")) { | 482 } else if (IsMethod(msg, "GetStatus")) { |
482 return return_status(con, msg); | 483 return return_status(con, msg); |
483 } else if (IsMethod(msg, "Rebind")) { | 484 } else if (IsMethod(msg, "Rebind")) { |
484 bind_interface(ifaces); /* XXX */ | 485 bind_interface(ifaces); /* XXX */ |
485 return dbus_ack(con, msg); | 486 return dbus_ack(con, msg); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 run_script(const struct interface *ifp) | 618 run_script(const struct interface *ifp) |
618 { | 619 { |
619 syslog(LOG_DEBUG, "executing `%s', reason %s", | 620 syslog(LOG_DEBUG, "executing `%s', reason %s", |
620 ifp->name, ifp->state->reason); | 621 ifp->name, ifp->state->reason); |
621 #if 0 | 622 #if 0 |
622 /* push state over d-bus */ | 623 /* push state over d-bus */ |
623 dhcpcd_dbus_configure(ifp, ifp->state->reason); | 624 dhcpcd_dbus_configure(ifp, ifp->state->reason); |
624 #endif | 625 #endif |
625 return 0; | 626 return 0; |
626 } | 627 } |
OLD | NEW |