diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index ac64f9939..a8d68e5e6 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -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; +} diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index bfe6bd4f1..966eeac84 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -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 */