ADD_DEFINITIONS(-DTIZEN_WLAN_BOARD_SPRD)
ENDIF(TIZEN_WLAN_BOARD_SPRD)
-IF(TIZEN_DEBUG_DISABLE)
- ADD_DEFINITIONS(-DTIZEN_DEBUG_DISABLE)
- SET(SRCS ${SRCS} src/wifi-dump.c)
-ENDIF(TIZEN_DEBUG_DISABLE)
-
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(pkgs REQUIRED
dlog
+++ /dev/null
-/*
- * Network Configuration Module
- *
- * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __NETCONFIG_WIFI_DUMP_H__
-#define __NETCONFIG_WIFI_DUMP_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define DUMP_SERVICE_BUS_NAME "org.tizen.system.dumpservice"
-#define DUMP_SERVICE_OBJECT_PATH "/Org/Tizen/System/DumpService"
-#define DUMP_SERVICE_INTERFACE "org.tizen.system.dumpservice"
-
-#define DUMP_SIGNAL "Dump"
-#define DUMP_START_SIGNAL "Start"
-#define DUMP_FINISH_SIGNAL "Finish"
-
-int netconfig_dump_log(const char *path);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
cp resources/etc/dbus-1/system.d/net-config.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/net-config.conf
-#log dump
-mkdir -p %{buildroot}%{TZ_SYS_ETC}/dump.d/module.d/
-cp resources/opt/etc/dump.d/module.d/network_log_dump.sh %{buildroot}%{TZ_SYS_ETC}/dump.d/module.d/network_log_dump.sh
-mkdir -p %{buildroot}%{TZ_SYS_VAR}/lib/net-config/
-cp resources/opt/etc/dump.d/module.d/network_log_dump.sh %{buildroot}%{TZ_SYS_VAR}/lib/net-config/network_log_dump.sh
-cp resources/opt/etc/dump.d/module.d/network_dump.sh %{buildroot}%{TZ_SYS_VAR}/lib/net-config/network_dump.sh
-
%if 0%{?model_build_feature_wlan_wearable} == 1
#softreset scripts
mkdir -p %{buildroot}/usr/system/RestoreDir/softreset
%attr(644,root,root) %{_unitdir}/multi-user.target.wants/net-config.service
%endif
%{_datadir}/license/net-config
-%attr(500,root,root) %{TZ_SYS_ETC}/dump.d/module.d/network_log_dump.sh
-%attr(500,root,root) %{TZ_SYS_VAR}/lib/net-config/network_log_dump.sh
-%attr(500,root,root) %{TZ_SYS_VAR}/lib/net-config/network_dump.sh
%if "%{profile}" == "tv"
%attr(644,root,root) %{_libdir}/udev/rules.d/99-wifiusb-dev.rules
%endif
+++ /dev/null
-#!/bin/sh
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-# $1 is passed by dump_service
-
-export DISPLAY=:0.0
-NETWORK_ORG=/opt/usr/data/network
-NETWORK_DEBUG=$1/network
-
-/bin/mkdir -p ${NETWORK_DEBUG}
-/bin/tar -czf ${NETWORK_DEBUG}/network.tar.gz -C ${NETWORK_ORG} .
+++ /dev/null
-#!/bin/sh
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-#--------------------------------------
-# network
-#--------------------------------------
-
-# not allow to use relative path
-if [[ $1 == *"../"* ]]
-then
- exit -1
-fi
-
-export DISPLAY=:0.0
-NETWORK_ORG=/opt/usr/data/network
-NETWORK_DEBUG=$1/network
-
-/bin/mkdir -p ${NETWORK_DEBUG}
-
-/sbin/ifconfig > ${NETWORK_DEBUG}/ifconfig
-/bin/netstat -na > ${NETWORK_DEBUG}/netstat
-/sbin/route -n > ${NETWORK_DEBUG}/route
-/bin/cat /proc/net/wireless > ${NETWORK_DEBUG}/wireless
-/bin/cat /etc/resolv.conf > ${NETWORK_DEBUG}/resolv.conf
-/usr/bin/vconftool get memory/dnet >> ${NETWORK_DEBUG}/status
-/usr/bin/vconftool get memory/wifi >> ${NETWORK_DEBUG}/status
-/usr/bin/vconftool get file/private/wifi >> ${NETWORK_DEBUG}/status
-/usr/bin/vconftool get db/wifi >> ${NETWORK_DEBUG}/status
-/sbin/ifconfig -a > ${NETWORK_DEBUG}/ifconfig
-/bin/mv ${NETWORK_ORG}/tcpdump*.pcap* $1/../
-/bin/tar -czf ${NETWORK_DEBUG}/network.tar.gz -C ${NETWORK_ORG} .
#include "wifi-background-scan.h"
#include "wifi-tdls.h"
-#if defined TIZEN_DEBUG_DISABLE
-#include "wifi-dump.h"
-#endif
-
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
#define SIGNAL_INTERFACE_REMOVED "InterfaceRemoved"
};
static int supp_subscription_ids[SIG_MAX] = {0};
-static int dumpservice_subscription_id = 0;
typedef void (*supplicant_signal_cb)(GDBusConnection *conn,
const gchar *name, const gchar *path, const gchar *interface,
_supplicant_tdls_peer_found
};
-#if defined TIZEN_DEBUG_DISABLE
-static void __netconfig_dumpservice_handler(GDBusConnection *conn,
- const gchar *name, const gchar *path, const gchar *interface,
- const gchar *sig, GVariant *param, gpointer user_data)
-{
- int mode;
- gchar *signal_path = NULL;
-
- if (param == NULL)
- return;
-
- g_variant_get(param, "(io)", &mode, &signal_path);
- DBG("Path: %s and mode: %d", signal_path, mode);
- netconfig_dump_log(path);
- if (signal_path)
- g_free(signal_path);
-
- return;
-}
-#endif
-
void register_gdbus_signal(void)
{
GDBusConnection *connection = NULL;
INFO("Successfully register Supplicant DBus signal filters");
-#if defined TIZEN_DEBUG_DISABLE
- dumpservice_subscription_id = g_dbus_connection_signal_subscribe(
- connection,
- /*
- * Sender => For testing purpose made NULL
- *WPA_SUPPLICANT,
- */
- NULL,
- DUMP_SERVICE_INTERFACE,
- DUMP_SIGNAL,
- NULL,
- NULL,
- G_DBUS_SIGNAL_FLAGS_NONE,
- __netconfig_dumpservice_handler,
- NULL,
- NULL);
-
- INFO("Successfully register Dumpservice DBus signal filter");
-#endif
/* In case ConnMan precedes this signal register,
* net-config should update the default connected profile.
*/
}
}
- g_dbus_connection_signal_unsubscribe(connection,
- dumpservice_subscription_id);
}
+++ /dev/null
-/*
- * Network Configuration Module
- *
- * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <glib.h>
-#include <tzplatform_config.h>
-
-#include "log.h"
-
-#include "util.h"
-#include "netdbus.h"
-#include "wifi-dump.h"
-
-#define NETWORK_DUMP_SCRIPT tzplatform_mkpath(TZ_SYS_VAR, "/lib/net-config/network_dump.sh")
-
-static int _start_dump(gchar *dump_path)
-{
- int rv = 0;
- gchar *path = NETWORK_DUMP_SCRIPT;
- char *const args[] = { path, dump_path, NULL };
- char *const envs[] = { NULL };
-
- rv = netconfig_execute_file(path, args, envs);
- if (rv < 0) {
- ERR("Fail to execute network_dump.sh");
- return -EIO;
- }
-
- return 0;
-}
-
-static void _send_dump_signal(const gchar *sig_name)
-{
- gboolean reply;
- GDBusConnection *connection = NULL;
- GError *error = NULL;
-
- connection = netdbus_get_connection();
- if (connection == NULL) {
- DBG("GDBusconnection is NULL");
- return;
- }
-
- reply = g_dbus_connection_emit_signal(connection,
- NULL,
- DUMP_SERVICE_OBJECT_PATH,
- DUMP_SERVICE_INTERFACE,
- sig_name,
- NULL,
- &error);
- if (reply != TRUE) {
- if (error != NULL) {
- ERR("Failed to send signal [%s]", error->message);
- g_error_free(error);
- }
- return;
- }
-}
-
-int netconfig_dump_log(const char *path)
-{
- gchar *dump_path = NULL;
-
- if (!path) {
- ERR("path is NULL. Dump Fail");
- return -1;
- }
- ERR("Dump is started");
- _send_dump_signal(DUMP_START_SIGNAL);
-
- dump_path = g_strdup(path);
- _start_dump(dump_path);
- g_free(dump_path);
-
- _send_dump_signal(DUMP_FINISH_SIGNAL);
- ERR("Dump is finished");
- return 0;
-}