dnsproxy: Only one copy of the relevant buffers will be made to a TCP request
[framework/connectivity/connman.git] / unit / test-connman.h
index 17037f9..872aabd 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007-2010  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-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
 
 #include <connman/dbus.h>
 
-#include "connman.h"
+#include "../src/connman.h"
 
 struct test_session;
 
+struct test_manager {
+       char *state;
+};
+
 struct test_fix {
        gpointer user_data;
 
        GMainLoop *main_loop;
        DBusConnection *main_connection;
+       guint watch;
+       guint manager_watch;
+
+       struct test_manager manager;
+       GSourceFunc manager_changed;
 
        /* session test cases */
        unsigned int max_sessions;
@@ -57,9 +66,23 @@ void util_teardown(struct test_fix *fix, gconstpointer data);
 
 void util_session_create(struct test_fix *fix, unsigned int max_sessions);
 void util_session_destroy(gpointer fix);
+void util_session_init(struct test_session *session);
+void util_session_cleanup(struct test_session *session);
 
 typedef void (* notify_cb) (struct test_session *session);
 
+enum connman_session_state {
+       CONNMAN_SESSION_STATE_DISCONNECTED   = 0,
+       CONNMAN_SESSION_STATE_CONNECTED      = 1,
+       CONNMAN_SESSION_STATE_ONLINE         = 2,
+};
+
+enum connman_session_type {
+       CONNMAN_SESSION_TYPE_ANY      = 0,
+       CONNMAN_SESSION_TYPE_LOCAL    = 1,
+       CONNMAN_SESSION_TYPE_INTERNET = 2,
+};
+
 enum connman_session_roaming_policy {
        CONNMAN_SESSION_ROAMING_POLICY_UNKNOWN          = 0,
        CONNMAN_SESSION_ROAMING_POLICY_DEFAULT          = 1,
@@ -71,7 +94,8 @@ enum connman_session_roaming_policy {
 
 struct test_session_info {
        char *bearer;
-       connman_bool_t online;
+       enum connman_session_state state;
+       enum connman_session_type type;
        char *name;
        /* ipv4, ipv6 dicts */
        GSList *allowed_bearers;
@@ -99,8 +123,28 @@ struct test_session {
        struct test_session_info *info;
 };
 
+struct test_bearer_info {
+       char *name;
+};
+
+/* session-api.c */
+void bearer_info_cleanup(gpointer bearer_info, gpointer user_data);
+
+void session_append_settings(DBusMessageIter *dict,
+                               struct test_session_info *info);
+int session_notify_register(struct test_session *session,
+                               const char *notify_path);
+int session_notify_unregister(struct test_session *session,
+                               const char *notify_path);
+
+DBusMessage *session_connect(DBusConnection *connection,
+                               struct test_session *session);
+DBusMessage *session_disconnect(DBusConnection *connection,
+                                       struct test_session *session);
+
 /* manager-api.c */
 DBusMessage *manager_get_services(DBusConnection *connection);
+DBusMessage *manager_get_properties(DBusConnection *connection);
 DBusMessage *manager_create_session(DBusConnection *connection,
                                        struct test_session_info *info,
                                        const char *notifier_path);
@@ -108,7 +152,8 @@ DBusMessage *manager_destroy_session(DBusConnection *connection,
                                        const char *notifier_path);
 DBusMessage *manager_set_session_mode(DBusConnection *connection,
                                        connman_bool_t enable);
-
+int manager_parse_properties(DBusMessage *msg,
+                               struct test_manager *manager);
 
 /* #define DEBUG */
 #ifdef DEBUG