[問題] linux取得ssid
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
linux
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
如何用c/c++取得ssid的資訊
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
類似像取得ip address一樣,可以利用ioctl取得
struct ifreq ifr;
ioctl(s, SIOCGIFADDR, (char *)&ifr)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.120.158.204
推
03/11 12:54, , 1F
03/11 12:54, 1F
→
03/11 12:55, , 2F
03/11 12:55, 2F
→
03/11 12:56, , 3F
03/11 12:56, 3F
我本來想說,如果沒有現成的ioctl的話,就真的要靠stdout來做了
不過後來有在網路上找到get ssid的code http://www.vi1129.com/tag/ioctl/
但我是include <iwlib.h>,謝謝~
※ 編輯: watershed 來自: 59.120.158.204 (03/11 16:10)
如果沒有這份檔的話,還可以使用
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/wireless.h>
※ 編輯: watershed 來自: 59.120.158.204 (03/11 18:29)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章