コード例 #1
0
ファイル: wesside-ng.c プロジェクト: 0x90/aircrack-ng
static void stuff_for_us(struct wstate *ws, struct ieee80211_frame* wh, int len)
{
	int type,stype;
	unsigned char *body = (unsigned char*) (wh+1);

	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
	stype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;

	// CTL
	if (type == IEEE80211_FC0_TYPE_CTL) {
		proc_ctl(ws, stype);
		return;
	}

	// MGM
	if (type == IEEE80211_FC0_TYPE_MGT) {
		proc_mgt(ws, stype, body);
		return;
	}

	/* Data */
	if (type == IEEE80211_FC0_TYPE_DATA &&
	    stype == IEEE80211_FC0_SUBTYPE_DATA) {
		proc_data(ws, wh, len);
		return;
	}

#if 0
	printf ("Got frame for us (type=%x stype=%x) from=(%s) len=%d\n",
		type, stype, mac2str(wh->i_addr2), len);
#endif
}
コード例 #2
0
ファイル: process.c プロジェクト: vikrum/introspective
void
proc_currentidentifier(void) {

    char *buffer;

    if(current_function_n == NULL) {
        if((buffer = (char *)malloc(strlen("global") + 1)) == NULL) {
            perror("handle_open_bracket/malloc()");
            exit(-1);
        }
        strcat(buffer, "global");
        current_function_n = buffer;
    }

    if(current_function_t == NULL) {
        if((buffer = (char *)malloc(strlen("extern") + 1)) == NULL) {
            perror("handle_open_bracket/malloc()");
            exit(-1);
        }
        strcat(buffer, "extern");
        current_function_t = buffer;
    }

    if(current_identifier == NULL) {
#ifdef DEBUG
        printf("DEBUG:  caught %s in %s %s()\n",
               current_datatype, current_function_t,
               current_function_n);
#endif
        current_datatype = NULL;
    }
    else {
        proc_data(line_count, current_datatype, pointer_to_datatype,
                  current_identifier, current_function_t,
                  current_function_n);
#ifdef VDEBUG
        printf("%d %s%s %s in %s %s()\n", line_count,
               current_datatype,
               ((pointer_to_datatype) ? "*" : ""),
               current_identifier, current_function_t,
               current_function_n);
#endif
        if( (stor_count % (MEMINCR - 2))  == 0 ) {
            if ( (userdef = (char **)realloc((void *)userdef,
                                             (user_count + MEMINCR) * sizeof(char *))) == NULL) {
                perror("proc_currenttype/realloc()");
                exit(-1);
            }
        }
        storage[stor_count++] = current_identifier;
        current_identifier = NULL;
        pointer_to_datatype = 0;
    }
    return;
};