eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

nl80211cmd.c (8459B)


      1 /*
      2  *
      3  *  Wireless daemon for Linux
      4  *
      5  *  Copyright (C) 2019 Intel Corporation. All rights reserved.
      6  *
      7  *  This library is free software; you can redistribute it and/or
      8  *  modify it under the terms of the GNU Lesser General Public
      9  *  License as published by the Free Software Foundation; either
     10  *  version 2.1 of the License, or (at your option) any later version.
     11  *
     12  *  This library is distributed in the hope that it will be useful,
     13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15  *  Lesser General Public License for more details.
     16  *
     17  *  You should have received a copy of the GNU Lesser General Public
     18  *  License along with this library; if not, write to the Free Software
     19  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20  *
     21  */
     22 
     23 #ifdef HAVE_CONFIG_H
     24 #include <config.h>
     25 #endif
     26 
     27 #include <stdint.h>
     28 
     29 #include "linux/nl80211.h"
     30 #include "src/nl80211cmd.h"
     31 
     32 static const struct {
     33 	uint8_t cmd;
     34 	const char *str;
     35 } cmd_table[] = {
     36 	{ NL80211_CMD_GET_WIPHY,		"Get Wiphy"		},
     37 	{ NL80211_CMD_SET_WIPHY,		"Set Wiphy"		},
     38 	{ NL80211_CMD_NEW_WIPHY,		"New Wiphy"		},
     39 	{ NL80211_CMD_DEL_WIPHY,		"Del Wiphy"		},
     40 	{ NL80211_CMD_GET_INTERFACE,		"Get Interface"		},
     41 	{ NL80211_CMD_SET_INTERFACE,		"Set Interface"		},
     42 	{ NL80211_CMD_NEW_INTERFACE,		"New Interface"		},
     43 	{ NL80211_CMD_DEL_INTERFACE,		"Del Interface"		},
     44 	{ NL80211_CMD_GET_KEY,			"Get Key"		},
     45 	{ NL80211_CMD_SET_KEY,			"Set Key"		},
     46 	{ NL80211_CMD_NEW_KEY,			"New Key"		},
     47 	{ NL80211_CMD_DEL_KEY,			"Del Key"		},
     48 	{ NL80211_CMD_GET_BEACON,		"Get Beacon"		},
     49 	{ NL80211_CMD_SET_BEACON,		"Set Beacon"		},
     50 	{ NL80211_CMD_START_AP,			"Start AP"		},
     51 	{ NL80211_CMD_STOP_AP,			"Stop AP"		},
     52 	{ NL80211_CMD_GET_STATION,		"Get Station"		},
     53 	{ NL80211_CMD_SET_STATION,		"Set Station"		},
     54 	{ NL80211_CMD_NEW_STATION,		"New Station"		},
     55 	{ NL80211_CMD_DEL_STATION,		"Del Station"		},
     56 	{ NL80211_CMD_GET_MPATH,		"Get Mesh Path"		},
     57 	{ NL80211_CMD_SET_MPATH,		"Set Mesh Path"		},
     58 	{ NL80211_CMD_NEW_MPATH,		"New Mesh Path"		},
     59 	{ NL80211_CMD_DEL_MPATH,		"Del Mesh Path"		},
     60 	{ NL80211_CMD_SET_BSS,			"Set BSS"		},
     61 	{ NL80211_CMD_SET_REG,			"Set Reg"		},
     62 	{ NL80211_CMD_REQ_SET_REG,		"Req Set Reg"		},
     63 	{ NL80211_CMD_GET_MESH_CONFIG,		"Get Mesh Config"	},
     64 	{ NL80211_CMD_SET_MESH_CONFIG,		"Set Mesh Config"	},
     65 	{ NL80211_CMD_SET_MGMT_EXTRA_IE,	"Mgmt Extra IE"		},
     66 	{ NL80211_CMD_GET_REG,			"Get Reg"		},
     67 	{ NL80211_CMD_GET_SCAN,			"Get Scan"		},
     68 	{ NL80211_CMD_TRIGGER_SCAN,		"Trigger Scan"		},
     69 	{ NL80211_CMD_NEW_SCAN_RESULTS,		"New Scan Results"	},
     70 	{ NL80211_CMD_SCAN_ABORTED,		"Scan Aborted"		},
     71 	{ NL80211_CMD_REG_CHANGE,		"Reg Change"		},
     72 	{ NL80211_CMD_AUTHENTICATE,		"Authenticate"		},
     73 	{ NL80211_CMD_ASSOCIATE,		"Associate"		},
     74 	{ NL80211_CMD_DEAUTHENTICATE,		"Deauthenticate"	},
     75 	{ NL80211_CMD_DISASSOCIATE,		"Disassociate"		},
     76 	{ NL80211_CMD_MICHAEL_MIC_FAILURE,	"Michael MIC Failure"	},
     77 	{ NL80211_CMD_REG_BEACON_HINT,		"Reg Beacon Hint"	},
     78 	{ NL80211_CMD_JOIN_IBSS,		"Join IBSS"		},
     79 	{ NL80211_CMD_LEAVE_IBSS,		"Leave IBSS"		},
     80 	{ NL80211_CMD_TESTMODE,			"Test Mode"		},
     81 	{ NL80211_CMD_CONNECT,			"Connect"		},
     82 	{ NL80211_CMD_ROAM,			"Roam"			},
     83 	{ NL80211_CMD_DISCONNECT,		"Disconnect"		},
     84 	{ NL80211_CMD_SET_WIPHY_NETNS,		"Set Wiphy Netns"	},
     85 	{ NL80211_CMD_GET_SURVEY,		"Get Survey"		},
     86 	{ NL80211_CMD_NEW_SURVEY_RESULTS,	"New Survey Results"	},
     87 	{ NL80211_CMD_SET_PMKSA,		"Set PMKSA"		},
     88 	{ NL80211_CMD_DEL_PMKSA,		"Del PMKSA"		},
     89 	{ NL80211_CMD_FLUSH_PMKSA,		"Flush PMKSA"		},
     90 	{ NL80211_CMD_REMAIN_ON_CHANNEL,	"Remain on Channel"	},
     91 	{ NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,	"Cancel Remain on Channel"},
     92 	{ NL80211_CMD_SET_TX_BITRATE_MASK,	"Set TX Bitrate Mask"	},
     93 	{ NL80211_CMD_REGISTER_FRAME,		"Register Frame"	},
     94 	{ NL80211_CMD_FRAME,			"Frame"			},
     95 	{ NL80211_CMD_FRAME_TX_STATUS,		"Frame TX Status"	},
     96 	{ NL80211_CMD_SET_POWER_SAVE,		"Set Power Save"	},
     97 	{ NL80211_CMD_GET_POWER_SAVE,		"Get Power Save"	},
     98 	{ NL80211_CMD_SET_CQM,			"Set CQM"		},
     99 	{ NL80211_CMD_NOTIFY_CQM,		"Notify CQM"		},
    100 	{ NL80211_CMD_SET_CHANNEL,		"Set Channel"		},
    101 	{ NL80211_CMD_SET_WDS_PEER,		"Set WDS Peer"		},
    102 	{ NL80211_CMD_FRAME_WAIT_CANCEL,	"Frame Wait Cancel"	},
    103 	{ NL80211_CMD_JOIN_MESH,		"Join Mesh"		},
    104 	{ NL80211_CMD_LEAVE_MESH,		"Leave Mesh"		},
    105 	{ NL80211_CMD_UNPROT_DEAUTHENTICATE,	"Unprot Deauthenticate"	},
    106 	{ NL80211_CMD_UNPROT_DISASSOCIATE,	"Unprot Disassociate"	},
    107 	{ NL80211_CMD_NEW_PEER_CANDIDATE,	"New Peer Candidate"	},
    108 	{ NL80211_CMD_GET_WOWLAN,		"Get WoWLAN"		},
    109 	{ NL80211_CMD_SET_WOWLAN,		"Set WoWLAN"		},
    110 	{ NL80211_CMD_START_SCHED_SCAN,		"Start Sched Scan"	},
    111 	{ NL80211_CMD_STOP_SCHED_SCAN,		"Stop Sched Scan"	},
    112 	{ NL80211_CMD_SCHED_SCAN_RESULTS,	"Sched Scan Results"	},
    113 	{ NL80211_CMD_SCHED_SCAN_STOPPED,	"Sched Scan Stopped"	},
    114 	{ NL80211_CMD_SET_REKEY_OFFLOAD,	"Set Rekey Offload"	},
    115 	{ NL80211_CMD_PMKSA_CANDIDATE,		"PMKSA Candidate"	},
    116 	{ NL80211_CMD_TDLS_OPER,		"TDLS Oper"		},
    117 	{ NL80211_CMD_TDLS_MGMT,		"TDLS Mgmt"		},
    118 	{ NL80211_CMD_UNEXPECTED_FRAME,		"Unexpected Frame"	},
    119 	{ NL80211_CMD_PROBE_CLIENT,		"Probe Client"		},
    120 	{ NL80211_CMD_REGISTER_BEACONS,		"Register Beacons"	},
    121 	{ NL80211_CMD_UNEXPECTED_4ADDR_FRAME,	"Unexpected 4addr Frame"},
    122 	{ NL80211_CMD_SET_NOACK_MAP,		"Set NoAck Map"		},
    123 	{ NL80211_CMD_CH_SWITCH_NOTIFY,		"Channel Switch Notify"	},
    124 	{ NL80211_CMD_START_P2P_DEVICE,		"Start P2P Device"	},
    125 	{ NL80211_CMD_STOP_P2P_DEVICE,		"Stop P2P Device"	},
    126 	{ NL80211_CMD_CONN_FAILED,		"Conn Failed"		},
    127 	{ NL80211_CMD_SET_MCAST_RATE,		"Set Mcast Rate"	},
    128 	{ NL80211_CMD_SET_MAC_ACL,		"Set MAC ACL"		},
    129 	{ NL80211_CMD_RADAR_DETECT,		"Radar Detect"		},
    130 	{ NL80211_CMD_GET_PROTOCOL_FEATURES,	"Get Protocol Features"	},
    131 	{ NL80211_CMD_UPDATE_FT_IES,		"Update FT IEs"		},
    132 	{ NL80211_CMD_FT_EVENT,			"FT Event"		},
    133 	{ NL80211_CMD_CRIT_PROTOCOL_START,	"Crit Protocol Start"	},
    134 	{ NL80211_CMD_CRIT_PROTOCOL_STOP,	"Crit Protocol Stop"	},
    135 	{ NL80211_CMD_GET_COALESCE,		"Get Coalesce"		},
    136 	{ NL80211_CMD_SET_COALESCE,		"Set Coalesce"		},
    137 	{ NL80211_CMD_CHANNEL_SWITCH,		"Channel Switch"	},
    138 	{ NL80211_CMD_VENDOR,			"Vendor"		},
    139 	{ NL80211_CMD_SET_QOS_MAP,		"Set QoS Map"		},
    140 	{ NL80211_CMD_ADD_TX_TS,		"Add Traffic Stream"	},
    141 	{ NL80211_CMD_DEL_TX_TS,		"Delete Traffic Stream" },
    142 	{ NL80211_CMD_GET_MPP,			"Get Mesh Proxy Path"	},
    143 	{ NL80211_CMD_JOIN_OCB,			"Join OCB Network"	},
    144 	{ NL80211_CMD_LEAVE_OCB,		"Leave OCB Network"	},
    145 	{ NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
    146 					"Channel Switch Started Notify"},
    147 	{ NL80211_CMD_TDLS_CHANNEL_SWITCH,	"TDLS Channel Switch"	},
    148 	{ NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
    149 						"Cancel TLDS Channel Switch" },
    150 	{ NL80211_CMD_WIPHY_REG_CHANGE,		"Wiphy Reg Change"	},
    151 	{ NL80211_CMD_ABORT_SCAN,		"Abort Scan"		},
    152 	{ NL80211_CMD_START_NAN,		"Start NAN"		},
    153 	{ NL80211_CMD_STOP_NAN,			"Stop NAN"		},
    154 	{ NL80211_CMD_ADD_NAN_FUNCTION,		"Add NAN Function"	},
    155 	{ NL80211_CMD_DEL_NAN_FUNCTION,		"Delete NAN Function"	},
    156 	{ NL80211_CMD_CHANGE_NAN_CONFIG,	"Change NAN Config"	},
    157 	{ NL80211_CMD_NAN_MATCH,		"NAN Match"		},
    158 	{ NL80211_CMD_SET_MULTICAST_TO_UNICAST, "Set Multicast to Unicast" },
    159 	{ NL80211_CMD_UPDATE_CONNECT_PARAMS,	"Update Connect Params" },
    160 	{ NL80211_CMD_SET_PMK,			"Set PMK"		},
    161 	{ NL80211_CMD_DEL_PMK,			"Delete PMK"		},
    162 	{ NL80211_CMD_PORT_AUTHORIZED,		"Port Authorized"	},
    163 	{ NL80211_CMD_RELOAD_REGDB,		"Reload Reg Database"	},
    164 	{ NL80211_CMD_EXTERNAL_AUTH,		"External Auth"		},
    165 	{ NL80211_CMD_STA_OPMODE_CHANGED,	"STA Opmode Changed"	},
    166 	{ NL80211_CMD_CONTROL_PORT_FRAME,	"Control Port Frame"	},
    167 	{ NL80211_CMD_GET_FTM_RESPONDER_STATS,	"Get FTM Responder Stats" },
    168 	{ NL80211_CMD_PEER_MEASUREMENT_START,	"Peer Measurement Start" },
    169 	{ NL80211_CMD_PEER_MEASUREMENT_RESULT,	"Peer Measurement Result" },
    170 	{ NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
    171 						"Peer Measurement Complete" },
    172 
    173 	{ NL80211_CMD_NOTIFY_RADAR,		"Notify Radar"		},
    174 	{ NL80211_CMD_UPDATE_OWE_INFO,		"Update OWE Info"	},
    175 	{ NL80211_CMD_PROBE_MESH_LINK,		"Probe Mesh Link"	},
    176 	{ NL80211_CMD_SET_TID_CONFIG,		"Set TID Config"	},
    177 	{ NL80211_CMD_UNPROT_BEACON,		"Unprotected Beacon"	},
    178 	{ NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS,
    179 						"Control Port TX Status" },
    180 	{ NL80211_CMD_ASSOC_COMEBACK,		"Association comeback delay" },
    181 	{ }
    182 };
    183 
    184 const char *nl80211cmd_to_string(uint32_t cmd)
    185 {
    186 	unsigned int i;
    187 
    188 	for (i = 0; cmd_table[i].str; i++) {
    189 		if (cmd_table[i].cmd != cmd)
    190 			continue;
    191 
    192 		return cmd_table[i].str;
    193 	}
    194 
    195 	return "Unknown";
    196 }