2 * Network Configuration Module
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 #include "wifi-dump.h"
28 #define NETWORK_DUMP_SCRIPT "/opt/var/lib/net-config/network_dump.sh"
30 static int _start_dump(gchar *dump_path)
33 gchar *path = NETWORK_DUMP_SCRIPT;
34 char *const args[] = { "/opt/var/lib/net-config/network_dump.sh", dump_path, NULL };
35 char *const envs[] = { NULL };
37 rv = netconfig_execute_file(path, args, envs);
39 ERR("Fail to execute network_dump.sh");
46 static void _send_dump_signal(const gchar *sig_name)
49 GDBusConnection *connection = NULL;
52 connection = netdbus_get_connection();
53 if (connection == NULL) {
54 DBG("GDBusconnection is NULL");
58 reply = g_dbus_connection_emit_signal(connection,
60 DUMP_SERVICE_OBJECT_PATH,
61 DUMP_SERVICE_INTERFACE,
67 ERR("Failed to send signal [%s]", error->message);
74 int netconfig_dump_log(const char *path)
76 gchar *dump_path = NULL;
79 ERR("path is NULL. Dump Fail");
82 ERR("Dump is started");
83 _send_dump_signal(DUMP_START_SIGNAL);
85 dump_path = g_strdup(path);
86 _start_dump(dump_path);
89 _send_dump_signal(DUMP_FINISH_SIGNAL);
90 ERR("Dump is finished");