Esempio n. 1
0
void read_mgt(struct params *p, struct ieee80211_frame *wh, int len)
{
	switch (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) {
	case IEEE80211_FC0_SUBTYPE_PROBE_REQ:
		read_preq(p, wh, len);
		break;
		
	case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
		break;

	case IEEE80211_FC0_SUBTYPE_AUTH:
		read_auth(p, wh, len);
		break;

	case IEEE80211_FC0_SUBTYPE_ASSOC_REQ:
		read_assoc(p, wh, len);
		break;

	case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
	case IEEE80211_FC0_SUBTYPE_BEACON:
		break;

	default:
		printf("wtf %d\n", (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) >>
				   IEEE80211_FC0_SUBTYPE_SHIFT);
		abort();
		break;
	}
}
Esempio n. 2
0
int main(int argc, char **argv)
{

	mygetopt(argc, argv);

	char *auth = read_auth(authfile);
	if (auth == NULL) {
		fprintf(stderr, "Null auth or file not found\n");
		exit(1);
	}

	char *cookie = parse_cookie(gcookie(auth, site));
	if (cookie != NULL) {
		printf("\n%s\n", cookie);

	}

	return 0;

}
Esempio n. 3
0
void auth_update( fd_set *in_set, fd_set *out_set, fd_set *exc_set )
{
  struct auth_data *auth;
  struct auth_data *a_next;

  for ( auth = first_auth; auth; auth = a_next )
  {
    a_next = auth->next;
   /* if ( FD_ISSET(auth->auth_fd, exc_set) )
    {
      FD_CLR(auth->auth_fd, in_set );
      FD_CLR(auth->auth_fd, out_set);
      close(auth->auth_fd);
      free_string(auth->d->user);
      auth->d->user = str_dup("(fd exception)");
      UNLINK(auth, first_auth, last_auth, next, prev);
      PUT_FREE(auth, auth_free);
      continue;
    }*/
    switch(auth->auth_state)
    {
    case AUTH_UNSENT:
      if ( FD_ISSET(auth->auth_fd, out_set) )
        send_auth(auth);
      break;
    case AUTH_SENT:
      if ( FD_ISSET(auth->auth_fd, in_set ) )
        read_auth(auth);
      break;
    case AUTH_RETRY:
      if ( !start_auth(auth->d) )
      {
        UNLINK(auth, first_auth, last_auth, next, prev);
       /* PUT_FREE(auth, auth_free);*/
        continue;
      }
      break;
    }
  }
  return;
}