diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/wifi-util.c | 150 | ||||
-rw-r--r-- | src/shared/wifi-util.h | 1 |
2 files changed, 151 insertions, 0 deletions
diff --git a/src/shared/wifi-util.c b/src/shared/wifi-util.c index 308da82fce..cf0f562550 100644 --- a/src/shared/wifi-util.c +++ b/src/shared/wifi-util.c @@ -154,3 +154,153 @@ static const char * const nl80211_iftype_table[NUM_NL80211_IFTYPES] = { }; DEFINE_STRING_TABLE_LOOKUP_TO_STRING(nl80211_iftype, enum nl80211_iftype); + +static const char * const nl80211_cmd_table[__NL80211_CMD_AFTER_LAST] = { + [NL80211_CMD_GET_WIPHY] = "get_wiphy", + [NL80211_CMD_SET_WIPHY] = "set_wiphy", + [NL80211_CMD_NEW_WIPHY] = "new_wiphy", + [NL80211_CMD_DEL_WIPHY] = "del_wiphy", + [NL80211_CMD_GET_INTERFACE] = "get_interface", + [NL80211_CMD_SET_INTERFACE] = "set_interface", + [NL80211_CMD_NEW_INTERFACE] = "new_interface", + [NL80211_CMD_DEL_INTERFACE] = "del_interface", + [NL80211_CMD_GET_KEY] = "get_key", + [NL80211_CMD_SET_KEY] = "set_key", + [NL80211_CMD_NEW_KEY] = "new_key", + [NL80211_CMD_DEL_KEY] = "del_key", + [NL80211_CMD_GET_BEACON] = "get_beacon", + [NL80211_CMD_SET_BEACON] = "set_beacon", + [NL80211_CMD_START_AP] = "start_ap", + [NL80211_CMD_STOP_AP] = "stop_ap", + [NL80211_CMD_GET_STATION] = "get_station", + [NL80211_CMD_SET_STATION] = "set_station", + [NL80211_CMD_NEW_STATION] = "new_station", + [NL80211_CMD_DEL_STATION] = "del_station", + [NL80211_CMD_GET_MPATH] = "get_mpath", + [NL80211_CMD_SET_MPATH] = "set_mpath", + [NL80211_CMD_NEW_MPATH] = "new_mpath", + [NL80211_CMD_DEL_MPATH] = "del_mpath", + [NL80211_CMD_SET_BSS] = "set_bss", + [NL80211_CMD_SET_REG] = "set_reg", + [NL80211_CMD_REQ_SET_REG] = "req_set_reg", + [NL80211_CMD_GET_MESH_CONFIG] = "get_mesh_config", + [NL80211_CMD_SET_MESH_CONFIG] = "set_mesh_config", + [NL80211_CMD_SET_MGMT_EXTRA_IE] = "set_mgmt_extra_ie", + [NL80211_CMD_GET_REG] = "get_reg", + [NL80211_CMD_GET_SCAN] = "get_scan", + [NL80211_CMD_TRIGGER_SCAN] = "trigger_scan", + [NL80211_CMD_NEW_SCAN_RESULTS] = "new_scan_results", + [NL80211_CMD_SCAN_ABORTED] = "scan_aborted", + [NL80211_CMD_REG_CHANGE] = "reg_change", + [NL80211_CMD_AUTHENTICATE] = "authenticate", + [NL80211_CMD_ASSOCIATE] = "associate", + [NL80211_CMD_DEAUTHENTICATE] = "deauthenticate", + [NL80211_CMD_DISASSOCIATE] = "disassociate", + [NL80211_CMD_MICHAEL_MIC_FAILURE] = "michael_mic_failure", + [NL80211_CMD_REG_BEACON_HINT] = "reg_beacon_hint", + [NL80211_CMD_JOIN_IBSS] = "join_ibss", + [NL80211_CMD_LEAVE_IBSS] = "leave_ibss", + [NL80211_CMD_TESTMODE] = "testmode", + [NL80211_CMD_CONNECT] = "connect", + [NL80211_CMD_ROAM] = "roam", + [NL80211_CMD_DISCONNECT] = "disconnect", + [NL80211_CMD_SET_WIPHY_NETNS] = "set_wiphy_netns", + [NL80211_CMD_GET_SURVEY] = "get_survey", + [NL80211_CMD_NEW_SURVEY_RESULTS] = "new_survey_results", + [NL80211_CMD_SET_PMKSA] = "set_pmksa", + [NL80211_CMD_DEL_PMKSA] = "del_pmksa", + [NL80211_CMD_FLUSH_PMKSA] = "flush_pmksa", + [NL80211_CMD_REMAIN_ON_CHANNEL] = "remain_on_channel", + [NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL] = "cancel_remain_on_channel", + [NL80211_CMD_SET_TX_BITRATE_MASK] = "set_tx_bitrate_mask", + [NL80211_CMD_REGISTER_FRAME] = "register_frame", + [NL80211_CMD_FRAME] = "frame", + [NL80211_CMD_FRAME_TX_STATUS] = "frame_tx_status", + [NL80211_CMD_SET_POWER_SAVE] = "set_power_save", + [NL80211_CMD_GET_POWER_SAVE] = "get_power_save", + [NL80211_CMD_SET_CQM] = "set_cqm", + [NL80211_CMD_NOTIFY_CQM] = "notify_cqm", + [NL80211_CMD_SET_CHANNEL] = "set_channel", + [NL80211_CMD_SET_WDS_PEER] = "set_wds_peer", + [NL80211_CMD_FRAME_WAIT_CANCEL] = "frame_wait_cancel", + [NL80211_CMD_JOIN_MESH] = "join_mesh", + [NL80211_CMD_LEAVE_MESH] = "leave_mesh", + [NL80211_CMD_UNPROT_DEAUTHENTICATE] = "unprot_deauthenticate", + [NL80211_CMD_UNPROT_DISASSOCIATE] = "unprot_disassociate", + [NL80211_CMD_NEW_PEER_CANDIDATE] = "new_peer_candidate", + [NL80211_CMD_GET_WOWLAN] = "get_wowlan", + [NL80211_CMD_SET_WOWLAN] = "set_wowlan", + [NL80211_CMD_START_SCHED_SCAN] = "start_sched_scan", + [NL80211_CMD_STOP_SCHED_SCAN] = "stop_sched_scan", + [NL80211_CMD_SCHED_SCAN_RESULTS] = "sched_scan_results", + [NL80211_CMD_SCHED_SCAN_STOPPED] = "sched_scan_stopped", + [NL80211_CMD_SET_REKEY_OFFLOAD] = "set_rekey_offload", + [NL80211_CMD_PMKSA_CANDIDATE] = "pmksa_candidate", + [NL80211_CMD_TDLS_OPER] = "tdls_oper", + [NL80211_CMD_TDLS_MGMT] = "tdls_mgmt", + [NL80211_CMD_UNEXPECTED_FRAME] = "unexpected_frame", + [NL80211_CMD_PROBE_CLIENT] = "probe_client", + [NL80211_CMD_REGISTER_BEACONS] = "register_beacons", + [NL80211_CMD_UNEXPECTED_4ADDR_FRAME] = "unexpected_4addr_frame", + [NL80211_CMD_SET_NOACK_MAP] = "set_noack_map", + [NL80211_CMD_CH_SWITCH_NOTIFY] = "ch_switch_notify", + [NL80211_CMD_START_P2P_DEVICE] = "start_p2p_device", + [NL80211_CMD_STOP_P2P_DEVICE] = "stop_p2p_device", + [NL80211_CMD_CONN_FAILED] = "conn_failed", + [NL80211_CMD_SET_MCAST_RATE] = "set_mcast_rate", + [NL80211_CMD_SET_MAC_ACL] = "set_mac_acl", + [NL80211_CMD_RADAR_DETECT] = "radar_detect", + [NL80211_CMD_GET_PROTOCOL_FEATURES] = "get_protocol_features", + [NL80211_CMD_UPDATE_FT_IES] = "update_ft_ies", + [NL80211_CMD_FT_EVENT] = "ft_event", + [NL80211_CMD_CRIT_PROTOCOL_START] = "crit_protocol_start", + [NL80211_CMD_CRIT_PROTOCOL_STOP] = "crit_protocol_stop", + [NL80211_CMD_GET_COALESCE] = "get_coalesce", + [NL80211_CMD_SET_COALESCE] = "set_coalesce", + [NL80211_CMD_CHANNEL_SWITCH] = "channel_switch", + [NL80211_CMD_VENDOR] = "vendor", + [NL80211_CMD_SET_QOS_MAP] = "set_qos_map", + [NL80211_CMD_ADD_TX_TS] = "add_tx_ts", + [NL80211_CMD_DEL_TX_TS] = "del_tx_ts", + [NL80211_CMD_GET_MPP] = "get_mpp", + [NL80211_CMD_JOIN_OCB] = "join_ocb", + [NL80211_CMD_LEAVE_OCB] = "leave_ocb", + [NL80211_CMD_CH_SWITCH_STARTED_NOTIFY] = "ch_switch_started_notify", + [NL80211_CMD_TDLS_CHANNEL_SWITCH] = "tdls_channel_switch", + [NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH] = "tdls_cancel_channel_switch", + [NL80211_CMD_WIPHY_REG_CHANGE] = "wiphy_reg_change", + [NL80211_CMD_ABORT_SCAN] = "abort_scan", + [NL80211_CMD_START_NAN] = "start_nan", + [NL80211_CMD_STOP_NAN] = "stop_nan", + [NL80211_CMD_ADD_NAN_FUNCTION] = "add_nan_function", + [NL80211_CMD_DEL_NAN_FUNCTION] = "del_nan_function", + [NL80211_CMD_CHANGE_NAN_CONFIG] = "change_nan_config", + [NL80211_CMD_NAN_MATCH] = "nan_match", + [NL80211_CMD_SET_MULTICAST_TO_UNICAST] = "set_multicast_to_unicast", + [NL80211_CMD_UPDATE_CONNECT_PARAMS] = "update_connect_params", + [NL80211_CMD_SET_PMK] = "set_pmk", + [NL80211_CMD_DEL_PMK] = "del_pmk", + [NL80211_CMD_PORT_AUTHORIZED] = "port_authorized", + [NL80211_CMD_RELOAD_REGDB] = "reload_regdb", + [NL80211_CMD_EXTERNAL_AUTH] = "external_auth", + [NL80211_CMD_STA_OPMODE_CHANGED] = "sta_opmode_changed", + [NL80211_CMD_CONTROL_PORT_FRAME] = "control_port_frame", + [NL80211_CMD_GET_FTM_RESPONDER_STATS] = "get_ftm_responder_stats", + [NL80211_CMD_PEER_MEASUREMENT_START] = "peer_measurement_start", + [NL80211_CMD_PEER_MEASUREMENT_RESULT] = "peer_measurement_result", + [NL80211_CMD_PEER_MEASUREMENT_COMPLETE] = "peer_measurement_complete", + [NL80211_CMD_NOTIFY_RADAR] = "notify_radar", + [NL80211_CMD_UPDATE_OWE_INFO] = "update_owe_info", + [NL80211_CMD_PROBE_MESH_LINK] = "probe_mesh_link", + [NL80211_CMD_SET_TID_CONFIG] = "set_tid_config", + [NL80211_CMD_UNPROT_BEACON] = "unprot_beacon", + [NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS] = "control_port_frame_tx_status", + [NL80211_CMD_SET_SAR_SPECS] = "set_sar_specs", + [NL80211_CMD_OBSS_COLOR_COLLISION] = "obss_color_collision", + [NL80211_CMD_COLOR_CHANGE_REQUEST] = "color_change_request", + [NL80211_CMD_COLOR_CHANGE_STARTED] = "color_change_started", + [NL80211_CMD_COLOR_CHANGE_ABORTED] = "color_change_aborted", + [NL80211_CMD_COLOR_CHANGE_COMPLETED] = "color_change_completed", +}; + +DEFINE_STRING_TABLE_LOOKUP_TO_STRING(nl80211_cmd, int); diff --git a/src/shared/wifi-util.h b/src/shared/wifi-util.h index 332097c348..8afd1a4ec3 100644 --- a/src/shared/wifi-util.h +++ b/src/shared/wifi-util.h @@ -12,3 +12,4 @@ int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *ret_i int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *ret_bssid); const char *nl80211_iftype_to_string(enum nl80211_iftype iftype) _const_; +const char *nl80211_cmd_to_string(int cmd) _const_; |