diff options
author | Tudor Marcu <tudor.a.marcu@intel.com> | 2012-09-12 15:05:51 -0700 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-14 16:32:00 +0300 |
commit | 0e72f6899873f79d41001efe067938b11c7dd940 (patch) | |
tree | 4bf95ecc079827d67271d2c78254361e1409e038 /client/services.h | |
parent | 1545e31f2034a67b28e1b6634b160a655d1361d8 (diff) | |
download | connman-0e72f6899873f79d41001efe067938b11c7dd940.tar.gz connman-0e72f6899873f79d41001efe067938b11c7dd940.tar.bz2 connman-0e72f6899873f79d41001efe067938b11c7dd940.zip |
client: Service API command line client support
Support Service API message D-Bus message parsing. Functions are
provided for configuring properties, iterating through D-Bus messages
and extracting properties in a useful manner.
Diffstat (limited to 'client/services.h')
-rw-r--r-- | client/services.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/client/services.h b/client/services.h new file mode 100644 index 00000000..cdcc7b20 --- /dev/null +++ b/client/services.h @@ -0,0 +1,57 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2012 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ +#ifndef __CLIENT_SERVICES_H +#define __CLIENT_SERVICES_H + +#include <stdint.h> + +#include <dbus/dbus.h> + +struct service_data { + const char *path; + const char *name; + dbus_bool_t autoconn; + dbus_bool_t favorite; + dbus_bool_t connected; + dbus_bool_t online; +}; + +char *strip_service_path(char *service); +void extract_service_name(DBusMessageIter *dict, struct service_data *service); +int set_service_property(DBusConnection *connection, DBusMessage *message, + char *name, char *property, char **keys, + void *data, int num_args); +int set_proxy_manual(DBusConnection *connection, DBusMessage *message, + char *name, char **servers, char **excludes, + int num_servers, int num_excludes); + +const char *find_service(DBusConnection *connection, DBusMessage *message, + char *service_name, struct service_data *service); +void extract_services(DBusMessage *message, char *service_name); +void get_services(DBusMessage *message); +void iterate_dict(DBusMessageIter *dict, char *string, uint16_t key_int); +int list_services(DBusConnection *connection, char *function); +int list_services_properties(DBusConnection *connection, char *function, + char *service_name); +int listen_for_service_signal(DBusConnection *connection, char *signal_name, + char *service_name); +void iterate_array(DBusMessageIter *iter); +#endif |