author | mjm <mjm> | 2002-12-14 19:13:32 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-12-14 19:13:32 (UTC) |
commit | d9d4e587e62eac418b892c90145e958d6495d081 (patch) (unidiff) | |
tree | 6a554548d6dfaaa082f4b088f8912f4c5fc7e528 | |
parent | 57918323f3b2e1377d9cf97ed6466e31b260d24a (diff) | |
download | opie-d9d4e587e62eac418b892c90145e958d6495d081.zip opie-d9d4e587e62eac418b892c90145e958d6495d081.tar.gz opie-d9d4e587e62eac418b892c90145e958d6495d081.tar.bz2 |
code cleanup, possible bug in sniff.cc fixed
4 files changed, 11 insertions, 18 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc index a1c3945..3aaa4a7 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | |||
@@ -4,8 +4,9 @@ | |||
4 | * $Id$ | 4 | * $Id$ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "cardmode.hh" | 7 | #include "cardmode.hh" |
8 | #include "log.hh" | ||
8 | 9 | ||
9 | /* main card into monitor function */ | 10 | /* main card into monitor function */ |
10 | int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | 11 | int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) |
11 | { | 12 | { |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh index fad74cf..7c6a21d 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh | |||
@@ -15,10 +15,8 @@ extern "C" | |||
15 | #include <net/bpf.h> | 15 | #include <net/bpf.h> |
16 | #include <pcap.h> | 16 | #include <pcap.h> |
17 | } | 17 | } |
18 | 18 | ||
19 | #include "../../libwellenreiter/source/log.hh" | ||
20 | |||
21 | /* Defines, used for the card setup */ | 19 | /* Defines, used for the card setup */ |
22 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" | 20 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" |
23 | #define CARD_TYPE_CISCO1 | 21 | #define CARD_TYPE_CISCO1 |
24 | #define CARD_TYPE_NG 2 | 22 | #define CARD_TYPE_NG 2 |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc index 305f401..2ec23f4 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc | |||
@@ -55,17 +55,16 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
55 | snprintf(temp, 4, "0%d", ptr->ssid_len); | 55 | snprintf(temp, 4, "0%d", ptr->ssid_len); |
56 | 56 | ||
57 | memcpy(buffer + 23, temp, 3); | 57 | memcpy(buffer + 23, temp, 3); |
58 | 58 | ||
59 | fprintf( stderr, "Temp is %s\n", temp ); | ||
60 | fprintf( stderr, "ssid_len is %d\n", ptr->ssid_len ); | ||
61 | |||
62 | /* Set ssid */ | 59 | /* Set ssid */ |
63 | memcpy(buffer + 26, ptr->bssid, ptr->ssid_len); | 60 | memcpy(buffer + 26, ptr->bssid, ptr->ssid_len); |
64 | 61 | ||
65 | fprintf( stderr, "Buffer is %s\n", buffer ); | ||
66 | |||
67 | /* Send prepared buffer to GUI */ | 62 | /* Send prepared buffer to GUI */ |
63 | #ifdef DEBUG | ||
64 | wl_loginfo("Sending network to GUI: '%s'", buffer); | ||
65 | #endif | ||
66 | |||
68 | sendcomm(guihost, guiport, buffer); | 67 | sendcomm(guihost, guiport, buffer); |
69 | 68 | ||
70 | return 1; | 69 | return 1; |
71 | } | 70 | } |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc index 84caf12..c703052 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | |||
@@ -93,10 +93,8 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack | |||
93 | pinfoptr->isvalid = 0; | 93 | pinfoptr->isvalid = 0; |
94 | return; | 94 | return; |
95 | } | 95 | } |
96 | 96 | ||
97 | printf( "cap_ESS is %d, cap_IBSS is %d\n", pinfoptr->cap_ESS, pinfoptr->cap_IBSS ); | ||
98 | |||
99 | /* Here should be the infos to the gui issued */ | 97 | /* Here should be the infos to the gui issued */ |
100 | if (pinfoptr->cap_ESS == 1 &&pinfoptr->cap_IBSS ==0) | 98 | if (pinfoptr->cap_ESS == 1 &&pinfoptr->cap_IBSS ==0) |
101 | { | 99 | { |
102 | wl_loginfo("Found an access point"); | 100 | wl_loginfo("Found an access point"); |
@@ -106,17 +104,16 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack | |||
106 | { | 104 | { |
107 | wl_loginfo("Found an ad-hoc network"); | 105 | wl_loginfo("Found an ad-hoc network"); |
108 | wl_net.net_type=2; | 106 | wl_net.net_type=2; |
109 | } | 107 | } |
108 | |||
110 | if (strcmp (pinfoptr->ssid,NONBROADCASTING) ==0) | 109 | if (strcmp (pinfoptr->ssid,NONBROADCASTING) ==0) |
111 | { | ||
112 | wl_loginfo("Net is a non-broadcasting network"); | 110 | wl_loginfo("Net is a non-broadcasting network"); |
113 | } | ||
114 | else | 111 | else |
115 | { | ||
116 | wl_loginfo("SSID is: %s", pinfoptr->ssid); | 112 | wl_loginfo("SSID is: %s", pinfoptr->ssid); |
117 | // wl_net.bssid=pinfoptr->ssid; | 113 | |
118 | } | 114 | wl_loginfo("SSID is: %s", pinfoptr->ssid); |
115 | memcpy(wl_net.bssid, pinfoptr->ssid, sizeof(wl_net.bssid)-1); | ||
119 | 116 | ||
120 | wl_loginfo("SSID length is: %d", pinfoptr->ssid_len); | 117 | wl_loginfo("SSID length is: %d", pinfoptr->ssid_len); |
121 | wl_net.ssid_len=pinfoptr->ssid_len; | 118 | wl_net.ssid_len=pinfoptr->ssid_len; |
122 | 119 | ||
@@ -125,16 +122,14 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack | |||
125 | wl_net.wep=pinfoptr->cap_WEP; | 122 | wl_net.wep=pinfoptr->cap_WEP; |
126 | 123 | ||
127 | wl_loginfo("Mac is: %s", pinfoptr->sndhwaddr); | 124 | wl_loginfo("Mac is: %s", pinfoptr->sndhwaddr); |
128 | memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);; | 125 | memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);; |
129 | wl_loginfo("SSID is: %s", pinfoptr->ssid); | 126 | |
130 | memcpy(wl_net.bssid, pinfoptr->ssid, sizeof(wl_net.bssid)-1); | ||
131 | |||
132 | // printf ("\n\tDest : %s\n",pinfoptr->desthwaddr); | ||
133 | send_network_found((char *)guihost, guiport, &wl_net); | 127 | send_network_found((char *)guihost, guiport, &wl_net); |
134 | wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); | 128 | wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); |
135 | } | 129 | } |
136 | break; | 130 | break; |
131 | |||
137 | default: | 132 | default: |
138 | wl_logerr("Unknown IEEE802.11 frame subtype (%d)", FC_SUBTYPE(fc)); | 133 | wl_logerr("Unknown IEEE802.11 frame subtype (%d)", FC_SUBTYPE(fc)); |
139 | break; | 134 | break; |
140 | } /* End of switch over different mgt frame types */ | 135 | } /* End of switch over different mgt frame types */ |