]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
make commands array easier to handle
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 18 Feb 2010 10:54:53 +0000 (11:54 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Thu, 18 Feb 2010 10:54:53 +0000 (11:54 +0100)
util.c

diff --git a/util.c b/util.c
index fae3d080bb34c1baf355aba550f869da1b9e8b84..3cb77038fe4f9433e281e3679f098d256ad11d64 100644 (file)
--- a/util.c
+++ b/util.c
@@ -70,56 +70,64 @@ const char *iftype_name(enum nl80211_iftype iftype)
 }
 
 static const char *commands[NL80211_CMD_MAX + 1] = {
-       "unspecified",
-       "get_wiphy",
-       "set_wiphy",
-       "new_wiphy",
-       "del_wiphy",
-       "get_interface",
-       "set_interface",
-       "new_interface",
-       "del_interface",
-       "get_key",
-       "set_key",
-       "new_key",
-       "del_key",
-       "get_beacon",
-       "set_beacon",
-       "new_beacon",
-       "del_beacon",
-       "get_station",
-       "set_station",
-       "new_station",
-       "del_station",
-       "get_mpath",
-       "set_mpath",
-       "new_mpath",
-       "del_mpath",
-       "set_bss",
-       "set_reg",
-       "reg_set_reg",
-       "get_mesh_params",
-       "set_mesh_params",
-       "set_mgmt_extra_ie",
-       "get_reg",
-       "get_scan",
-       "trigger_scan",
-       "new_scan_results",
-       "scan_aborted",
-       "reg_change",
-       "authenticate",
-       "associate",
-       "deauthenticate",
-       "disassociate",
-       "michael_mic_failure",
-       "reg_beacon_hint",
-       "join_ibss",
-       "leave_ibss",
-       "testmode",
-       "connect",
-       "roam",
-       "disconnect",
-       "set_wiphy_netns"
+       [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_NEW_BEACON] = "new_beacon",
+       [NL80211_CMD_DEL_BEACON] = "del_beacon",
+       [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] = "reg_set_reg",
+       [NL80211_CMD_GET_MESH_PARAMS] = "get_mesh_params",
+       [NL80211_CMD_SET_MESH_PARAMS] = "set_mesh_params",
+       [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_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_ACTION] = "register_action",
+       [NL80211_CMD_ACTION] = "action",
 };
 
 static char cmdbuf[100];