diff options
author | Thomas Haller <thaller@redhat.com> | 2018-01-28 11:20:21 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-02-09 21:10:14 +0100 |
commit | 2d55e566193e1c0fdea6c837f9001d19f9fdd9f3 (patch) | |
tree | 78497c9514005cdc72f30a0e8bbb511683fa8da7 | |
parent | 7ee55ae183cd9320dcc81039807df1d2b6d438d3 (diff) | |
download | NetworkManager-2d55e566193e1c0fdea6c837f9001d19f9fdd9f3.tar.gz |
dhcp: use NM_DEFINE_GDBUS_INTERFACE_INFO() macros to define D-Bus registration info for DHCP listener
-rw-r--r-- | src/dhcp/nm-dhcp-listener.c | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/src/dhcp/nm-dhcp-listener.c b/src/dhcp/nm-dhcp-listener.c index b496ae9392..956c281652 100644 --- a/src/dhcp/nm-dhcp-listener.c +++ b/src/dhcp/nm-dhcp-listener.c @@ -204,50 +204,34 @@ _method_call (GDBusConnection *connection, g_dbus_method_invocation_return_value (invocation, NULL); } +NM_DEFINE_GDBUS_INTERFACE_INFO ( + interface_info, + NM_DHCP_HELPER_SERVER_INTERFACE_NAME, + .methods = NM_DEFINE_GDBUS_METHOD_INFOS ( + NM_DEFINE_GDBUS_METHOD_INFO ( + NM_DHCP_HELPER_SERVER_METHOD_NOTIFY, + .in_args = NM_DEFINE_GDBUS_ARG_INFOS ( + NM_DEFINE_GDBUS_ARG_INFO ( + "data", + .signature = "a{sv}", + ), + ), + ), + ), +); + static guint _dbus_connection_register_object (NMDhcpListener *self, GDBusConnection *connection, GError **error) { - static const GDBusArgInfo arg_info_notify_in = { - .ref_count = -1, - .name = "data", - .signature = "a{sv}", - .annotations = NULL, - }; - static const GDBusArgInfo *const arg_infos_notify[] = { - &arg_info_notify_in, - NULL, - }; - static const GDBusMethodInfo method_info_notify = { - .ref_count = -1, - .name = NM_DHCP_HELPER_SERVER_METHOD_NOTIFY, - .in_args = NM_UNCONST_PPTR (GDBusArgInfo, arg_infos_notify), - .out_args = NULL, - .annotations = NULL, - }; - static const GDBusMethodInfo *const method_infos[] = { - &method_info_notify, - NULL, - }; - static const GDBusInterfaceInfo interface_info = { - .ref_count = -1, - .name = NM_DHCP_HELPER_SERVER_INTERFACE_NAME, - .methods = NM_UNCONST_PPTR (GDBusMethodInfo, method_infos), - .signals = NULL, - .properties = NULL, - .annotations = NULL, - }; - static const GDBusInterfaceVTable interface_vtable = { .method_call = _method_call, - .get_property = NULL, - .set_property = NULL, }; return g_dbus_connection_register_object (connection, NM_DHCP_HELPER_SERVER_OBJECT_PATH, - NM_UNCONST_PTR (GDBusInterfaceInfo, &interface_info), + interface_info, NM_UNCONST_PTR (GDBusInterfaceVTable, &interface_vtable), self, NULL, |