author | max <max> | 2002-12-08 16:26:16 (UTC) |
---|---|---|
committer | max <max> | 2002-12-08 16:26:16 (UTC) |
commit | a2840f80792c7e40ee3b44be0ec48302d8816cc0 (patch) (unidiff) | |
tree | 21318df2f9611818f4a0fe501381b19ae753e493 /noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | |
parent | 5fd10ba0772bb87598a3f4fd2e0fff8c3d4dbe43 (diff) | |
download | opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.zip opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.tar.gz opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.tar.bz2 |
macaddress-fix
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/sniff.cc') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc index 81eccab..3c227ab 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | |||
@@ -166,33 +166,48 @@ int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo) | |||
166 | etheraddr_string(mgthdr->da,ppinfo->desthwaddr); | 166 | etheraddr_string(mgthdr->da,ppinfo->desthwaddr); |
167 | etheraddr_string(mgthdr->sa,ppinfo->sndhwaddr); | 167 | etheraddr_string(mgthdr->sa,ppinfo->sndhwaddr); |
168 | ppinfo->fc_wep = FC_WEP(mgthdr->fc); | 168 | ppinfo->fc_wep = FC_WEP(mgthdr->fc); |
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | void etheraddr_string(register const u_char *ep, char *text) | 173 | void etheraddr_string(register const u_char *ep, char *text) |
174 | { | 174 | { |
175 | static char hex[] = "0123456789abcdef"; | 175 | static char hex[] = "0123456789abcdef"; |
176 | register unsigned int i, j; | 176 | register unsigned int i, j; |
177 | register char *cp; | 177 | register char *cp; |
178 | char buf[sizeof("00:00:00:00:00:00")]; | 178 | char buf[sizeof("00:00:00:00:00:00\0")]; |
179 | cp = buf; | 179 | cp = buf; |
180 | if ((j = *ep >> 4) != 0) | 180 | if ((j = *ep >> 4) != 0) |
181 | { | ||
181 | *cp++ = hex[j]; | 182 | *cp++ = hex[j]; |
183 | } | ||
184 | else | ||
185 | { | ||
186 | *cp++ = '0'; | ||
187 | } | ||
182 | *cp++ = hex[*ep++ & 0xf]; | 188 | *cp++ = hex[*ep++ & 0xf]; |
183 | for (i = 5; (int)--i >= 0;) { | 189 | |
190 | for (i = 5; (int)--i >= 0;) | ||
191 | { | ||
184 | *cp++ = ':'; | 192 | *cp++ = ':'; |
185 | if ((j = *ep >> 4) != 0) | 193 | if ((j = *ep >> 4) != 0) |
194 | { | ||
186 | *cp++ = hex[j]; | 195 | *cp++ = hex[j]; |
196 | } | ||
197 | else | ||
198 | { | ||
199 | *cp++ = '0'; | ||
200 | } | ||
201 | |||
187 | *cp++ = hex[*ep++ & 0xf]; | 202 | *cp++ = hex[*ep++ & 0xf]; |
188 | } | 203 | } |
189 | *cp = '\0'; | 204 | *cp = '\0'; |
190 | strcpy(text,buf); | 205 | strcpy(text,buf); |
191 | } | 206 | } |
192 | 207 | ||
193 | /* beacon handler */ | 208 | /* beacon handler */ |
194 | int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo) | 209 | int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo) |
195 | { | 210 | { |
196 | struct mgmt_body_t pbody; | 211 | struct mgmt_body_t pbody; |
197 | int offset = 0; | 212 | int offset = 0; |
198 | 213 | ||