SET(INCLUDEDIR "\${prefix}/include")
ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(binary)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(wfd-binary C)
+
+# Global setting
+SET(VERSION 0.0)
+
+# Build type : Release
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dhcpd.p2p.conf DESTINATION etc/wifi-direct)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dhcpd.eth.conf DESTINATION etc/wifi-direct)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dhcpd.wl0.conf DESTINATION etc/wifi-direct)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dhcpd-notify.sh DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/udhcp_script.non-autoip DESTINATION etc/wifi-direct)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wifi-direct-server.sh DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wifi-direct-dhcp.sh DESTINATION bin)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wfd-manager DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wifi-direct-plugin-broadcom.so DESTINATION lib)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libbcmp2p.so DESTINATION lib)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libbcmp2papp.so DESTINATION lib)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libbcmp2psig.so DESTINATION lib)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libwpscli.so DESTINATION lib)
+
--- /dev/null
+#!/bin/sh
+# Dump DHCP lease data: MAC IP Time
+dumpleases | awk '$1!="Mac" {print $1, $2, $3}' > /tmp/dhcp-client-table
+
+#Update vconf value to notify wifi-direct
+vconftool set -t int memory/private/wifi_direct_manager/dhcp_ip_lease 1
+#cat /tmp/dhcp-client-table
--- /dev/null
+start 192.168.49.20 #default: 192.168.0.20
+end 192.168.49.40 #default: 192.168.0.254
+interface wlan0 #default: wlan0
+max_leases 20 #default: 254
+notify_file /usr/bin/dhcpd-notify.sh
+
+option subnet 255.255.255.0
+option router 192.168.49.1
+option lease 864000 # 10 days of seconds
--- /dev/null
+start 192.168.49.20 #default: 192.168.0.20
+end 192.168.49.40 #default: 192.168.0.254
+interface p2p-wlan0-0 #default: wlan0
+max_leases 20 #default: 254
+notify_file /usr/bin/dhcpd-notify.sh
+
+
+option subnet 255.255.255.0
+option router 192.168.49.1
+option lease 864000 # 10 days of seconds
--- /dev/null
+start 192.168.49.20 #default: 192.168.0.20
+end 192.168.49.40 #default: 192.168.0.254
+interface wl0.1 #default: wlan0
+max_leases 20 #default: 254
+notify_file /usr/bin/dhcpd-notify.sh
+
+
+option subnet 255.255.255.0
+option router 192.168.49.1
+option lease 864000 # 10 days of seconds
--- /dev/null
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+RESOLV_CONF="/etc/resolv.conf"
+TEMP_DHCP_FILE="/tmp/udhcpc_dyn.tmp"
+UDHCPC_LOG="/tmp/udhcpc_log"
+
+env > /tmp/test_env
+
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+case "$1" in
+ deconfig)
+ /sbin/ifconfig $interface 0.0.0.0
+ ;;
+
+ renew|bound)
+ /sbin/ifconfig $interface $ip $BROADCAST $NETMASK up
+ echo "$interface $ip $BROADCAST $NETMASK" >> $UDHCPC_LOG
+# if [ -n "$router" ] ; then
+# echo "deleting routers" >> $UDHCPC_LOG
+# while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+# :
+# done
+#
+# for i in $router ; do
+# echo "router $i" >> $UDHCPC_LOG
+# route add default gw $i dev $interface
+# done
+# fi
+
+ echo -n > $RESOLV_CONF
+ [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
+ for i in $dns ; do
+ echo "adding dns $i" >> $UDHCPC_LOG
+ echo nameserver $i >> $RESOLV_CONF
+ done
+ echo serveraddr $serverid >> $TEMP_DHCP_FILE
+ echo leasetime $lease >> $TEMP_DHCP_FILE
+
+ if [ -n $router ]; then
+ for i in $router ; do
+# Take the first router
+ echo "route $i"
+ local_gateway=$i
+ break
+ done
+ fi
+ if [ -z $subnet ]; then
+ subnet="255.255.255.0"
+ fi
+ if [ -z $local_gateway ]; then
+ local_gateway="0.0.0.0"
+ fi
+
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_ifname ${interface}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_local_ip ${ip}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_subnet_mask ${subnet}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_gateway ${local_gateway}
+ vconftool set -t string memory/private/wifi_direct_manager/dhcpc_server_ip ${serverid}
+
+ echo $i >> $TEMP_DHCP_FILE
+ ;;
+esac
+
+exit 0
--- /dev/null
+#!/bin/sh
+INTERFACE_PREFIX="wl0"
+TARGET="U1HD"
+DEFAULT_IP="192.168.49.1"
+
+val=`uname -a | grep PQ | wc -l`
+if [ "${val}" -eq "1" ]; then
+ INTERFACE_PREFIX="p2p"
+ TARGET="PQ"
+fi
+
+val=`uname -a | grep i686 | wc -l`
+if [ "${val}" -eq "1" ]; then
+ INTERFACE_PREFIX="eth"
+ TARGET="EMUL"
+fi
+
+interface=`ifconfig|grep ^${INTERFACE_PREFIX}|cut -d" " -f1`
+echo "Target is ${TARGET} and interface ${INTERFACE_PREFIX}: ${interface}."
+
+start_dhcp_server()
+{
+ if [ "X${interface}" == "X" ]; then
+ echo "interface(${INTERFACE_PREFIX}) is not up"
+ return 0
+ fi
+
+ ifconfig ${interface} ${DEFAULT_IP} up
+ udhcpd /usr/etc/wifi-direct/dhcpd.${INTERFACE_PREFIX}.conf -f &
+
+ route=`cat /usr/etc/wifi-direct/dhcpd.${INTERFACE_PREFIX}.conf | grep router | awk '{print $3}'`
+ if [ -z $route ]; then
+ route="192.168.49.1"
+ fi
+ subnet=`cat /usr/etc/wifi-direct/dhcpd.${INTERFACE_PREFIX}.conf | grep subnet | awk '{print $3}'`
+
+ if [ -z $subnet ]; then
+ subnet="255.255.255.0"
+ fi
+
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_ifname ${interface}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_local_ip ${DEFAULT_IP}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_subnet_mask ${subnet}
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_gateway ${route}
+
+}
+
+start_dhcp_client()
+{
+ if [ "X${interface}" == "X" ]; then
+ echo "interface(${INTERFACE_PREFIX}) is not up"
+ return 0
+ fi
+ /usr/bin/udhcpc -i $interface -s /usr/etc/wifi-direct/udhcp_script.non-autoip &
+}
+
+
+stop_dhcp()
+{
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_ifname ""
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_local_ip ""
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_subnet_mask ""
+ vconftool set -t string memory/private/wifi_direct_manager/p2p_gateway ""
+
+ killall udhcpc
+ killall udhcpd
+# ifconfig ${interface} 0.0.0.0
+}
+
+is_running()
+{
+ program=$1
+ run=`ps -eo comm|grep ${program}`
+ if [ "X${run}" == "X" ]; then
+ echo "${program} is not running"
+ else
+ echo "${program} is already running"
+ fi
+}
+
+status_dhcp()
+{
+ is_running udhcpc
+ is_running udhcpd
+}
+
+
+case $1 in
+"server")
+stop_dhcp
+start_dhcp_server
+;;
+"client")
+stop_dhcp
+start_dhcp_client
+;;
+"stop")
+stop_dhcp
+;;
+"status")
+status_dhcp
+;;
+*)
+/bin/echo wifi-direct-dhcp.sh [server] [client] [stop] [status]
+exit 1
+;;
+esac
+
--- /dev/null
+#!/bin/sh
+program="wfd-manager"
+target=`ps -eo comm|grep ${program}`
+
+start_wifi_direct()
+{
+ if [ "X${target}" == "X" ]; then
+ echo "${program} is not running"
+ echo "Launching ${program}"
+ /usr/bin/${program}&
+ sleep 1
+ else
+ echo "${program} is already running"
+ fi
+}
+
+stop_wifi_direct()
+{
+ if [ "X${target}" == "X" ]; then
+ echo "${program} is not running"
+ else
+ echo "${program} is running.. Killing it"
+ killall ${program}
+ fi
+}
+
+status_wifi_direct()
+{
+ if [ "X${target}" == "X" ]; then
+ echo "${program} is not running"
+ else
+ echo "${program} is already running"
+ fi
+}
+
+case $1 in
+"start")
+start_wifi_direct
+;;
+"stop")
+stop_wifi_direct
+;;
+"status")
+status_wifi_direct
+;;
+*)
+/bin/echo wifi-direct-server.sh [start] [stop] [status]
+exit 1
+;;
+esac
+libwifi-direct (0.2.9) unstable; urgency=low
+
+ * modified to loading binary of wifi-direct-manager when installing package.
+ * Git : framework/connectivity/libwifi-direct
+ * Tag : libwifi-direct_0.2.9
+
+ -- Sungsik Jang <sungsik.jang@samsung.com> Fri, 24 Aug 2012 18:45:19 +0900
+
libwifi-direct (0.2.8) unstable; urgency=low
* tagging "tizen_build"
Name: libwifi-direct
Summary: wifi direct library (Shared Library)
-Version: 0.2.8
+Version: 0.2.9
Release: 1
Group: TO_BE_FILLED
License: Apache-2.0
%description
wifi direct library (Shared Library)
+%ifarch %{arm}
+Provides: libbcmp2p.so
+Provides: libbcmp2papp.so
+Provides: libwpscli.so
+Provides: libbcmp2psig.so
+Provides: wfd-manager
+Provides: wifi-direct-plugin-broadcom.so
+%endif
+
+
%package devel
Summary: wifi direct library (Shared Library) (Developement)
%{_libdir}/libwifi-direct.so.0
%{_libdir}/libwifi-direct.so.0.0
+%ifarch %{arm}
+/usr/etc/wifi-direct/dhcpd.p2p.conf
+/usr/etc/wifi-direct/dhcpd.wl0.conf
+/usr/etc/wifi-direct/dhcpd.eth.conf
+/usr/etc/wifi-direct/udhcp_script.non-autoip
+%{_bindir}/dhcpd-notify.sh
+%{_bindir}/wifi-direct-server.sh
+%{_bindir}/wifi-direct-dhcp.sh
+
+%{_bindir}/wfd-manager
+%{_libdir}/wifi-direct-plugin-broadcom.so
+%{_libdir}/libbcmp2p.so
+%{_libdir}/libbcmp2papp.so
+%{_libdir}/libbcmp2psig.so
+%{_libdir}/libwpscli.so
+
+%attr(755,-,-) %{_bindir}/wfd-manager
+%attr(755,-,-) %{_bindir}/dhcpd-notify.sh
+%attr(755,-,-) %{_bindir}/wifi-direct-server.sh
+%attr(755,-,-) %{_bindir}/wifi-direct-dhcp.sh
+%attr(755,-,-) /usr/etc/wifi-direct/udhcp_script.non-autoip
+
+%endif
+
+
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/wifi-direct.pc