기존의 [WPASupplicant 핵심가이드] 의 개정 문서로서 작성 당시의 최신버전(2.3)을 기준으로 설명한다. 여기서 설명하는 모든 기준은 NX1(SD8887) 이다.
Host OS | Ubuntu 14.04.1 LTS(64bit) |
Kernel | Linux ubuntu 3.13.0-37-generic |
Toolchain | ARM(arm-2011.09)/arm-none-linux-gnueabi-gcc(NX1 용) - 설치 경로(/usr/local/arm-2011.09/bin) |
Etc | wpa_supplicant-2.3.tar.gz(2014.10 최신), libnl-3.2.25.tar.gz(2014.10 최신), openssl-1.0.1i.tar.gz(2014.10 최신), ncurses-5.9.tar.gz(2014.10 최신), readline-6.3.tar.gz(2014.10 최신) |
Driver | SD8887-15.68.4.p211-C3X15C059-GPL-(FP68) |
필요한 프로그램 소스코드들은 아래의 주소에서 다운 받을 수 있다.
이름 | 주소 | 설치 경로 |
openssl | https://www.openssl.org/source/ | /usr/local/lib/openssl-arm |
libnl | http://www.infradead.org/~tgr/libnl/ | /usr/local/lib/libnl-arm |
readline | http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html | /usr/local/lib/readline |
ncurses | http://ftp.gnu.org/pub/gnu/ncurses/ | /usr/local/lib/ncurses |
wpa_supplicant | http://w1.fi/wpa_supplicant/ | /usr/local/wpa_supplicant-arm |
먼저 압축을 풀고, Configure 파일을 수정한다.
#tar xzf openssl-1.0.1i.tar.gz #cd openssl-1.0.1i/ #vi Configure
'linux-elf-arm' 이라는 빌드 타겟을 추가로 선언한다. 기존의 'linux-elf' 타겟을 복사하여 컴파일러 이름과 경로만 수정한다.
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-elf-arm", "/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
이제 Makefile 파일을 만들 차례다.
#./Configure linux-elf-arm --prefix=/usr/local/lib/openssl-arm --openssldir=/usr/local/lib/openssl-arm no-threads no-asm
prefix 와 openssldir 은 빌드 후 설치할 경로를 적으면 된다. 이제 빌드 후, 설치하면 된다.
#make #make install
에러없이 종료되었다면, 설치된 경로에 가보자.
#cd /usr/local/lib/openssl-arm #ls include/openssl/ aes.h asn1t.h bn.h cast.h comp.h crypto.h dh.h dtls1.h ec.h engine.h hmac.h kssl.h md5.h obj_mac.h opensslconf.h pem.h pkcs7.h rc2.h rsa.h sha.h ssl.h ssl3.h tls1.h ui.h x509.h asn1.h bio.h buffer.h cmac.h conf.h des.h dsa.h e_os2.h ecdh.h err.h idea.h lhash.h mdc2.h objects.h opensslv.h pem2.h pqueue.h rc4.h safestack.h srp.h ssl2.h stack.h ts.h ui_compat.h x509_vfy.h asn1_mac.h blowfish.h camellia.h cms.h conf_api.h des_old.h dso.h ebcdic.h ecdsa.h evp.h krb5_asn.h md4.h modes.h ocsp.h ossl_typ.h pkcs12.h rand.h ripemd.h seed.h srtp.h ssl23.h symhacks.h txt_db.h whrlpool.h x509v3.h #ls lib/ engines libcrypto.a libssl.a pkgconfig
wpa_supplicant 가 참조하는 파일인 헤더파일(include)과 라이브러리(lib) 파일들을 확인한다.
압축을 풀고, Makefile 을 생성하기 위해 아래와 같이 실행한다.
#tar xzf libnl-3.2.25.tar.gz #cd libnl-3.2.25 #./configure --host=/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi CC=/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-gcc LD=/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-ld AR=/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-ar --prefix=/usr/local/lib/libnl-arm #make #make install
에러없이 빌드되었다면, 설치된 경로(/usr/local/lib/libnl-arm)에 가서 헤더 파일과 라이브러리가 생성되었을 것이다. 이후 wpa_supplicant 빌드 시, 이 경로를 참조할 것이다.
readline 라이브러리는 wpa_supplicant 를 빌드하는데 반드시 필요한 것은 아니다. 이것은 wpa_cli 를 사용할 때, TAB 키를 이용한 명령어 자동 완성 기능이나, 방향키를 이용하여 명령어 히스토리를 보는데에 사용된다.
다시 말해 크게 필요하지는 않지만 있으면 무척 편리하다.
압축을 풀고, Makefile 을 생성하기 위해 아래와 같이 실행한다.
#tar xzf readline-6.3.tar.gz #cd readline-6.3 #./configure --host=arm-none-linux-gnueabi --prefix=/usr/local/lib/readline bash_cv_wcwidth_broken=yes #make #make install
에러없이 빌드되었다면, 지정한 위치(/usr/local/lib/readline)에 헤더파일과 라이브러리가 생성되었을 것이다.
ncurses 역시, wpa_cli 의 편의를 위해 필요한 라이브러리다. 압축을 풀고, Makefile 을 생성하기 위해 아래와 같이 실행한다.
#tar xzf ncurses-5.9.tar.gz #cd ncurses-5.9 #./configure --host=arm-none-linux-gnueabi --prefix=/usr/local/lib/ncurses CXX="arm-none-linux-gnueabi-g++" --with-shared #make #make install
에러없이 빌드되었다면, 지정한 위치(/usr/local/lib/ncurses)에 헤더파일과 라이브러리가 생성되었을 것이다.
#tar xzf wpa_supplicant-2.3.tar.gz #cd wpa_supplicant-2.3/wpa_supplicant #cp defconfig .config
앞서 복사한 .config 파일을 수정한다. 여기서 수정한 최종 파일은 config-wpa_supplicant 에서 받을 수 있다.
... # Driver interface for generic Linux wireless extensions # Note: WEXT is deprecated in the current Linux kernel version and no new # functionality is added to it. nl80211-based interface is the new # replacement for WEXT and its use allows wpa_supplicant to properly control # the driver to improve existing functionality like roaming and to support new # functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y # driver_nl80211.c requires libnl. If you are compiling it yourself # you may need to point hostapd to your version of libnl. # #CFLAGS += -I$<path to libnl include files> #LIBS += -L$<path to libnl library files> # Use libnl v2.0 (or 3.0) libraries. #CONFIG_LIBNL20=y # Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) CONFIG_LIBNL32=y // 수정 CFLAGS += -I/usr/local/lib/libnl-arm/include/libnl3 // 추가 LIBS += -L/usr/local/lib/libnl-arm/lib // 추가 # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib #LIBS_p += -L/usr/local/lib #LIBS_c += -L/usr/local/lib ... # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y # Enable WPS external registrar functionality CONFIG_WPS_ER=y # Disable credentials for an open network by default when acting as a WPS # registrar. #CONFIG_WPS_REG_DISABLE_OPEN=y # Enable WPS support with NFC config method CONFIG_WPS_NFC=y ... # Include support for GNU Readline and History Libraries in wpa_cli. # When building a wpa_cli binary for distribution, please note that these # libraries are licensed under GPL and as such, BSD license may not apply for # the resulting binary. CONFIG_READLINE=y # Include internal line edit mode in wpa_cli. This can be used as a replacement # for GNU Readline to provide limited command line editing and history support. CONFIG_WPA_CLI_EDIT=y ... # IEEE 802.11n (High Throughput) support (mainly for AP mode) CONFIG_IEEE80211N=y # IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) # (depends on CONFIG_IEEE80211N) CONFIG_IEEE80211AC=y ... # AP mode operations with wpa_supplicant # This can be used for controlling AP mode operations with wpa_supplicant. It # should be noted that this is mainly aimed at simple cases like # WPA2-Personal while more complex configurations like WPA2-Enterprise with an # external RADIUS server can be supported with hostapd. CONFIG_AP=y # P2P (Wi-Fi Direct) # This can be used to enable P2P support in wpa_supplicant. See README-P2P for # more information on P2P operations. CONFIG_P2P=y # Enable TDLS support CONFIG_TDLS=y # Wi-Fi Direct # This can be used to enable Wi-Fi Direct extensions for P2P using an external # program to control the additional information exchanges in the messages. CONFIG_WIFI_DISPLAY=y ...
크로스 컴파일을 위해 Makefile 을 아래와 같이 수정한다. 최종 수정된 파일은 makefile-wpa_supplicant 에서 받을 수 있다.
CC=/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-gcc // 추가 ifndef CC CC=gcc endif ifndef CFLAGS CFLAGS = -MMD -O2 -Wall -g endif export LIBDIR ?= /usr/local/lib/ export BINDIR ?= /usr/local/sbin/ PKG_CONFIG ?= pkg-config CFLAGS += -I$(abspath ../src) CFLAGS += -I$(abspath ../src/utils) -include .config ifdef CONFIG_TESTING_OPTIONS CFLAGS += -DCONFIG_TESTING_OPTIONS CONFIG_WPS_TESTING=y CONFIG_TDLS_TESTING=y endif CFLAGS += -I/usr/local/lib/openssl-arm/include // 추가 CFLAGS += -I/usr/local/lib/readline/include // 추가 BINALL=wpa_supplicant wpa_cli ifndef CONFIG_NO_WPA_PASSPHRASE BINALL += wpa_passphrase endif ... ... ifeq ($(CONFIG_TLS), openssl) ifdef TLS_FUNCS CFLAGS += -DEAP_TLS_OPENSSL OBJS += ../src/crypto/tls_openssl.o LIBS += -L/usr/local/lib/openssl-arm/lib -lssl // 수정 endif OBJS += ../src/crypto/crypto_openssl.o OBJS_p += ../src/crypto/crypto_openssl.o ifdef NEED_FIPS186_2_PRF OBJS += ../src/crypto/fips_prf_openssl.o endif LIBS += -L/usr/local/lib/openssl-arm/lib -lcrypto // 수정 LIBS_p += -L/usr/local/lib/openssl-arm/lib -lcrypto // 수정 ifdef CONFIG_TLS_ADD_DL LIBS += -ldl LIBS_p += -ldl endif endif ... ... ifdef CONFIG_PCSC # PC/SC interface for smartcards (USIM, GSM SIM) CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC OBJS += ../src/utils/pcsc_funcs.o # -lpthread may not be needed depending on how pcsc-lite was configured ifdef CONFIG_NATIVE_WINDOWS #Once MinGW gets support for WinScard, -lwinscard could be used instead of the #dynamic symbol loading that is now used in pcsc_funcs.c #LIBS += -lwinscard else LIBS += -lpcsclite -lpthread endif endif LIBS += -lpthread -lm // 추가 ifdef CONFIG_SIM_SIMULATOR가 CFLAGS += -DCONFIG_SIM_SIMULATOR NEED_MILENAGE=y endif ... ifdef CONFIG_READLINE OBJS_c += ../src/utils/edit_readline.o LIBS_c += -L/usr/local/lib/readline/lib -lreadline // 추가 LIBS_c += -L/usr/local/lib/ncurses/lib -lncurses // 추가 else ifdef CONFIG_WPA_CLI_EDIT OBJS_c += ../src/utils/edit.o else OBJS_c += ../src/utils/edit_simple.o endif endif ... ... wpa_passphrase: $(OBJS_p) $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) -ldl // 추가 @$(E) " LD " $@ ...
위의 수정사항을 반영했다면, 빌드하자.
#make
에러없이 빌드되었다면, 3개의 바이너리 파일(wpa_supplicant, wpa_cli, wpa_passphrase)이 보일 것이다. 이를 타겟으로 복사한다.
참고로 wpa_cli 의 경우, 실행시 libreadline.so.6 라이브러리 파일을 참조하기 때문에 이것 역시 타겟으로 복사해야 한다.
복사 시에는 아래와 같이 실행한다.
#cp libreadline.so.6.3 /usr/lib #ln -s libreadline.so.6.3 libreadline.so.6
앞서 빌드한 바이너리 파일을 사용하여 기본 WiFi 기능을 확인해본다.
먼저 Driver 와 F/W 를 로딩해야 하는데, 여기서는 각 모드마다 스크립트를 작성하여 차후 실행시 용이하게 한다.
sta() { echo "This is STA start()" insmod /lib/modules/cfg80211.ko insmod /lib/modules/mlan.ko insmod /lib/modules/sd8xxx.ko cfg80211_wext=15 txpwrlimit_cfg=mrvl/txpwrlimit_cfg_w8887_nx1.bin cal_data_cfg=mrvl/WlanCalData_ext.conf drv_mode=7 mac_addr=a0:21:95:12:06:08 fw_name=mrvl/sd8887_uapsta.bin reg_alpha2=00 sleep 1 echo Starting wpa_supplicant... /sdcard/tools/wpa_supplicant -Dnl80211 -imlan0 -c /sdcard/tools/config/wpa.conf -B }
wpa_supplicant 실행을 위해 wpa.conf 파일을 생성하고, 아래를 입력한다.
ap_scan=1 ctrl_interface=/var/run/wpa_supplicant device_name=RTL8192CU manufacturer=Realtek model_name=RTW_STA model_number=WLAN_CU serial_number=12345 device_type=1-0050F204-1 os_version=01020300 config_methods=virtual_display virtual_push_button keypad
그리고, 아래와 같이 실행한다.
#wpa_supplicant -Dnl80211 -i mlan0 -c /etc/wpa_supplicant/wpa.conf
접속 스크립트는 다른 문서를 참고한다.
접속 스크립트는 다른 문서를 참고한다.
P2P 의 경우 앞선 경우와 다르게 추가해야 하는 옵션이 몇가지 있다.
p2p() { echo "This is P2P start()" insmod /lib/modules/cfg80211.ko insmod /lib/modules/mlan.ko insmod /lib/modules/sd8xxx.ko cfg80211_wext=15 txpwrlimit_cfg=mrvl/txpwrlimit_cfg_w8887_nx1.bin cal_data_cfg=mrvl/WlanCalData_ext.conf drv_mode=7 wfd_name=p2p max_vir_bss=1 p2p_enh=1 mac_addr=a0:21:95:12:06:08 fw_name=mrvl/sd8887_uapsta.bin reg_alpha2=00 sleep 1 echo Starting wpa_supplicant... /sdcard/tools/wpa_supplicant -Dnl80211 -ip2p0 -c /sdcard/tools/config/p2p.conf -puse_p2p_group_interface=1 -puse_multi_chan_concurrent=1 -B }
# ./wpa_cli wpa_cli v2.3 Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'p2p0' Interactive mode > > p2p_find 5 // 5 초간 P2P Device 검색 [ 0: 45.662861] I/KERNEL (K 385): wlan: p2p0 START SCAN OK <3>CTRL-EVENT-SCAN-STARTED <3>P2P-DEVICE-FOUND 02:12:36:e5:09:43 p2p_dev_addr=02:12:36:e5:09:43 pri_dev_type=10-0050F204-5 name='MYPHONE (SM-G900K)' config_methods=0x188 dev_capab=0x25 group_capab=0x0 vendor_elems=1 > [ 0: 47.128345] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 47.603683] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 48.066493] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 48.528506] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 48.888495] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 49.350913] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 49.711271] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 50.174084] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 50.636483] I/KERNEL (K 385): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED <3>P2P-FIND-STOPPED > p2p_prov_disc 02:12:36:e5:09:43 pbc // 해당 MAC 디바이스에 pbc 지정 [ 0: 57.942527] I/KERNEL (K 385): wlan: TX P2P Provision Discovery Request, channel=1 OK > [ 0: 57.969725] I/KERNEL (K 372): wlan: RX P2P Provision Discovery Response, channnel=1 <3>P2P-PROV-DISC-PBC-RESP 02:12:36:e5:09:43 > > > p2p_connect 02:12:36:e5:09:43 pbc // 해당 MAC 디바이스로 접속 시도함. 이때 Peer Device(휴대폰) 화면에 접속 여부를 묻는 창이 뜸 // 접속 버튼을 누르면 접속됨 [ 0: 63.182474] I/KERNEL (K 385): Add virtual interface p2p-p2p0-0 OK [ 0: 63.200897] I/KERNEL (K 385): wlan: TX P2P Group Owner Negotiation Req Frame, channel=1 > [ 0: 63.549635] I/KERNEL (K 385): wlan: TX P2P Group Owner Negotiation Req Frame, channel=1 [ 0: 63.590644] I/KERNEL (K 385): wlan: TX P2P Group Owner Negotiation Req Frame, channel=1 [ 0: 63.729147] I/KERNEL (K 372): wlan: RX P2P Group Owner Negotiation Rsp Frame, channel=1 [ 0: 65.713115] I/KERNEL (K 372): wlan: RX P2P Group Owner Negotiation Req Frame, channel=6 [ 0: 65.722982] I/KERNEL (K 385): wlan: TX P2P Group Owner Negotiation Rsp Frame, channel=6 [ 0: 65.746164] I/KERNEL (K 372): wlan: RX P2P Group Owner Negotiation Confirm Frame, channel=6 <3>P2P-GO-NEG-SUCCESS role=client freq=5745 ht40=0 peer_dev=02:12:36:e5:09:43 peer_iface=02:12:36:e5:89[ 0: 65.785696] I/KERNEL (K 385): wlan: p2p-p2p0-0 START SCAN :43 wps_method=PBC <3>CTRL-EVENT-SCAN-RESULTS <3>WPS-AP-AVAILABLE > [ 0: 66.088498] I/KERNEL (K 385): wlan: p2p-p2p0-0 START SCAN [ 0: 66.376118] I/KERNEL (K 385): wlan: Connected to bssid 02:XX:XX:XX:89:43 successfully <3>P2P-GROUP-FORMATION-SUCCESS > > [ 0: 69.580625] I/KERNEL (K 385): wlan: Successfully disconnected from 02:XX:XX:XX:89:43: Reason code 3 st[ 0: 69.818808] I/KERNEL (K 385): wlan: Connected to bssid 02:XX:XX:XX:89:43 successfully <3>P2P-GROUP-STARTED p2p-p2p0-0 client ssid="DIRECT-1q-MYPHONE (SM-G900K)" freq=5745 psk=a5504da71abc7d7403ffbbc3fbf854d44e627d83060feba9734abed8d2310c49 go_dev_addr=02:12:36:e5:09:43 > > > > status wpa_state=DISCONNECTED p2p_device_address=a2:21:95:12:06:08 address=a2:21:95:12:06:08 uuid=e3cee235-259f-5f40-8b08-4a0e760c530c > quit # ./wpa_cli wpa_cli v2.3 Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> a뜸nd contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'p2p-p2p0-0' Interactive mode > status // 접속 확인 bssid=02:12:36:e5:89:43 freq=5745 ssid=DIRECT-1q-MYPHONE (SM-G900K) id=0 mode=station pairwise_cipher=CCMP group_cipher=CCMP key_mgmt=WPA2-PSK wpa_state=COMPLETED p2p_device_address=a2:21:95:12:06:08 address=a2:21:95:12:86:08 uuid=e3cee235-259f-5f40-8b08-4a0e760c530c >
# ./wpa_cli wpa_cli v2.3 Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'p2p0' Interactive mode > > p2p_find 5 // 5초간 P2P 디바이스 검색 OK [ 0: 37.379670] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED <3>P2P-DEVICE-FOUND 02:12:36:e5:09:43 p2p_dev_addr=02:12:36:e5:09:43 pri_dev_type=10-0050F204-5 name='MYPHONE (SM-G900K)' config_methods=0x188 dev_capab=0x25 group_capab=0x0 vendor_elems=1 > [ 0: 38.840687] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 39.315639] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 39.676092] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 40.037391] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 40.404623] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 40.867308] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > [ 0: 41.329363] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > p2p[ 0: 41.586898] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED > p2p_[ 0: 41.946461] I/KERNEL (K 378): wlan: p2p0 START SCAN <3>CTRL-EVENT-SCAN-STARTED <3>P2P-FIND-STOPPED > p2p_prov_disc 02:12:36:e5:09:43 display // 해당 MAC 디바이스를 display 로 설정 [ 0: 48.715208] I/KERNEL (K 378): wlan: TX P2P Provision Discovery Request, channel=1 OK > [ 0: 48.751697] I/KERNEL (K 368): wlan: RX P2P Provision Discovery Response, channnel=1 <3>P2P-PROV-DISC-ENTER-PIN 02:12:36:e5:09:43 > > > p2p_connect 02:12:36:e5:09:43 12345670 display // 해당 MAC 디바이스에서 접속 시, 사용할 PIN 번호(12345670)를 입력하고 접속 시도함 // Peer 디바이스에 PIN 번호를 입력하라는 창이 뜸. 여기서 PIN 번호(12345670)를 입력하면 접속됨 [ 0: 63.634823] I/KERNEL (K 378): Add virtual interface p2p-p2p0-0 OK [ 0: 63.653118] I/KERNEL (K 378): wlan: TX P2P Group Owner Negotiation Req Frame, channel=1 > [ 0: 63.684933] I/KERNEL (K 368): wlan: RX P2P Group Owner Negotiation Rsp Frame, channel=1 [ 0: 69.909104] I/KERNEL (K 368): wlan: RX P2P Group Owner Negotiation Req Frame, channel=6 [ 0: 69.919005] I/KERNEL (K 378): wlan: TX P2P Group Owner Negotiation Rsp Frame, channel=6 [ 0: 69.952997] I/KERNEL (K 368): wlan: RX P2P Group Owner Negotiation Confirm Frame, channel=6 <3>P2P-GO-NEG-SUCCESS role=client freq=5745 ht40=0 peer_dev=02:12:36:e5:09:43 peer_ifac[ 0: 69.992073] I/KERNEL (K 378): wlan: p2p-p2p0-0 START SCAN e=02:12:36:e5:89:43 wps_method=Display <3>CTRL-EVENT-SCAN-RESULTS > [ 0: 70.295015] I/KERNEL (K 378): wlan: p2p-p2p0-0 START SCAN <3>CTRL-EVENT-SCAN-RESULTS <3>WPS-AP-AVAILABLE > [ 0: 70.598838] I/KERNEL (K 378): wlan: p2p-p2p0-0 START SCAN [ 0: 70.888308] I/KERNEL (K 378): wlan: Connected to bssid 02:XX:XX:XX:89:43 successfully <3>P2P-GROUP-FORMATION-SUCCESS > [ 0: 74.092961] I/KERNEL (K 378): wlan: Successfully disconnected from 02:XX:XX:XX:89:43: Reason code 3 [ 0: 74.330504] I/KERNEL (K 378): wlan: Connected to bssid 02:XX:XX:XX:89:43 successfully <3>P2P-GROUP-STARTED p2p-p2p0-0 client ssid="DIRECT-ZF-MYPHONE (SM-G900K)" freq=5745 psk=60b325e21d8f12690998cff2510b032e6496927d19ca6564f7346a5a6c11649c go_dev_addr=02:12:36:e5:09:43 > > > status wpa_state=DISCONNECTED p2p_device_address=a2:21:95:12:06:08 address=a2:21:95:12:06:08 uuid=e3cee235-259f-5f40-8b08-4a0e760c530c > quit [root@drime5 tools]# ./wpa_cli wpa_cli v2.3 Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'p2p-p2p0-0' Interactive mode > status // 접속 확인 bssid=02:12:36:e5:89:43 freq=5745 ssid=DIRECT-ZF-MYPHONE (SM-G900K) id=0 mode=station pairwise_cipher=CCMP group_cipher=CCMP key_mgmt=WPA2-PSK wpa_state=COMPLETED p2p_device_address=a2:21:95:12:06:08 address=a2:21:95:12:86:08 uuid=e3cee235-259f-5f40-8b08-4a0e760c530c >