| 3145 | } |
| 3146 | |
| 3147 | static void |
| 3148 | printrsnie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) |
| 3149 | { |
| 3150 | printf("%s", tag); |
| 3151 | if (verbose) { |
| 3152 | const char *sep; |
| 3153 | int n; |
| 3154 | |
| 3155 | ie += 2, ielen -= 2; |
| 3156 | |
| 3157 | printf("<v%u", LE_READ_2(ie)); |
| 3158 | ie += 2, ielen -= 2; |
| 3159 | |
| 3160 | printf(" mc:%s", rsn_cipher(ie)); |
| 3161 | ie += 4, ielen -= 4; |
| 3162 | |
| 3163 | /* unicast ciphers */ |
| 3164 | n = LE_READ_2(ie); |
| 3165 | ie += 2, ielen -= 2; |
| 3166 | sep = " uc:"; |
| 3167 | for (; n > 0; n--) { |
| 3168 | printf("%s%s", sep, rsn_cipher(ie)); |
| 3169 | ie += 4, ielen -= 4; |
| 3170 | sep = "+"; |
| 3171 | } |
| 3172 | |
| 3173 | /* key management algorithms */ |
| 3174 | n = LE_READ_2(ie); |
| 3175 | ie += 2, ielen -= 2; |
| 3176 | sep = " km:"; |
| 3177 | for (; n > 0; n--) { |
| 3178 | printf("%s%s", sep, rsn_keymgmt(ie)); |
| 3179 | ie += 4, ielen -= 4; |
| 3180 | sep = "+"; |
| 3181 | } |
| 3182 | |
| 3183 | if (ielen > 2) /* optional capabilities */ |
| 3184 | printf(", caps 0x%x", LE_READ_2(ie)); |
| 3185 | /* XXXPMKID */ |
| 3186 | printf(">"); |
| 3187 | } |
| 3188 | } |
| 3189 | |
| 3190 | #define BE_READ_2(p) \ |
| 3191 | ((u_int16_t) \ |
no test coverage detected