wificurse

wifi jamming tool
git clone git://git.2f30.org/wificurse
Log | Files | Refs | README | LICENSE

commit ed764ef65209e979b0d7fb552c883648e6e7b017
parent 2ae5fb0b95224b7a93fd6e3f1ca8f76eaab2a53b
Author: oblique <psyberbits@gmail.com>
Date:   Sat,  3 Mar 2012 06:07:51 +0200

clear deauth flag after changing channel

Diffstat:
Mconsole.c | 19++++++++++++++-----
Mconsole.h | 3++-
Mwificurse.c | 1+
3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/console.c b/console.c @@ -70,12 +70,22 @@ int add_or_update_ap(struct ap_list *apl, uint8_t *bssid) { } ap->last_beacon_tm = time(NULL); - ap->dosing = 1; + ap->deauth = 1; ap->num_of_deauth++; return 0; } +void clear_deauth(struct ap_list *apl) { + struct access_point *ap; + + ap = apl->head; + while (ap != NULL) { + ap->deauth = 0; + ap = ap->next; + } +} + void unlink_ap(struct ap_list *apl, struct access_point *ap) { if (ap->prev) ap->prev->next = ap->next; @@ -97,8 +107,8 @@ void update_scr(struct ap_list *apl, struct dev *dev) { /* move cursor at colum 1 row 1 */ printf("\033[1;1H"); - printf("[ Channel: %3d ]\n\n", dev->chan); + printf("[ Channel: %3d ]\n\n", dev->chan); printf("Deauth BSSID Number of Deauth\n\n"); ap = apl->head; @@ -110,10 +120,9 @@ void update_scr(struct ap_list *apl, struct dev *dev) { free(tmp); continue; } - if (ap->dosing) { + if (ap->deauth) printf(RED_COLOR("*")); - ap->dosing = 0; - } else + else printf(" "); printf(" %02x:%02x:%02x:%02x:%02x:%02x", ap->bssid[0], ap->bssid[1], ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5]); diff --git a/console.h b/console.h @@ -27,7 +27,7 @@ struct access_point { - int dosing; + int deauth; unsigned int num_of_deauth; time_t last_beacon_tm; uint8_t bssid[IFHWADDRLEN]; @@ -44,6 +44,7 @@ struct ap_list { void init_ap_list(struct ap_list *apl); int add_or_update_ap(struct ap_list *apl, uint8_t *bssid); void unlink_ap(struct ap_list *apl, struct access_point *ap); +void clear_deauth(struct ap_list *apl); void clear_scr(); void update_scr(struct ap_list *apl, struct dev *dev); diff --git a/wificurse.c b/wificurse.c @@ -202,6 +202,7 @@ int main(int argc, char *argv[]) { print_error(); goto _errout; } + clear_deauth(&apl); update_scr(&apl, &dev); tm1 = time(NULL); }