summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
authormax <max>2003-01-23 02:21:57 (UTC)
committer max <max>2003-01-23 02:21:57 (UTC)
commit5383c984ad15bde0300a6ca4559b0df52fe695b0 (patch) (unidiff)
tree12ac9b23d45e5d8144a952343bbac3fb0cf58899 /noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
parentc464d34970bedca56a518310deef7ce08474033c (diff)
downloadopie-5383c984ad15bde0300a6ca4559b0df52fe695b0.zip
opie-5383c984ad15bde0300a6ca4559b0df52fe695b0.tar.gz
opie-5383c984ad15bde0300a6ca4559b0df52fe695b0.tar.bz2
hostap monitor command
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
index 7362f14..d462488 100644
--- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
+++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
@@ -47,24 +47,31 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype)
47 { 47 {
48 char wlanngcmd[62]; 48 char wlanngcmd[62];
49 snprintf(wlanngcmd, sizeof(wlanngcmd) - 1, "%s %s lnxreq_wlansniff channel=1 enable=true", WLANCTL_PATH, device); 49 snprintf(wlanngcmd, sizeof(wlanngcmd) - 1, "%s %s lnxreq_wlansniff channel=1 enable=true", WLANCTL_PATH, device);
50 if (system(wlanngcmd) != 0) 50 if (system(wlanngcmd) != 0)
51 { 51 {
52 wl_logerr("Could not set %s in raw mode, check cardtype", device); 52 wl_logerr("Could not set %s in raw mode, check cardtype", device);
53 return 0; 53 return 0;
54 } 54 }
55 } 55 }
56 else if (cardtype == CARD_TYPE_HOSTAP) 56 else if (cardtype == CARD_TYPE_HOSTAP)
57 { 57 {
58 wl_logerr("Got a host-ap card, nothing is implemented now"); 58 wl_logerr("Got a host-ap card, nothing is implemented now");
59 char hostapcmd[250];
60 snprintf(hostapcmd, sizeof(hostapcmd) -1, "%s %s monitor 2", IWPRIV_PATH, device);
61 if (system(hostapcmd) !=0)
62 {
63 wl_logerr("Could not set %s in raw mode, check cardtype", device);
64 return 0;
65 }
59 } 66 }
60 67
61 return 1; 68 return 1;
62} 69}
63 70
64/* Set card into promisc mode */ 71/* Set card into promisc mode */
65int card_set_promisc_up (const char *device) 72int card_set_promisc_up (const char *device)
66{ 73{
67 char ifconfigcmd[48]; 74 char ifconfigcmd[48];
68 int retval=0; 75 int retval=0;
69 76
70 snprintf(ifconfigcmd, sizeof(ifconfigcmd) - 1, SBIN_PATH, device); 77 snprintf(ifconfigcmd, sizeof(ifconfigcmd) - 1, SBIN_PATH, device);