2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <gmock/gmock.h>
21 #include <gtest/gtest.h>
36 error_e Mptcp::MptcpSupported(bool *supported)
38 GVariant *message = NULL;
39 error_e error = ERROR_NONE;
41 message = InvokeMethod(NETCONFIG_SERVICE,
43 NETCONFIG_MPTCP_INTERFACE,
48 if (message == NULL) {
49 GLOGD("Failed to invoke dbus method");
53 g_variant_get(message, "(b)", supported);
54 g_variant_unref(message);
59 error_e Mptcp::MptcpSetEnable(int enabled)
61 GVariant *message = NULL;
62 error_e error = ERROR_NONE;
64 message = InvokeMethod(NETCONFIG_SERVICE,
66 NETCONFIG_MPTCP_INTERFACE,
68 g_variant_new("(i)", enabled),
71 if (message == NULL) {
72 GLOGD("Failed to invoke dbus method");
76 g_variant_unref(message);
81 error_e Mptcp::MptcpGetEnabled(int *enabled)
83 GVariant *message = NULL;
84 error_e error = ERROR_NONE;
86 message = InvokeMethod(NETCONFIG_SERVICE,
88 NETCONFIG_MPTCP_INTERFACE,
93 if (message == NULL) {
94 GLOGD("Failed to invoke dbus method");
98 g_variant_get(message, "(i)", enabled);
99 g_variant_unref(message);
104 error_e Mptcp::MptcpSetPathManager(const char *path)
106 GVariant *message = NULL;
107 error_e error = ERROR_NONE;
109 message = InvokeMethod(NETCONFIG_SERVICE,
110 NETCONFIG_MPTCP_PATH,
111 NETCONFIG_MPTCP_INTERFACE,
112 MPTCP_SET_PATH_MANAGER,
113 g_variant_new("(s)", path),
116 if (message == NULL) {
117 GLOGD("Failed to invoke dbus method");
121 g_variant_unref(message);
126 error_e Mptcp::MptcpGetPathManager(char *path)
128 GVariant *message = NULL;
129 error_e error = ERROR_NONE;
131 message = InvokeMethod(NETCONFIG_SERVICE,
132 NETCONFIG_MPTCP_PATH,
133 NETCONFIG_MPTCP_INTERFACE,
134 MPTCP_GET_PATH_MANAGER,
138 if (message == NULL) {
139 GLOGD("Failed to invoke dbus method");
143 g_variant_get(message, "(s)", path);
144 g_variant_unref(message);
149 error_e Mptcp::MptcpSetScheduler(const char *sched)
151 GVariant *message = NULL;
152 error_e error = ERROR_NONE;
154 message = InvokeMethod(NETCONFIG_SERVICE,
155 NETCONFIG_MPTCP_PATH,
156 NETCONFIG_MPTCP_INTERFACE,
158 g_variant_new("(s)", sched),
161 if (message == NULL) {
162 GLOGD("Failed to invoke dbus method");
166 g_variant_unref(message);
171 error_e Mptcp::MptcpGetScheduler(char *sched)
173 GVariant *message = NULL;
174 error_e error = ERROR_NONE;
176 message = InvokeMethod(NETCONFIG_SERVICE,
177 NETCONFIG_MPTCP_PATH,
178 NETCONFIG_MPTCP_INTERFACE,
183 if (message == NULL) {
184 GLOGD("Failed to invoke dbus method");
188 g_variant_get(message, "(s)", sched);
189 g_variant_unref(message);