cybersecurity · intermediate · ~15 min · safe pentest lab

802.11 frame type

Extract a bitfield from a control byte.

Challenge

In the 802.11 Frame Control field, the type is bits 2-3 of the first byte. Implement int frame_type(unsigned char fc0) returning (fc0 >> 2) & 0x3.

Starter code

int frame_type(unsigned char fc0) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.