Skip to content

Instantly share code, notes, and snippets.

@JonnoFTW
Created December 17, 2015 00:55
Show Gist options
  • Save JonnoFTW/4dbf9997e7b665245415 to your computer and use it in GitHub Desktop.
Save JonnoFTW/4dbf9997e7b665245415 to your computer and use it in GitHub Desktop.
Deleting items in airodump
void enqueue_stations() {
struct ST_info *st_cur;
struct ST_info *st_next;
st_cur = G.st_1st;
st_next = NULL;
while(st_cur != NULL)
{
st_next = st_cur->next;
// if we haven't seen the device in the last 10 seconds
// put it on the queue and delete it from the list
if (time(NULL) - st_cur->tlast >= 9) {
// put the station info on the queue
char buffer[256];
strcpy(buffer, "amqp_sendstring localhost 5672 \"\" node-readings-wf ");
char msg_buffer[256];
sprintf(msg_buffer,"%d,%d,%02X:%02X:%02X:%02X:%02X:%02X,wf,%3d",
st_cur->tinit, st_cur->tlast,
st_cur->stmac[0], st_cur->stmac[1],
st_cur->stmac[2], st_cur->stmac[3],
st_cur->stmac[4], st_cur->stmac[5],
st_cur->power);
strcat(buffer, msg_buffer);
system(buffer);
// delete the old station
// link the next cursor of
// the previous station to st_next
if(st_cur->prev == NULL) {
G.st_1st = st_next;
} else if (st_next == NULL) {
st_cur->prev->next = NULL;
} else {
st_cur->prev->next = st_next;
st_next->prev = st_cur->prev;
}
// if(G.manufList)
// free(st_cur->manuf);
// free(st_cur);
}
st_cur = st_next;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment