mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
common: Add function to get an operating class by its number and country
Add a function to get operating class definition (including bandwidth, channel numbers, etc.) from the operating class number and country. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
This commit is contained in:
parent
e4f1d879cd
commit
c9ff8e5f6e
@ -1576,3 +1576,21 @@ u8 country_to_global_op_class(const char *country, u8 op_class)
|
||||
*/
|
||||
return g_op_class ? g_op_class : op_class;
|
||||
}
|
||||
|
||||
|
||||
const struct oper_class_map * get_oper_class(const char *country, u8 op_class)
|
||||
{
|
||||
const struct oper_class_map *op;
|
||||
|
||||
if (country)
|
||||
op_class = country_to_global_op_class(country, op_class);
|
||||
|
||||
op = &global_op_class[0];
|
||||
while (op->op_class && op->op_class != op_class)
|
||||
op++;
|
||||
|
||||
if (!op->op_class)
|
||||
return NULL;
|
||||
|
||||
return op;
|
||||
}
|
||||
|
@ -184,4 +184,6 @@ struct country_op_class {
|
||||
|
||||
u8 country_to_global_op_class(const char *country, u8 op_class);
|
||||
|
||||
const struct oper_class_map * get_oper_class(const char *country, u8 op_class);
|
||||
|
||||
#endif /* IEEE802_11_COMMON_H */
|
||||
|
Loading…
Reference in New Issue
Block a user