diff --git a/LICENSE b/LICENSE index 80fa603..aff0830 100644 --- a/LICENSE +++ b/LICENSE @@ -37,4 +37,4 @@ software in furtherance of or with intent to commit any fraudulent or other ille activities, or otherwise in violation of any applicable law, regulation or legal agreement. -See for a copy of the GNU General Public License. +See for a copy of the GNU General Public License. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index ce7fd91..a2cc026 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ -# Include license, README +# Include license, README, channels, device, pyw and user guide include LICENSE README.md __init__.py channels.py device.py pyw.py PyRIC.pdf # Include subdirectories recursive-include lib net examples docs -recursive-include docs *.help *.pdf \ No newline at end of file +recursive-include docs *.help \ No newline at end of file diff --git a/PyRIC.pdf b/PyRIC.pdf index 5092f06..034fe81 100644 Binary files a/PyRIC.pdf and b/PyRIC.pdf differ diff --git a/README.md b/README.md index 85fef34..7adfdf6 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,17 @@ ## Pythonic iw ## 1 DESCRIPTION: -BLUF: Stop using subprocess.Popen, regular expressions and str.find. PyRIC -is a python port of a subset of iw and python port of netlink (w.r.t nl80211 -functions). +BLUF: Why use subprocess.Popen, regular expressions and str.find to interact +with your Wireless Network Interface Card. PyRIC provides the ability to +manipuate, identify and enumerate your system's cards. It is a pure python port +of a subset the functionality provided by iw, ifconfig and iwconfig. PyRIC is: +* Pythonic: No ctypes, SWIG etc. PyRIC redefines C header files as Python and +uses sockets to communicate with kernel. +* Self-sufficient: No third-party files used, PyRIC is completely self-contained +* Fast: (relatively speaking) PyRIC is faster than using iw through subprocess.Popen +* Parse(less): Get the output you without parsing output from iw. Never worry about +iw updates and rewriting your parsers. +* Easy: If you can use iw, you can use PyRIC ### a. Background PyRIC arose out of a need in Wraith (https://github.com/wraith-wireless/wraith) @@ -76,7 +84,7 @@ the following: * get supported commands * get supported modes * get dev info -* get phy info (does not currently process the bands) +* get phy info * get/set regulatory domain * get/set mode * add/delete interfaces diff --git a/pyric/RFI b/RFI similarity index 100% rename from pyric/RFI rename to RFI diff --git a/pyric/TODO b/TODO similarity index 76% rename from pyric/TODO rename to TODO index 6bedac9..eb85b2c 100644 --- a/pyric/TODO +++ b/TODO @@ -1,9 +1,8 @@ 1) overall o look at iw dev wlan0 link - o look at iw dev + o make a cli as well 2) libnl.py o see (1) in RFI - o define attr_ops and attr_mcast_groups in nla_policy_attr 4) pyw o add txget from iw i.e. netlink perspective o find a better way to find the supported standards of a card @@ -11,4 +10,4 @@ - move everything to netlink o Can we find the current channel of a radio in monitor mode that is actively scanning? - o parse NL80211_ATTR_WIPHY_BANDS \ No newline at end of file + o parse NL80211_ATTR_WIPHY_BANDS (have workaround currently in place) \ No newline at end of file diff --git a/__init__.py b/__init__.py index 9c9064d..98ed3e0 100644 --- a/__init__.py +++ b/__init__.py @@ -1 +1 @@ -# root Distribution directory \ No newline at end of file +# root Distribution directory diff --git a/examples/device.py b/examples/device.py new file mode 100644 index 0000000..abf2b50 --- /dev/null +++ b/examples/device.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +""" device.py + +Example for displaying device details +""" + +import argparse as ap +import pyric # pyric error (and ecode EUNDEF) +from pyric import pyw # for iw functionality +from pyric import device # for chipset/driver +from pyric.channels import rf2ch # rf to channel conversion + +def execute(dev): + # ensure dev is a wireless interfaces + wifaces = pyw.winterfaces() + if dev not in wifaces: + print "Device {0} is not wireless, use one of {1}".format(dev,wifaces) + + dinfo = pyw.devinfo(dev) + card = dinfo['card'] + pinfo = pyw.phyinfo(card) + driver = device.ifdriver(card.dev) + chipset = device.ifchipset(driver) + + msg = "Device {0}\n".format(dev) + msg += "\tDriver: {0} Chipset: {1}\n".format(driver,chipset) + msg += "\tifindex: {0}\n".format(card.idx) + msg += "\twdev: {0}\n".format(dinfo['wdev']) + msg += "\taddr: {0}\n".format(dinfo['mac']) + msg += "\tmode: {0}\n".format(dinfo['mode']) + msg += "\twiphy: {0}\n".format(card.phy) + if dinfo['mode'] == 'managed': + msg += "\tchannel: {0} (1 MHz), width: {2}, CF: {3}\n".format(rf2ch(dinfo['RF']), + dinfo['RF'], + dinfo['CHW'], + dinfo['CF']) + else: + msg += "\tDevice not associated\n" + print msg + + msg = "Wiphy phy{0}\n".format(card.phy) + msg += "\tGeneration: {0}m Coverage Class: {1}\n".format(pinfo['generation'], + pinfo['cov_class']) + msg += "\tMax # scan SSIDs: {0}\n".format(pinfo['scan_ssids']) + msg += "\tRetry Short: {0}, Long: {1}\n".format(pinfo['retry_short'], + pinfo['retry_long']) + msg += "\tThreshold Frag: {0}, RTS: {1}\n".format(pinfo['frag_thresh'], + pinfo['rts_thresh']) + msg += "\tSupported Modes:\n" + for mode in pinfo['modes']: + msg += "\t * {0}\n".format(mode) + msg += "\tSupported Commands:\n" + for cmd in pinfo['commands']: + msg += "\t * {0}\n".format(cmd) + msg += "\tSupported Frequencies:\n" + for freq in pinfo['freqs']: + msg += "\t * {0}\n".format(freq) + + print msg + +if __name__ == '__main__': + # create arg parser and parse command line args + print "Wireless Device Info Display using PyRIC v{0}".format(pyric.__version__) + argp = ap.ArgumentParser(description="Wireless Device Data") + argp.add_argument('-d','--dev',help="Wireless Device") + args = argp.parse_args() + try: + dev = args.dev + if dev is None: + print "usage: python device.py -d " + else: + execute(dev) + except pyric.error as e: + print e \ No newline at end of file diff --git a/examples/pentest.py b/examples/pentest.py index 86b21ca..3a8c99e 100644 --- a/examples/pentest.py +++ b/examples/pentest.py @@ -90,8 +90,8 @@ def execute(dev): try: dev = args.dev if dev is None: - print "usage: python pentest -d -v " + print "usage: python pentest.py -d " else: execute(dev) except pyric.error as e: - print e + print e \ No newline at end of file diff --git a/pyric/__init__.py b/pyric/__init__.py index 258e743..7187d9e 100644 --- a/pyric/__init__.py +++ b/pyric/__init__.py @@ -103,11 +103,13 @@ - added devcmds in pyw - annotated (in comments) if fcts needed root privileges - added functions to get/set ip address, netmask and broadcast + - fixed PEP8 errors + - made worked around for pulling supported freqs out NL80211_ATTR_WIPHY_BANDS """ __name__ = 'pyric' __license__ = 'GPLv3' -__version__ = '0.0.7' +__version__ = '0.0.8' __date__ = 'April 2016' __author__ = 'Dale Patterson' __maintainer__ = 'Dale Patterson' diff --git a/pyric/channels.py b/pyric/channels.py index 1ad359a..a742848 100644 --- a/pyric/channels.py +++ b/pyric/channels.py @@ -20,8 +20,7 @@ contributors may be used to endorse or promote products derived from this software without specific prior written permission. -Only defines ISM 2.4Ghz and UNII 5Ghz - +Defines ISM 2.4Ghz and UNII 5Ghz frequencies and channels """ __name__ = 'channels' diff --git a/pyric/device.py b/pyric/device.py index 0ab18f3..f5a6f7a 100644 --- a/pyric/device.py +++ b/pyric/device.py @@ -40,6 +40,14 @@ phypath = '/sys/class/ieee80211/{0}' # format w/ phyiscal name # NOTE phypath + index contains the ifindex (sometimes) +def ifcard(dev): + """ + :param dev: device name + :returns: tuple t = (driver,chipset) + """ + driver = ifdriver(dev) + return driver, ifchipset(driver) + def ifdriver(dev): """ :param dev: device name diff --git a/pyric/docs/__init__.py b/pyric/docs/__init__.py index 1f0b5ce..22e810e 100644 --- a/pyric/docs/__init__.py +++ b/pyric/docs/__init__.py @@ -25,7 +25,7 @@ desc: PyRIC and nl80211 documentation/help includes: nl80211.cmd changes: - o Began work on User Guide + o User Guide complete (mostly) """ __name__ = 'docs' diff --git a/pyric/docs/attributes.help b/pyric/docs/attributes.help index 5a62eb6..f05b4f1 100644 --- a/pyric/docs/attributes.help +++ b/pyric/docs/attributes.help @@ -1,4 +1,4 @@ -# attributes.help (json format) +# attributes.help (stored json format) # Automatically generated 2016-04-17T11:06:58.35097 {"@NL80211_ATTR_PMKID": {"cmds": [], "type": "unspec", "desc": "PMK material for PMKSA caching"}, "@NL80211_ATTR_WIPHY": {"cmds": [], "type": "unspec", "desc": "index of wiphy to operate on /sys/class/ieee80211//index"}, "@NL80211_ATTR_SCAN_SUPP_RATES": {"cmds": [], "type": "unspec", "desc": "rates per to be advertised as supported in scan nested array attribute containing an entry for each band, with the entry being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_AKM_SUITES": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which key management algorithm(s) to use (an array of u32)."}, "@NL80211_ATTR_SCAN_FLAGS": {"cmds": [], "type": "unspec", "desc": "scan request control flags "}, "@NL80211_ATTR_IFTYPE": {"cmds": [], "type": "unspec", "desc": "type of virtual interface"}, "@NL80211_ATTR_MAX_SCAN_IE_LEN": {"cmds": [], "type": "unspec", "desc": "maximum length of information elements that can be added to a scan request"}, "@NL80211_ATTR_FREQ_BEFORE": {"cmds": [], "type": "unspec", "desc": "A channel which has suffered a regulatory change due to considerations from a beacon hint. This attribute reflects the state of the channel _before_ the beacon hint processing. This attributes consists of a nested attribute containing NL80211_FREQUENCY_ATTR_*"}, "@NL80211_ATTR_P2P_OPPPS": {"cmds": [], "type": "unspec", "desc": "P2P GO opportunistic PS START_AP and SET_BSS commands. This can have the values 0 or 1; if not given in START_AP 0 is assumed, if not given in SET_BSS no change is made."}, "@NL80211_ATTR_IE_ASSOC_RESP": {"cmds": ["%NL80211_CMD_NEW_BEACON", "%NL80211_CMD_SET_BEACON"], "type": "unspec", "desc": "Information element Response frames. This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into (Re)Association Response frames when the driver (or firmware) replies to (Re)Association Request frames."}, "@NL80211_ATTR_MPATH_NEXT_HOP": {"cmds": [], "type": "unspec", "desc": "MAC address of the next hop for a mesh path"}, "@NL80211_ATTR_RXMGMT_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags for nl80211_send_mgmt As specified in the &enum nl80211_rxmgmt_flags."}, "@NL80211_ATTR_MAX_CRIT_PROT_DURATION": {"cmds": [], "type": "unspec", "desc": "duration in milliseconds in which the connection should have increased reliability (u16)."}, "@NL80211_ATTR_STA_LISTEN_INTERVAL": {"cmds": [], "type": "unspec", "desc": "listen interval as defined by IEEE 802.11 7.3.1.6 (u16)."}, "@NL80211_ATTR_FRAME_TYPE": {"cmds": [], "type": "unspec", "desc": "A u16 indicating the frame type @NL80211_CMD_REGISTER_FRAME command."}, "@NL80211_ATTR_REG_RULES": {"cmds": [], "type": "unspec", "desc": "a nested array of regulatory domain regulatory rules."}, "@NL80211_ATTR_STATUS_CODE": {"cmds": [], "type": "unspec", "desc": "StatusCode for the event (u16)"}, "@NL80211_ATTR_VHT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "VHT Capability information element association request when used with NL80211_CMD_NEW_STATION)"}, "@NL80211_ATTR_CRIT_PROT_ID": {"cmds": [], "type": "unspec", "desc": "critical protocol identifier requiring increased reliability, see &enum nl80211_crit_proto_id (u16)."}, "@NL80211_ATTR_TDLS_ACTION": {"cmds": [], "type": "unspec", "desc": "Low level TDLS action code request, link setup confirm, link teardown, etc.). Values are described in the TDLS (802.11z) specification."}, "@NL80211_ATTR_RESP_IE": {"cmds": [], "type": "unspec", "desc": " sent by peer, for ROAM and successful CONNECT events."}, "@NL80211_ATTR_WDEV": {"cmds": [], "type": "unspec", "desc": "wireless device identifier that don't have a netdev (u64)"}, "@NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "number of SSIDs you can scan with a single scheduled scan request, a wiphy attribute."}, "@NL80211_ATTR_CONTROL_PORT_ETHERTYPE": {"cmds": [], "type": "unspec", "desc": "A 16 ethertype that will be used for key negotiation. It can be specified with the associate and connect commands. If it is not specified, the value defaults to 0x888E (PAE, 802.1X). This attribute is also used as a flag in the wiphy information to indicate that protocols other than PAE are supported."}, "@NL80211_ATTR_KEY_TYPE": {"cmds": [], "type": "unspec", "desc": "Key Type"}, "@NL80211_ATTR_ROAM_SUPPORT": {"cmds": [], "type": "unspec", "desc": "Indicates whether the firmware is capable of roaming to another AP in the same ESS if the signal lever is low."}, "@NL80211_ATTR_TX_NO_CCK_RATE": {"cmds": ["%NL80211_CMD_TRIGGER_SCAN", "%NL80211_CMD_FRAME"], "type": "unspec", "desc": "Indicates whether to use CCK rate or not for management frames transmission. In order to avoid p2p probe/action frames are being transmitted at CCK rate in 2GHz band, the user space applications use this attribute. This attribute is used with %NL80211_CMD_TRIGGER_SCAN and %NL80211_CMD_FRAME commands."}, "@NL80211_ATTR_MGMT_SUBTYPE": {"cmds": ["%NL80211_CMD_SET_MGMT_EXTRA_IE"], "type": "unspec", "desc": "Management frame subtype for %NL80211_CMD_SET_MGMT_EXTRA_IE."}, "@NL80211_ATTR_RX_FRAME_TYPES": {"cmds": [], "type": "unspec", "desc": "wiphy capability attribute nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing information about which frame types can be registered for RX."}, "@NL80211_ATTR_BSS_BASIC_RATES": {"cmds": [], "type": "unspec", "desc": "basic rates rates in format defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_IE_PROBE_RESP": {"cmds": ["%NL80211_CMD_NEW_BEACON", "%NL80211_CMD_SET_BEACON"], "type": "unspec", "desc": "Information element This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the driver (or firmware) replies to Probe Request frames."}, "@NL80211_ATTR_SUPPORTED_IFTYPES": {"cmds": [], "type": "unspec", "desc": "nested attribute containing all supported interface types, each a flag attribute with the number of the interface mode."}, "@NL80211_ATTR_IFINDEX": {"cmds": [], "type": "unspec", "desc": "network interface index of the device to operate on"}, "@NL80211_ATTR_EXT_CAPA_MASK": {"cmds": [], "type": "unspec", "desc": "Extended capabilities that the kernel driver has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields."}, "@NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION": {"cmds": [], "type": "unspec", "desc": "Device attribute that specifies the maximum duration that can be requested with the remain-on-channel operation, in milliseconds, u32."}, "@NL80211_ATTR_REQ_IE": {"cmds": [], "type": "unspec", "desc": " sent out by the card, for ROAM and successful CONNECT events."}, "@NL80211_ATTR_REKEY_DATA": {"cmds": [], "type": "unspec", "desc": "nested attribute containing the information necessary for GTK rekeying in the device, see &enum nl80211_rekey_data."}, "@NL80211_ATTR_HT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "HT Capability information element association request when used with NL80211_CMD_NEW_STATION)"}, "@NL80211_ATTR_KEY_DATA": {"cmds": [], "type": "unspec", "desc": " 16 bytes encryption key followed by 8 bytes each for TX and RX MIC keys"}, "@NL80211_ATTR_KEY_DEFAULT": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating the key is default key"}, "@NL80211_ATTR_MESH_SETUP": {"cmds": [], "type": "unspec", "desc": "Optional mesh setup parameters changed once the mesh is active."}, "@NL80211_ATTR_PMKSA_CANDIDATE": {"cmds": [], "type": "unspec", "desc": "Nested attribute containing the PMKSA caching candidate information, see &enum nl80211_pmksa_candidate_attr."}, "@NL80211_ATTR_WIPHY_RTS_THRESHOLD": {"cmds": [], "type": "unspec", "desc": "RTS threshold larger than or equal to this use RTS/CTS handshake); allowed range: 0..65536, disable with (u32)-1; dot11RTSThreshold; u32"}, "@NL80211_ATTR_DTIM_PERIOD": {"cmds": [], "type": "unspec", "desc": "DTIM period for beaconing"}, "@NL80211_ATTR_MAX_NUM_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "number of SSIDs you can scan with a single scan request, a wiphy attribute."}, "@NL80211_ATTR_MESH_CONFIG": {"cmds": [], "type": "unspec", "desc": "Mesh configuration parameters containing attributes from &enum nl80211_meshconf_params."}, "@NL80211_ATTR_COOKIE": {"cmds": [], "type": "unspec", "desc": "Generic 64"}, "@NL80211_ATTR_MAX_MATCH_SETS": {"cmds": [], "type": "unspec", "desc": "maximum number of sets that can be used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute."}, "@NL80211_ATTR_CH_SWITCH_COUNT": {"cmds": [], "type": "unspec", "desc": "u32 attribute specifying the number of TBTT until the channel switch event."}, "@NL80211_ATTR_OFFCHANNEL_TX_OK": {"cmds": [], "type": "unspec", "desc": "For management frame TX transmitted on another channel when the channel given doesn't match the current channel. If the current channel doesn't match and this flag isn't set, the frame will be rejected. This is also used as an nl80211 capability flag."}, "@NL80211_ATTR_SUPPORT_MESH_AUTH": {"cmds": [], "type": "unspec", "desc": "Currently allows auth frames in a mesh to be passed to userspace for processing via the @NL80211_MESH_SETUP_USERSPACE_AUTH flag."}, "@NL80211_ATTR_REASON_CODE": {"cmds": ["%NL80211_CMD_DISASSOCIATE"], "type": "unspec", "desc": "ReasonCode for %NL80211_CMD_DISASSOCIATE, u16"}, "@NL80211_ATTR_STA_WME": {"cmds": [], "type": "unspec", "desc": "Nested attribute containing the wme configuration of the station, see &enum nl80211_sta_wme_attr."}, "@NL80211_ATTR_AP_ISOLATE": {"cmds": [], "type": "unspec", "desc": " connected to this BSS."}, "@NL80211_ATTR_TESTDATA": {"cmds": [], "type": "unspec", "desc": "Testmode data blob We recommend using nested, driver-specific attributes within this."}, "@NL80211_ATTR_CIPHER_SUITES_PAIRWISE": {"cmds": [], "type": "unspec", "desc": "For crypto settings for connect or other commands, indicates which pairwise cipher suites are used"}, "@NL80211_ATTR_BSS_CTS_PROT": {"cmds": [], "type": "unspec", "desc": "whether CTS protection is enabled "}, "@NL80211_ATTR_BSS_SHORT_SLOT_TIME": {"cmds": [], "type": "unspec", "desc": "whether short slot time enabled (u8, 0 or 1)"}, "@NL80211_ATTR_PEER_AID": {"cmds": [], "type": "unspec", "desc": "Association ID for the peer TDLS station This is similar to @NL80211_ATTR_STA_AID but with a difference of being allowed to be used with the first @NL80211_CMD_SET_STATION command to update a TDLS peer STA entry."}, "@NL80211_ATTR_SPLIT_WIPHY_DUMP": {"cmds": [], "type": "unspec", "desc": "flag attribute receiving the data for a single wiphy split across multiple messages, given with wiphy dump message"}, "@NL80211_ATTR_SUPPORT_IBSS_RSN": {"cmds": [], "type": "unspec", "desc": "The device supports IBSS RSN means support for per-station GTKs."}, "@NL80211_ATTR_IE": {"cmds": ["%NL80211_CMD_SET_MGMT_EXTRA_IE"], "type": "unspec", "desc": "Information element %NL80211_CMD_SET_MGMT_EXTRA_IE)."}, "@NL80211_ATTR_AUTH_TYPE": {"cmds": [], "type": "unspec", "desc": "AuthenticationType represented as a u32"}, "@NL80211_ATTR_BSS": {"cmds": [], "type": "unspec", "desc": "scan result BSS"}, "@NL80211_ATTR_PROBE_RESP_OFFLOAD": {"cmds": [], "type": "unspec", "desc": "Indicates that the HW responds to probe requests while operating in AP-mode. This attribute holds a bitmap of the supported protocols for offloading (see &enum nl80211_probe_resp_offload_support_attr)."}, "@NL80211_ATTR_STA_SUPPORTED_CHANNELS": {"cmds": [], "type": "unspec", "desc": "array of supported channels"}, "@NL80211_ATTR_KEY_SEQ": {"cmds": [], "type": "unspec", "desc": "transmit key sequence number CCMP keys, each six bytes in little endian"}, "@NL80211_ATTR_4ADDR": {"cmds": [], "type": "unspec", "desc": "Use 4"}, "@NL80211_ATTR_TIMED_OUT": {"cmds": ["%NL80211_CMD_AUTHENTICATE"], "type": "unspec", "desc": "a flag indicating than an operation timed out is used, e.g., with %NL80211_CMD_AUTHENTICATE event"}, "@NL80211_ATTR_UNSPEC": {"cmds": [], "type": "unspec", "desc": "unspecified attribute to catch errors"}, "@NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT": {"cmds": [], "type": "unspec", "desc": "When included along with %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom ethertype frames used for key negotiation must not be encrypted."}, "@NL80211_ATTR_BEACON_TAIL": {"cmds": [], "type": "unspec", "desc": "portion of the beacon after the TIM IE"}, "@NL80211_ATTR_REG_INITIATOR": {"cmds": [], "type": "unspec", "desc": "indicates who requested the regulatory domain currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*"}, "@NL80211_ATTR_WIPHY_TX_POWER_LEVEL": {"cmds": [], "type": "unspec", "desc": "Transmit power level in signed mBm units This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING for non-automatic settings."}, "@NL80211_ATTR_ACL_POLICY": {"cmds": [], "type": "unspec", "desc": "ACL policy carried in a u32 attribute"}, "@NL80211_ATTR_SAE_DATA": {"cmds": [], "type": "unspec", "desc": "SAE elements in Authentication frames with the Authentication transaction sequence number field."}, "@NL80211_ATTR_WIPHY_RETRY_LONG": {"cmds": [], "type": "unspec", "desc": "TX retry limit for frames whose length is greater than the RTS threshold; allowed range: 1..255; dot11ShortLongLimit; u8"}, "@NL80211_ATTR_INTERFACE_COMBINATIONS": {"cmds": [], "type": "unspec", "desc": "Nested attribute listing the supported interface combinations. In each nested item, it contains attributes defined in &enum nl80211_if_combination_attrs."}, "@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX": {"cmds": [], "type": "unspec", "desc": "Bitmap of antennas which are available for configuration as TX antennas via the above parameters."}, "@NL80211_ATTR_KEY_DEFAULT_MGMT": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating the key is the default management key"}, "@NL80211_ATTR_BSS_HT_OPMODE": {"cmds": [], "type": "unspec", "desc": "HT operation mode "}, "@NL80211_ATTR_BEACON_HEAD": {"cmds": [], "type": "unspec", "desc": "portion of the beacon before the TIM IE"}, "@NL80211_ATTR_KEYS": {"cmds": [], "type": "unspec", "desc": "array of keys for static WEP keys for connect and join_ibss(), key information is in a nested attribute each with %NL80211_KEY_* sub-attributes"}, "@NL80211_ATTR_MDID": {"cmds": [], "type": "unspec", "desc": "Mobility Domain Identifier"}, "@NL80211_ATTR_STA_PLINK_ACTION": {"cmds": [], "type": "unspec", "desc": "action to perform on the mesh peer link (see &enum nl80211_plink_action)."}, "@NL80211_ATTR_ACK": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating that the frame was acknowledged by the recipient."}, "@NL80211_ATTR_WIPHY_FREQ": {"cmds": [], "type": "unspec", "desc": "frequency of the selected channel in MHz defines the channel together with the (deprecated) %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 and %NL80211_ATTR_CENTER_FREQ2"}, "@NL80211_ATTR_WPA_VERSIONS": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which WPA version(s) the AP we want to associate with is using (a u32 with flags from &enum nl80211_wpa_versions)."}, "@NL80211_ATTR_SUPPORT_AP_UAPSD": {"cmds": [], "type": "unspec", "desc": "the device supports uapsd when working as AP."}, "@NL80211_ATTR_SCHED_SCAN_MATCH": {"cmds": [], "type": "unspec", "desc": "Nested attribute with one or more sets of attributes to match during scheduled scans. Only BSSs that match any of the sets will be reported. These are pass-thru filter rules. For a match to succeed, the BSS must match all attributes of a set. Since not every hardware supports matching all types of attributes, there is no guarantee that the reported BSSs are fully complying with the match sets and userspace needs to be able to ignore them by itself. Thus, the implementation is somewhat hardware-dependent, but this is only an optimization and the userspace application needs to handle all the non-filtered results anyway. If the match attributes don't make sense when combined with the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID is included in the probe request, but the match attributes will never let it go through), -EINVAL may be returned. If ommited, no filtering is done."}, "@NL80211_ATTR_LOCAL_MESH_POWER_MODE": {"cmds": [], "type": "unspec", "desc": "local mesh STA link defined in &enum nl80211_mesh_power_mode."}, "@NL80211_ATTR_SCHED_SCAN_INTERVAL": {"cmds": [], "type": "unspec", "desc": "Interval between scheduled scan cycles, in msecs."}, "@NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED": {"cmds": [], "type": "unspec", "desc": "indicates capabilities, the supported WoWLAN triggers"}, "@NL80211_ATTR_REG_TYPE": {"cmds": [], "type": "unspec", "desc": "indicates the type of the regulatory domain currently set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)"}, "@NL80211_ATTR_SUPPORTED_COMMANDS": {"cmds": [], "type": "unspec", "desc": "wiphy attribute that specifies an array of command numbers (i.e. a mapping index to command number) that the driver for the given wiphy supports."}, "@NL80211_ATTR_SCAN_FREQUENCIES": {"cmds": [], "type": "unspec", "desc": "nested attribute with frequencies "}, "@NL80211_ATTR_IFNAME": {"cmds": [], "type": "unspec", "desc": "network interface name"}, "@NL80211_ATTR_CSA_IES": {"cmds": [], "type": "unspec", "desc": "Nested set of attributes containing the IE information for the time while performing a channel switch."}, "@NL80211_ATTR_CONTROL_PORT": {"cmds": ["%NL80211_CMD_ASSOCIATE"], "type": "unspec", "desc": "A flag indicating whether user space controls IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in station mode. If the flag is included in %NL80211_CMD_ASSOCIATE request, the driver will assume that the port is unauthorized until authorized by user space. Otherwise, port is marked authorized by default in station mode."}, "@NL80211_ATTR_CSA_C_OFF_PRESP": {"cmds": [], "type": "unspec", "desc": "Offset of the channel switch counter field in the probe response (%NL80211_ATTR_PROBE_RESP)."}, "@NL80211_ATTR_CIPHERS_PAIRWISE": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT to indicate which unicast key ciphers will be used with the connection (an array of u32)."}, "@NL80211_ATTR_WIPHY_ANTENNA_RX": {"cmds": [], "type": "unspec", "desc": "Bitmap of allowed antennas for receiving This can be used to mask out antennas which are not attached or should not be used for receiving. If an antenna is not selected in this bitmap the hardware should not be configured to receive on this antenna. For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX."}, "@NL80211_ATTR_DISCONNECTED_BY_AP": {"cmds": [], "type": "unspec", "desc": "A flag indicating that the DISCONNECT event was due to the AP disconnecting the station, and not due to a local disconnect request."}, "@NL80211_ATTR_INACTIVITY_TIMEOUT": {"cmds": [], "type": "unspec", "desc": "timeout value in seconds used by the drivers which has MLME in firmware and does not have support to report per station tx/rx activity to free up the staion entry from the list. This needs to be used when the driver advertises the capability to timeout the stations."}, "@NL80211_ATTR_TDLS_SUPPORT": {"cmds": [], "type": "unspec", "desc": "A flag indicating the device can operate as a TDLS peer sta."}, "@NL80211_ATTR_CENTER_FREQ2": {"cmds": [], "type": "unspec", "desc": "Center frequency of the second part of the channel, used only for 80+80 MHz bandwidth"}, "@NL80211_ATTR_STA_EXT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "Station extended capabilities are advertised to the driver, e.g., to enable TDLS off channel operations and PU-APSD."}, "@NL80211_ATTR_STA_PLINK_STATE": {"cmds": [], "type": "unspec", "desc": "The state of a mesh peer link as defined in &enum nl80211_plink_state. Used when userspace is driving the peer link management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled."}, "@NL80211_ATTR_MAC": {"cmds": [], "type": "unspec", "desc": "MAC address "}, "@NL80211_ATTR_CSA_C_OFF_BEACON": {"cmds": [], "type": "unspec", "desc": "Offset of the channel switch counter field in the beacons tail (%NL80211_ATTR_BEACON_TAIL)."}, "@NL80211_ATTR_WIPHY_NAME": {"cmds": [], "type": "unspec", "desc": "wiphy name "}, "@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX": {"cmds": [], "type": "unspec", "desc": "Bitmap of antennas which are available for configuration as RX antennas via the above parameters."}, "@NL80211_ATTR_CONN_FAILED_REASON": {"cmds": [], "type": "unspec", "desc": "The reason for which AP has rejected the connection request from a station. nl80211_connect_failed_reason enum has different reasons of connection failure."}, "@NL80211_ATTR_CENTER_FREQ1": {"cmds": [], "type": "unspec", "desc": "Center frequency of the first part of the channel, used for anything but 20 MHz bandwidth"}, "@NL80211_ATTR_FRAME": {"cmds": [], "type": "unspec", "desc": "frame data and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and NL80211_CMD_ASSOCIATE events"}, "@NL80211_ATTR_SOFTWARE_IFTYPES": {"cmds": [], "type": "unspec", "desc": "Nested attribute %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that are managed in software: interfaces of these types aren't subject to any restrictions in their number or combinations."}, "@NL80211_ATTR_PID": {"cmds": [], "type": "unspec", "desc": "Process ID of a network namespace"}, "@NL80211_ATTR_USE_MFP": {"cmds": ["%NL80211_CMD_ASSOCIATE", "%NL80211_CMD_CONNECT"], "type": "unspec", "desc": "Whether management frame protection used for the association (&enum nl80211_mfp, represented as a u32); this attribute can be used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests"}, "@NL80211_ATTR_PS_STATE": {"cmds": [], "type": "unspec", "desc": "powersave state"}, "@NL80211_ATTR_PREV_BSSID": {"cmds": [], "type": "unspec", "desc": "previous BSSID commands to specify using a reassociate frame"}, "@NL80211_ATTR_DISABLE_HT": {"cmds": [], "type": "unspec", "desc": " Force HT capable interfaces to disable this feature. Currently, only supported in mac80211 drivers."}, "@NL80211_ATTR_TX_RATES": {"cmds": ["%NL80211_CMD_SET_TX_BITRATE_MASK"], "type": "unspec", "desc": "Nested set of attributes (enum nl80211_tx_rate_attributes) describing TX rates per band. The enum nl80211_band value is used as the index (nla_type() of the nested data. If a band is not included, it will be configured to allow all rates based on negotiated supported rates information. This attribute is used with %NL80211_CMD_SET_TX_BITRATE_MASK."}, "@NL80211_ATTR_MAC_ADDRS": {"cmds": [], "type": "unspec", "desc": "Array of nested MAC addresses"}, "@NL80211_ATTR_COALESCE_RULE": {"cmds": [], "type": "unspec", "desc": "Coalesce rule information"}, "@NL80211_ATTR_RADAR_EVENT": {"cmds": [], "type": "unspec", "desc": "Type of radar event for notification to userspace contains a value of enum nl80211_radar_event (u32)."}, "@NL80211_ATTR_STA_SUPPORTED_RATES": {"cmds": [], "type": "unspec", "desc": "supported rates rates as defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_IE_RIC": {"cmds": [], "type": "unspec", "desc": "Resource Information Container Information element"}, "@NL80211_ATTR_STA_FLAGS2": {"cmds": [], "type": "unspec", "desc": "Attribute containing a &struct nl80211_sta_flag_update."}, "@NL80211_ATTR_PRIVACY": {"cmds": [], "type": "unspec", "desc": "Flag attribute that protected APs should be used. This is also used with NEW_BEACON to indicate that the BSS is to use protection."}, "@NL80211_ATTR_WIPHY_COVERAGE_CLASS": {"cmds": [], "type": "unspec", "desc": "Coverage Class as defined by IEEE 802 section 7.3.2.9; dot11CoverageClass; u8"}, "@NL80211_ATTR_BSS_SHORT_PREAMBLE": {"cmds": [], "type": "unspec", "desc": "whether short preamble is enabled (u8, 0 or 1)"}, "@NL80211_ATTR_MCAST_RATE": {"cmds": [], "type": "unspec", "desc": "Multicast tx rate "}, "@NL80211_ATTR_WIPHY_CHANNEL_TYPE": {"cmds": [], "type": "unspec", "desc": "included with NL80211_ATTR_WIPHY_FREQ if HT20 or HT40 are to be used (i.e., HT disabled if not included): NL80211_CHAN_NO_HT = HT not allowed (same as not including) NL80211_CHAN_HT20 = HT20 only NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel This attribute is now deprecated."}, "@NL80211_ATTR_PROBE_RESP": {"cmds": [], "type": "unspec", "desc": "Probe Response template data probe-response frame. The DA field in the 802.11 header is zero-ed out, to be filled by the FW."}, "@NL80211_ATTR_CQM": {"cmds": [], "type": "unspec", "desc": "connection quality monitor configuration in a nested attribute with %NL80211_ATTR_CQM_* sub-attributes."}, "@NL80211_ATTR_DONT_WAIT_FOR_ACK": {"cmds": [], "type": "unspec", "desc": "Used with the driver to not wait for an acknowledgement. Note that due to this, it will also not give a status callback nor return a cookie. This is mostly useful for probe responses to save airtime."}, "@NL80211_ATTR_STA_VLAN": {"cmds": [], "type": "unspec", "desc": "interface index of VLAN interface to move station to, or the AP interface the station was originally added to to."}, "@NL80211_ATTR_FREQ_AFTER": {"cmds": [], "type": "unspec", "desc": "A channel which has suffered a regulatory change due to considerations from a beacon hint. This attribute reflects the state of the channel _after_ the beacon hint processing. This attributes consists of a nested attribute containing NL80211_FREQUENCY_ATTR_*"}, "@NL80211_ATTR_MESH_ID": {"cmds": [], "type": "unspec", "desc": "mesh id "}, "@NL80211_ATTR_DFS_REGION": {"cmds": [], "type": "unspec", "desc": "region for regulatory rules which this country abides to when initiating radiation on DFS channels. A country maps to one DFS region."}, "@NL80211_ATTR_MNTR_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags &enum nl80211_mntr_flags."}, "@NL80211_ATTR_WIPHY_FRAG_THRESHOLD": {"cmds": [], "type": "unspec", "desc": "fragmentation threshold length in octets for frames; allowed range: 256..8000, disable fragmentation with (u32)-1; dot11FragmentationThreshold; u32"}, "@NL80211_ATTR_KEY_CIPHER": {"cmds": [], "type": "unspec", "desc": "key cipher suite section 7.3.2.25.1, e.g. 0x000FAC04)"}, "@NL80211_ATTR_KEY_IDX": {"cmds": [], "type": "unspec", "desc": "key ID "}, "@NL80211_ATTR_P2P_CTWINDOW": {"cmds": [], "type": "unspec", "desc": "P2P GO Client Traffic Window the START_AP and SET_BSS commands"}, "@NL80211_ATTR_TDLS_EXTERNAL_SETUP": {"cmds": ["%NL80211_CMD_TDLS_MGMT", "%NL80211_CMD_TDLS_OPER"], "type": "unspec", "desc": "The TDLS discovery procedures should be performed by sending TDLS packets via %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be used for asking the driver to perform a TDLS operation."}, "@NL80211_ATTR_PROTOCOL_FEATURES": {"cmds": [], "type": "unspec", "desc": "global nl80211 feature flags &enum nl80211_protocol_features, the attribute is a u32."}, "@NL80211_ATTR_MPATH_INFO": {"cmds": ["%NL80211_CMD_GET_MPATH"], "type": "unspec", "desc": "information about a mesh_path info given for %NL80211_CMD_GET_MPATH, nested attribute described at &enum nl80211_mpath_info."}, "@NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN": {"cmds": [], "type": "unspec", "desc": "maximum length of information elements that can be added to a scheduled scan request"}, "@NL80211_ATTR_TDLS_OPERATION": {"cmds": [], "type": "unspec", "desc": "High level TDLS operation &enum nl80211_tdls_operation, represented as a u8."}, "@NL80211_ATTR_FREQ_FIXED": {"cmds": [], "type": "unspec", "desc": "a flag indicating the IBSS should not try to look for other networks on different channels"}, "@NL80211_ATTR_STA_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)"}, "@NL80211_ATTR_MAX_NUM_PMKIDS": {"cmds": [], "type": "unspec", "desc": "maximum number of PMKIDs a firmware can cache, a wiphy attribute."}, "@NL80211_ATTR_MAC_ACL_MAX": {"cmds": [], "type": "unspec", "desc": "u32 attribute to advertise the maximum number of MAC addresses that a device can support for MAC ACL"}, "@NL80211_ATTR_STA_AID": {"cmds": [], "type": "unspec", "desc": "Association ID for the station "}, "@NL80211_ATTR_KEY": {"cmds": [], "type": "unspec", "desc": "key information in a nested attribute with %NL80211_KEY_* sub-attributes"}, "@NL80211_ATTR_STA_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "Station capabilities the driver, e.g., to enable TDLS power save (PU-APSD)."}, "@NL80211_ATTR_DEVICE_AP_SME": {"cmds": [], "type": "unspec", "desc": "This u32 attribute may be listed for devices that have AP support to indicate that they have the AP SME integrated with support for the features listed in this attribute, see &enum nl80211_ap_sme_features."}, "@NL80211_ATTR_HIDDEN_SSID": {"cmds": [], "type": "unspec", "desc": "indicates whether SSID is to be hidden from Beacon and Probe Response (when response to wildcard Probe Request); see &enum nl80211_hidden_ssid, represented as a u32"}, "@NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES": {"cmds": [], "type": "unspec", "desc": "array of supported supported operating classes."}, "@NL80211_ATTR_FRAME_MATCH": {"cmds": [], "type": "unspec", "desc": "A binary attribute which typically must contain at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME."}, "@NL80211_ATTR_STA_INFO": {"cmds": ["%NL80211_CMD_GET_STATION"], "type": "unspec", "desc": "information about a station given for %NL80211_CMD_GET_STATION, nested attribute containing info as possible, see &enum nl80211_sta_info."}, "@NL80211_ATTR_GENERATION": {"cmds": [], "type": "unspec", "desc": "Used to indicate consistent snapshots for dumps. This number increases whenever the object list being dumped changes, and as such userspace can verify that it has obtained a complete and consistent snapshot by verifying that all dump messages contain the same generation number. If it changed then the list changed and the dump should be repeated completely from scratch."}, "@NL80211_ATTR_WIPHY_RETRY_SHORT": {"cmds": [], "type": "unspec", "desc": "TX retry limit for frames whose length is less than or equal to the RTS threshold; allowed range: 1..255; dot11ShortRetryLimit; u8"}, "@NL80211_ATTR_CIPHER_GROUP": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which group key cipher will be used with the connection, a u32"}, "@NL80211_ATTR_DURATION": {"cmds": [], "type": "unspec", "desc": "Duration of an operation in milliseconds"}, "@NL80211_ATTR_BG_SCAN_PERIOD": {"cmds": [], "type": "unspec", "desc": "Background scan period in seconds or 0 to disable background scan."}, "@NL80211_ATTR_WIPHY_BANDS": {"cmds": [], "type": "unspec", "desc": "Information about an operating bands consisting of a nested array."}, "@NL80211_ATTR_CIPHER_SUITES": {"cmds": [], "type": "unspec", "desc": "a set of u32 values indicating the supported cipher suites"}, "@NL80211_ATTR_TDLS_DIALOG_TOKEN": {"cmds": [], "type": "unspec", "desc": "Non TDLS conversation between two devices."}, "@NL80211_ATTR_REG_ALPHA2": {"cmds": [], "type": "unspec", "desc": "an ISO current regulatory domain should be set to or is already set to. For example, 'CR', for Costa Rica. This attribute is used by the kernel to query the CRDA to retrieve one regulatory domain. This attribute can also be used by userspace to query the kernel for the currently set regulatory domain. We chose an alpha2 as that is also used by the IEEE-802.11 country information element to identify a country. Users can also simply ask the wireless core to set regulatory domain to a specific alpha2."}, "@NL80211_ATTR_LOCAL_STATE_CHANGE": {"cmds": [], "type": "unspec", "desc": "Flag attribute to indicate that a command is requesting a local authentication/association state change without invoking actual management frame exchange. This can be used with NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, NL80211_CMD_DISASSOCIATE."}, "@NL80211_ATTR_USER_REG_HINT_TYPE": {"cmds": [], "type": "unspec", "desc": "type of regulatory hint passed from userspace. If unset it is assumed the hint comes directly from a user. If set code could specify exactly what type of source was used to provide the hint. For the different types of allowed user regulatory hints see nl80211_user_reg_hint_type."}, "@NL80211_ATTR_BEACON_INTERVAL": {"cmds": [], "type": "unspec", "desc": "beacon interval in TU"}, "@NL80211_ATTR_EXT_CAPA": {"cmds": [], "type": "unspec", "desc": "802 has and handles. The format is the same as the IE contents. See 802.11-2012 8.4.2.29 for more information."}, "@NL80211_ATTR_CH_SWITCH_BLOCK_TX": {"cmds": [], "type": "unspec", "desc": "flag attribute specifying that transmission must be blocked on the current channel (before the channel switch operation)."}, "@NL80211_ATTR_WIPHY_TXQ_PARAMS": {"cmds": [], "type": "unspec", "desc": "a nested array of TX queue parameters"}, "@NL80211_ATTR_WOWLAN_TRIGGERS": {"cmds": ["%NL80211_CMD_GET_WOWLAN"], "type": "unspec", "desc": "used by indicate which WoW triggers should be enabled. This is also used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN triggers."}, "@NL80211_ATTR_HT_CAPABILITY_MASK": {"cmds": [], "type": "unspec", "desc": "Specify which bits of the ATTR_HT_CAPABILITY to which attention should be paid. Currently, only mac80211 NICs support this feature. The values that may be configured are: MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40 AMPDU density and AMPDU factor. All values are treated as suggestions and may be ignored by the driver as required. The actual values may be seen in the station debugfs ht_caps file."}, "@NL80211_ATTR_TX_FRAME_TYPES": {"cmds": ["%NL80211_CMD_FRAME"], "type": "unspec", "desc": "wiphy capability attribute nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing information about which frame types can be transmitted with %NL80211_CMD_FRAME."}, "@NL80211_ATTR_CIPHER_SUITE_GROUP": {"cmds": [], "type": "unspec", "desc": "For crypto settings for connect or other commands, indicates which group cipher suite is used"}, "@NL80211_ATTR_RX_SIGNAL_DBM": {"cmds": ["%NL80211_CMD_FRAME"], "type": "unspec", "desc": "signal strength in dBm this attribute is (depending on the driver capabilities) added to received frames indicated with %NL80211_CMD_FRAME."}, "@NL80211_ATTR_SSID": {"cmds": [], "type": "unspec", "desc": "SSID "}, "@NL80211_ATTR_KEY_DEFAULT_TYPES": {"cmds": [], "type": "unspec", "desc": "A nested attribute containing flags attributes, specifying what a key should be set as default as. See &enum nl80211_key_default_types."}, "@NL80211_ATTR_SURVEY_INFO": {"cmds": ["%NL80211_CMD_GET_SURVEY"], "type": "unspec", "desc": "survey information about a channel the survey response for %NL80211_CMD_GET_SURVEY, nested attribute containing info as possible, see &enum survey_info."}, "@NL80211_ATTR_WIPHY_TX_POWER_SETTING": {"cmds": [], "type": "unspec", "desc": "Transmit power setting type &enum nl80211_tx_power_setting for possible values."}, "@NL80211_ATTR_WIPHY_ANTENNA_TX": {"cmds": [], "type": "unspec", "desc": "Bitmap of allowed antennas for transmitting This can be used to mask out antennas which are not attached or should not be used for transmitting. If an antenna is not selected in this bitmap the hardware is not allowed to transmit on this antenna. Each bit represents one antenna, starting with antenna 1 at the first bit. Depending on which antennas are selected in the bitmap, 802.11n drivers can derive which chainmasks to use (if all antennas belonging to a particular chain are disabled this chain should be disabled) and if a chain has diversity antennas wether diversity should be used or not. HT capabilities (STBC, TX Beamforming, Antenna selection) can be derived from the available chains after applying the antenna mask. Non-802.11n drivers can derive wether to use diversity or not. Drivers may reject configurations or RX/TX mask combinations they cannot support by returning -EINVAL."}, "@NL80211_ATTR_CHANNEL_WIDTH": {"cmds": [], "type": "unspec", "desc": "u32 attribute containing one of the values of &enum nl80211_chan_width, describing the channel width. See the documentation of the enum for more information."}, "@NL80211_ATTR_NOACK_MAP": {"cmds": [], "type": "unspec", "desc": "This u16 bitmap contains the No Ack Policy of up to 16 TIDs."}, "@NL80211_ATTR_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "nested attribute with SSIDs scanning and include a zero-length SSID (wildcard) for wildcard scan"}, "@NL80211_ATTR_FEATURE_FLAGS": {"cmds": [], "type": "unspec", "desc": "This u32 attribute contains flags from &enum nl80211_feature_flags and is advertised in wiphy information."}, "@NL80211_ATTR_HANDLE_DFS": {"cmds": ["%NL80211_CMD_JOIN_IBSS"], "type": "unspec", "desc": "A flag indicating whether user space controls DFS operation in IBSS mode. If the flag is included in %NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS channels and reports radar events to userspace. Userspace is required to react to radar events, e.g. initiate a channel switch or leave the IBSS network."}} diff --git a/pyric/docs/commands.help b/pyric/docs/commands.help index a69f29b..a1859ba 100644 --- a/pyric/docs/commands.help +++ b/pyric/docs/commands.help @@ -1,4 +1,4 @@ -# commands.help (json format) +# commands.help (stored json format) # Automatically generated 2016-04-17T11:06:57.694132 {"@NL80211_CMD_GET_REG": {"attrs": [], "desc": "ask the wireless core to send us its currently set\tregulatory domain."}, "@NL80211_CMD_STOP_SCHED_SCAN": {"attrs": [], "desc": "stop if scheduled scan is not running."}, "@NL80211_CMD_START_SCHED_SCAN": {"attrs": ["%NL80211_ATTR_SCHED_SCAN_INTERVAL", "%NL80211_ATTR_SCAN_SSIDS", "%NL80211_ATTR_SCAN_FREQUENCIES", "%NL80211_ATTR_IE"], "desc": "start intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL. Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) are passed, they are used in the probe requests. For broadcast, a broadcast SSID must be passed (ie. an empty string). If no SSID is passed, no probe requests are sent and a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES, if passed, define which channels should be scanned; if not passed, all channels allowed for the current regulatory domain are used. Extra IEs can also be passed from the userspace by using the %NL80211_ATTR_IE attribute."}, "@NL80211_CMD_NEW_SURVEY_RESULTS": {"attrs": [], "desc": "survey NL80211_CMD_GET_SURVEY and on the \"scan\" multicast group)"}, "@NL80211_CMD_SET_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_IFTYPE"], "desc": "Set %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE."}, "@NL80211_CMD_DISASSOCIATE": {"attrs": [], "desc": "disassociation NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives)."}, "@NL80211_CMD_FRAME": {"attrs": ["%NL80211_ATTR_FRAME", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_DURATION", "%NL80211_ATTR_COOKIE", "%NL80211_ATTR_TX_NO_CCK_RATE"], "desc": "Management command is used both as a request to transmit a management frame and as an event indicating reception of a frame that was not processed in kernel code, but is for us (i.e., which may need to be processed in a user space application). %NL80211_ATTR_FRAME is used to specify the frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used to indicate on which channel the frame is to be transmitted or was received. If this channel is not the current channel (remain-on-channel or the operational channel) the device will switch to the given channel and transmit the frame, optionally waiting for a response for the time specified using %NL80211_ATTR_DURATION. When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the TX status event pertaining to the TX request. %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the management frames at CCK rate or not in 2GHz band."}, "@NL80211_CMD_NEW_KEY": {"attrs": ["%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_KEY_CIPHER", "%NL80211_ATTR_KEY_SEQ"], "desc": "add %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER, and %NL80211_ATTR_KEY_SEQ attributes."}, "@NL80211_CMD_STOP_AP": {"attrs": [], "desc": "Stop"}, "@NL80211_CMD_DEL_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX"], "desc": "Virtual %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from userspace to request deletion of a virtual interface, then requires attribute %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNEXPECTED_4ADDR_FRAME": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Sent associated station identified by %NL80211_ATTR_MAC sent a 4addr frame and wasn't already in a 4-addr VLAN. The event will be sent similarly to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener."}, "@NL80211_CMD_SET_MESH_CONFIG": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set interface identified by %NL80211_ATTR_IFINDEX"}, "@NL80211_CMD_STOP_P2P_DEVICE": {"attrs": ["%NL80211_ATTR_WDEV"], "desc": "Stop its %NL80211_ATTR_WDEV identifier."}, "@NL80211_CMD_START_P2P_DEVICE": {"attrs": ["%NL80211_ATTR_WDEV"], "desc": "Start its %NL80211_ATTR_WDEV identifier. It must have been created with %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the P2P Device can be used for P2P operations, e.g. remain-on-channel and public action frame TX."}, "@NL80211_CMD_SET_COALESCE": {"attrs": [], "desc": "Configure"}, "@NL80211_CMD_DEL_WIPHY": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_WIPHY_NAME"], "desc": "Wiphy %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME."}, "@NL80211_CMD_SET_STATION": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Set %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_LEAVE_MESH": {"attrs": [], "desc": "Leave network is determined by the network interface."}, "@NL80211_CMD_GET_KEY": {"attrs": ["%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_MAC"], "desc": "Get by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC."}, "@NL80211_CMD_GET_SURVEY": {"attrs": [], "desc": "get"}, "@NL80211_CMD_TDLS_MGMT": {"attrs": [], "desc": "Send"}, "@NL80211_CMD_SET_BSS": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_SET_WOWLAN": {"attrs": ["%NL80211_ATTR_WOWLAN_TRIGGERS"], "desc": "set Since wireless is more complex than wired ethernet, it supports various triggers. These triggers can be configured through this command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For more background information, see http://wireless.kernel.org/en/users/Documentation/WoWLAN. The @NL80211_CMD_SET_WOWLAN command can also be used as a notification from the driver reporting the wakeup reason. In this case, the @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason for the wakeup, if it was caused by wireless. If it is not present in the wakeup notification, the wireless device didn't cause the wakeup but reports that it was woken up."}, "@NL80211_CMD_NEW_STATION": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Add the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_SET_PMKSA": {"attrs": ["%NL80211_ATTR_PMKID"], "desc": "Add (for the BSSID) and %NL80211_ATTR_PMKID."}, "@NL80211_CMD_SET_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": " destination %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_DEL_STATION": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Remove or, if no MAC address given, all stations, on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNPROT_DISASSOCIATE": {"attrs": [], "desc": "Unprotected notification. This event is used to indicate that an unprotected disassociation frame was dropped when MFP is in use."}, "@NL80211_CMD_CH_SWITCH_NOTIFY": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_FREQ"], "desc": "An independently of the userspace SME, send this event indicating %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width."}, "@NL80211_CMD_SET_KEY": {"attrs": ["%NL80211_ATTR_KEY_DEFAULT_MGMT", "%NL80211_ATTR_KEY_THRESHOLD"], "desc": "Set %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD."}, "@NL80211_CMD_SET_MAC_ACL": {"attrs": ["%NL80211_ATTR_MAC_ADDRS", "%NL80211_ATTR_ACL_POLICY"], "desc": "sets This is to be used with the drivers advertising the support of MAC address based access control. List of MAC addresses is passed in %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it is not already done. The new list will replace any existing list. Driver will clear its ACL when the list of MAC addresses passed is empty. This command is used in AP/P2P GO mode. Driver has to make sure to clear its ACL list during %NL80211_CMD_STOP_AP."}, "@NL80211_CMD_GET_WOWLAN": {"attrs": [], "desc": "get"}, "@NL80211_CMD_GET_STATION": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Get %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNSPEC": {"attrs": [], "desc": "unspecified"}, "@NL80211_CMD_NEW_PEER_CANDIDATE": {"attrs": [], "desc": "Notification beacon or probe response from a compatible mesh peer. This is only sent while no station information (sta_info) exists for the new peer candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH, @NL80211_MESH_SETUP_USERSPACE_AMPE, or @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this notification, userspace may decide to create a new station (@NL80211_CMD_NEW_STATION). To stop this notification from reoccurring, the userspace authentication daemon may want to create the new station with the AUTHENTICATED flag unset and maybe change it later depending on the authentication result."}, "@NL80211_CMD_REGISTER_ACTION": {"attrs": [], "desc": "Alias backward compatibility"}, "@NL80211_CMD_REG_CHANGE": {"attrs": ["%NL80211_ATTR_REG_INITIATOR", "%NL80211_ATTR_REG_ALPHA2", "%NL80211_ATTR_REG_TYPE", "%NL80211_ATTR_REG_ALPHA2"], "desc": "indicates has been changed and provides details of the request information that caused the change such as who initiated the regulatory request (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on to (%NL80211_ATTR_REG_ALPHA2)."}, "@NL80211_CMD_CONN_FAILED": {"attrs": ["%NL80211_ATTR_CONN_FAILED_REASON"], "desc": "connection notify userspace that AP has rejected the connection request from a station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON is used for this."}, "@NL80211_CMD_SCAN_ABORTED": {"attrs": [], "desc": "scan partial scan results may be available"}, "@NL80211_CMD_SET_POWER_SAVE": {"attrs": [], "desc": "Set"}, "@NL80211_CMD_SET_MGMT_EXTRA_IE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MGMT_SUBTYPE", "%NL80211_ATTR_IE"], "desc": "Set interface is identified with %NL80211_ATTR_IFINDEX and the management frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be added to the end of the specified management frame is specified with %NL80211_ATTR_IE. If the command succeeds, the requested data will be added to all specified management frames generated by kernel/firmware/driver. Note: This command has been removed and it is only reserved at this point to avoid re-using existing command number. The functionality this command was planned for has been provided with cleaner design with the option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE."}, "@NL80211_CMD_SET_REKEY_OFFLOAD": {"attrs": ["%NL80211_ATTR_REKEY_DATA"], "desc": "This the necessary information for supporting GTK rekey offload. This feature is typically used during WoWLAN. The configuration data is contained in %NL80211_ATTR_REKEY_DATA (which is nested and contains the data in sub-attributes). After rekeying happened, this command may also be sent by the driver as an MLME event to inform userspace of the new replay counter."}, "@NL80211_CMD_SET_CHANNEL": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set and the attributes determining channel width) the given interface (identifed by %NL80211_ATTR_IFINDEX) shall operate on. In case multiple channels are supported by the device, the mechanism with which it switches channels is implementation-defined. When a monitor interface is given, it can only switch channel while no other interfaces are operating to avoid disturbing the operation of any other interfaces, and other interfaces will again take precedence when they are used."}, "@NL80211_CMD_START_AP": {"attrs": ["%NL80211_ATTR_BEACON_INTERVAL", "%NL80211_ATTR_DTIM_PERIOD", "%NL80211_ATTR_SSID", "%NL80211_ATTR_HIDDEN_SSID", "%NL80211_ATTR_CIPHERS_PAIRWISE", "%NL80211_ATTR_CIPHER_GROUP", "%NL80211_ATTR_WPA_VERSIONS", "%NL80211_ATTR_AKM_SUITES", "%NL80211_ATTR_PRIVACY", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_INACTIVITY_TIMEOUT", "%NL80211_ATTR_ACL_POLICY", "%NL80211_ATTR_MAC_ADDRS", "%NL80211_ATTR_WIPHY_FREQ"], "desc": "Start are like for %NL80211_CMD_SET_BEACON, and additionally parameters that do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID, %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. The channel to use can be set on the interface or be given using the %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width."}, "@NL80211_CMD_DEL_PMKSA": {"attrs": ["%NL80211_ATTR_PMKID"], "desc": "Delete (for the BSSID) and %NL80211_ATTR_PMKID."}, "@NL80211_CMD_UNEXPECTED_FRAME": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Used (or GO) interface (i.e. hostapd) to ask for unexpected frames to implement sending deauth to stations that send unexpected class 3 frames. Also used as the event sent by the kernel when such a frame is received. For the event, the %NL80211_ATTR_MAC attribute carries the TA and other attributes like the interface index are present. If used as the command it must have an interface index and you can only unsubscribe from the event by closing the socket. Subscription is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events."}, "@NL80211_CMD_GET_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Get destination %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_GET_BEACON": {"attrs": [], "desc": ""}, "@NL80211_CMD_PMKSA_CANDIDATE": {"attrs": [], "desc": "This of PMKSA caching dandidates."}, "@NL80211_CMD_PROBE_CLIENT": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_COOKIE", "%NL80211_ATTR_ACK"], "desc": "Probe by sending a null data frame to it and reporting when the frame is acknowleged. This is used to allow timing out inactive clients. Uses %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a direct reply with an %NL80211_ATTR_COOKIE that is later used to match up the event with the request. The event includes the same data and has %NL80211_ATTR_ACK set if the frame was ACKed."}, "@NL80211_CMD_NEW_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFTYPE", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFTYPE", "%NL80211_ATTR_IFNAME"], "desc": "Newly to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX, %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also be sent from userspace to request creation of a new virtual interface, then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and %NL80211_ATTR_IFNAME."}, "@NL80211_CMD_SET_TX_BITRATE_MASK": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface and @NL80211_ATTR_TX_RATES the set of allowed rates."}, "@NL80211_CMD_NEW_SCAN_RESULTS": {"attrs": [], "desc": "scan NL80211_CMD_GET_SCAN and on the \"scan\" multicast group)"}, "@NL80211_CMD_GET_WIPHY": {"attrs": [], "desc": "request to get a list of all present wiphys."}, "@NL80211_CMD_SET_NOACK_MAP": {"attrs": [], "desc": "sets No Acknowledgement Policy should be applied."}, "@NL80211_CMD_ACTION": {"attrs": [], "desc": "Alias"}, "@NL80211_CMD_FLUSH_PMKSA": {"attrs": [], "desc": "Flush"}, "@NL80211_CMD_ASSOCIATE": {"attrs": [], "desc": "association NL80211_CMD_AUTHENTICATE but for Association and Reassociation (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives)."}, "@NL80211_CMD_GET_PROTOCOL_FEATURES": {"attrs": ["%NL80211_ATTR_PROTOCOL_FEATURES"], "desc": "Get i.e. features for the nl80211 protocol rather than device features. Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap."}, "@NL80211_CMD_DEAUTHENTICATE": {"attrs": [], "desc": "deauthentication NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication primitives)."}, "@NL80211_CMD_CRIT_PROTOCOL_STOP": {"attrs": [], "desc": "Indicates return back to normal."}, "@NL80211_CMD_FT_EVENT": {"attrs": [], "desc": "Send to the supplicant. This will carry the target AP's MAC address along with the relevant Information Elements. This event is used to report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE)."}, "@NL80211_CMD_NEW_WIPHY": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_WIPHY_NAME"], "desc": "Newly or rename notification. Has attributes %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME."}, "@NL80211_CMD_UPDATE_FT_IES": {"attrs": [], "desc": "Pass Information Element to the WLAN driver"}, "@NL80211_CMD_SET_WDS_PEER": {"attrs": [], "desc": "Set"}, "@NL80211_CMD_SCHED_SCAN_STOPPED": {"attrs": [], "desc": "indicates stopped. The driver may issue this event at any time during a scheduled scan. One reason for stopping the scan is if the hardware does not support starting an association or a normal scan while running a scheduled scan. This event is also sent when the %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface is brought down while a scheduled scan was running."}, "@NL80211_CMD_FRAME_TX_STATUS": {"attrs": ["%NL80211_ATTR_COOKIE", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_ACK"], "desc": "Report transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME includes the contents of the frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged the frame."}, "@NL80211_CMD_TDLS_OPER": {"attrs": ["%NL80211_ATTR_TDLS_OPERATION", "%NL80211_ATTR_MAC", "%NL80211_ATTR_REASON_CODE"], "desc": "Perform In addition, this can be used as an event to request userspace to take actions on TDLS links (set up a new link or tear down an existing one). In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested operation, %NL80211_ATTR_MAC contains the peer MAC address, and %NL80211_ATTR_REASON_CODE the reason code to be used (only with %NL80211_TDLS_TEARDOWN)."}, "@NL80211_CMD_GET_SCAN": {"attrs": [], "desc": "get"}, "@NL80211_CMD_SET_WIPHY": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_NAME", "%NL80211_ATTR_WIPHY_TXQ_PARAMS", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_WIPHY_RETRY_SHORT", "%NL80211_ATTR_WIPHY_RETRY_LONG", "%NL80211_ATTR_WIPHY_FRAG_THRESHOLD", "%NL80211_ATTR_WIPHY_RTS_THRESHOLD"], "desc": "set %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the attributes determining the channel width; this is used for setting monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel, see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward compatibility only."}, "@NL80211_CMD_AUTHENTICATE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_SSID", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_IE", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_TIMED_OUT", "%NL80211_ATTR_MAC"], "desc": "authentication This command is used both as a command (request to authenticate) and as an event on the \"mlme\" multicast group indicating completion of the authentication process. When used as a command, %NL80211_ATTR_IFINDEX is used to identify the interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify the SSID (mainly for association, but is included in authentication request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the authentication type. %NL80211_ATTR_IE is used to define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added to the frame. When used as an event, this reports reception of an Authentication frame in station and IBSS modes when the local MLME processed the frame, i.e., it was for the local STA and was received in correct state. This is similar to MLME-AUTHENTICATE.confirm primitive in the MLME SAP interface (kernel providing MLME, userspace SME). The included %NL80211_ATTR_FRAME attribute contains the management frame (including both the header and frame body, but not FCS). This event is also used to indicate if the authentication attempt timed out. In that case the %NL80211_ATTR_FRAME attribute is replaced with a %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which pending authentication timed out)."}, "@NL80211_CMD_DEL_PATH": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Remove or, if no MAC address given, all mesh paths, on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_GET_MESH_CONFIG": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Get interface identified by %NL80211_ATTR_IFINDEX"}, "@NL80211_CMD_NEW_PATH": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Add the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_NEW_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_MPATH_NEXT_HOP"], "desc": "Create %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP."}, "@NL80211_CMD_MICHAEL_MIC_FAILURE": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_KEY_TYPE", "%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_KEY_SEQ"], "desc": "notification MIC (part of TKIP) failure; sent on the \"mlme\" multicast group; the event includes %NL80211_ATTR_MAC to describe the source MAC address of the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this event matches with MLME-MICHAELMICFAILURE.indication() primitive"}, "@NL80211_CMD_SET_WIPHY_NETNS": {"attrs": [], "desc": "Set associated with this wiphy must be down and will follow."}, "@NL80211_CMD_DEL_KEY": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "delete or %NL80211_ATTR_MAC."}, "@NL80211_CMD_SET_CQM": {"attrs": [], "desc": "Connection is used to configure connection quality monitoring notification trigger levels."}, "@NL80211_CMD_REMAIN_ON_CHANNEL": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_DURATION", "%NL80211_ATTR_COOKIE"], "desc": "Request channel for the specified amount of time. This can be used to do off-channel operations like transmit a Public Action frame and wait for a response while being associated to an AP on another channel. %NL80211_ATTR_IFINDEX is used to specify which interface (and thus radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the frequency for the operation. %NL80211_ATTR_DURATION is used to specify the duration in milliseconds to remain on the channel. This command is also used as an event to notify when the requested duration starts (it may take a while for the driver to schedule this time due to other concurrent needs for the radio). When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) that will be included with any events pertaining to this request; the cookie is also used to cancel the request."}, "@NL80211_CMD_JOIN_IBSS": {"attrs": ["%NL80211_ATTR_BEACON_INTERVAL"], "desc": "Join FREQ attribute (for the initial frequency if no peer can be found) and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those should be fixed rather than automatically determined. Can only be executed on a network interface that is UP, and fixed BSSID/FREQ may be rejected. Another optional parameter is the beacon interval, given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not given defaults to 100 TU (102.4ms)."}, "@NL80211_CMD_REG_BEACON_HINT": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_FREQ_BEFORE", "%NL80211_ATTR_FREQ_AFTER"], "desc": "indicates has been found while world roaming thus enabling active scan or any mode of operation that initiates TX (beacons) on a channel where we would not have been able to do either before. As an example if you are world roaming (regulatory domain set to world or if your driver is using a custom world roaming regulatory domain) and while doing a passive scan on the 5 GHz band you find an AP there (if not on a DFS channel) you will now be able to actively scan for that AP or use AP mode on your card on that same channel. Note that this will never be used for channels 1-11 on the 2 GHz band as they are always enabled world wide. This beacon hint is only sent if your device had either disabled active scanning or beaconing on a channel. We send to userspace the wiphy on which we removed a restriction from (%NL80211_ATTR_WIPHY) and the channel on which this occurred before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER) the beacon hint was processed."}, "@NL80211_CMD_CRIT_PROTOCOL_START": {"attrs": [], "desc": "Indicates a critical protocol that needs more reliability in the connection to complete."}, "@NL80211_CMD_UNPROT_DEAUTHENTICATE": {"attrs": [], "desc": "Unprotected notification. This event is used to indicate that an unprotected deauthentication frame was dropped when MFP is in use."}, "@NL80211_CMD_REQ_SET_REG": {"attrs": [], "desc": "ask to the specified ISO/IEC 3166-1 alpha2 country code. The core will store this as a valid request and then query userspace for it."}, "@NL80211_CMD_SCHED_SCAN_RESULTS": {"attrs": [], "desc": "indicates results available."}, "@NL80211_CMD_REGISTER_BEACONS": {"attrs": [], "desc": "Register other BSSes when any interfaces are in AP mode. This helps implement OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME messages. Note that per PHY only one application may register."}, "@NL80211_CMD_NEW_BEACON": {"attrs": [], "desc": "old"}, "@NL80211_CMD_NOTIFY_CQM": {"attrs": [], "desc": "Connection command is used as an event to indicate the that a trigger level was reached."}, "@NL80211_CMD_TRIGGER_SCAN": {"attrs": ["%NL80211_ATTR_TX_NO_CCK_RATE"], "desc": "trigger %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the probe requests at CCK rate or not."}, "@NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_COOKIE"], "desc": "This pending remain-on-channel duration if the desired operation has been completed prior to expiration of the originally requested duration. %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the radio. The %NL80211_ATTR_COOKIE attribute must be given as well to uniquely identify the request. This command is also used as an event to notify when a requested remain-on-channel duration has expired."}, "@NL80211_CMD_REGISTER_FRAME": {"attrs": [], "desc": "Register (via @NL80211_CMD_FRAME) for processing in userspace. This command requires an interface index, a frame type attribute (optional for backward compatibility reasons, if not given assumes action frames) and a match attribute containing the first few bytes of the frame that should match, e.g. a single byte for only a category match or four bytes for vendor frames including the OUI. The registration cannot be dropped, but is removed automatically when the netlink socket is closed. Multiple registrations can be made."}, "@NL80211_CMD_CHANNEL_SWITCH": {"attrs": ["%NL80211_ATTR_CH_SWITCH_COUNT", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_CH_SWITCH_BLOCK_TX"], "desc": "Perform the new channel information (Channel Switch Announcement - CSA) in the beacon for some time (as defined in the %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the new channel. Userspace provides the new channel information (using %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform other station that transmission must be blocked until the channel switch is complete."}, "@NL80211_CMD_GET_INTERFACE": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX"], "desc": "Request either a dump request on a %NL80211_ATTR_WIPHY or a specific get on an %NL80211_ATTR_IFINDEX is supported."}, "@NL80211_CMD_RADAR_DETECT": {"attrs": ["%NL80211_ATTR_RADAR_EVENT"], "desc": "Start a radar is detected or the channel availability scan (CAC) has finished or was aborted, or a radar was detected, usermode will be notified with this event. This command is also used to notify userspace about radars while operating on this channel. %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the event."}, "@NL80211_CMD_GET_POWER_SAVE": {"attrs": [], "desc": "Get"}, "@NL80211_CMD_DISCONNECT": {"attrs": ["%NL80211_ATTR_DISCONNECTED_BY_AP", "%NL80211_ATTR_REASON_CODE"], "desc": "drop userspace that a connection was dropped by the AP or due to other reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and %NL80211_ATTR_REASON_CODE attributes are used."}, "@NL80211_CMD_CONNECT": {"attrs": ["%NL80211_ATTR_SSID", "%NL80211_ATTR_IE", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_USE_MFP", "%NL80211_ATTR_MAC", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_CONTROL_PORT", "%NL80211_ATTR_CONTROL_PORT_ETHERTYPE", "%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT", "%NL80211_ATTR_BG_SCAN_PERIOD"], "desc": "connection requests to connect to a specified network but without separating auth and assoc steps. For this, you need to specify the SSID in a %NL80211_ATTR_SSID attribute, and can optionally specify the association IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. Background scan period can optionally be specified in %NL80211_ATTR_BG_SCAN_PERIOD, if not specified default background scan configuration in driver is used and if period value is 0, bg scan will be disabled. This attribute is ignored if driver does not support roam scan. It is also sent as an event, with the BSSID and response IEs when the connection is established or failed to be established. This can be determined by the STATUS_CODE attribute."}, "@NL80211_CMD_SET_BEACON": {"attrs": ["%NL80211_ATTR_BEACON_HEAD", "%NL80211_ATTR_BEACON_TAIL", "%NL80211_ATTR_IE", "%NL80211_ATTR_IE_PROBE_RESP", "%NL80211_ATTR_IE_ASSOC_RESP"], "desc": "change using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. For drivers that generate the beacon and probe responses internally, the following attributes must be provided: %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP."}, "@NL80211_CMD_ACTION_TX_STATUS": {"attrs": [], "desc": "Alias backward compatibility."}, "@NL80211_CMD_JOIN_MESH": {"attrs": [], "desc": "Join mesh config parameters may be given."}, "@NL80211_CMD_ROAM": {"attrs": [], "desc": "request sent as an event when the card/driver roamed by itself."}, "@NL80211_CMD_SET_REG": {"attrs": ["%NL80211_ATTR_REG_ALPHA", "%NL80211_ATTR_REG_RULE_FREQ_", "%NL80211_ATTR_FREQ_RANGE_MAX_BW", "%NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN", "%NL80211_ATTR_REG_RULE_POWER_MAX_EIRP"], "desc": "Set after being queried by the kernel. CRDA replies by sending a regulatory domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our current alpha2 if it found a match. It also provides NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each regulatory rule is a nested set of attributes given by %NL80211_ATTR_REG_RULE_FREQ_[START|END] and %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP."}, "@NL80211_CMD_GET_COALESCE": {"attrs": [], "desc": "Get"}, "@NL80211_CMD_FRAME_WAIT_CANCEL": {"attrs": [], "desc": "When command may be used with the corresponding cookie to cancel the wait time if it is known that it is no longer necessary."}, "@NL80211_CMD_DEL_BEACON": {"attrs": [], "desc": "old"}, "@NL80211_CMD_LEAVE_IBSS": {"attrs": [], "desc": "Leave determined by the network interface."}, "@NL80211_CMD_SET_MCAST_RATE": {"attrs": [], "desc": "Change for IBSS or MESH vif."}, "@NL80211_CMD_TESTMODE": {"attrs": [], "desc": "testmode to identify the device, and the TESTDATA blob attribute to pass through to the driver."}, "@NL80211_CMD_DEL_MPATH": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Delete %NL80211_ATTR_MAC."}} diff --git a/pyric/docs/nlhelp.py b/pyric/docs/nlhelp.py index a523c8a..46a8603 100644 --- a/pyric/docs/nlhelp.py +++ b/pyric/docs/nlhelp.py @@ -1,10 +1,6 @@ #!/usr/bin/env python """ nlhelp.py: nl80211 help functions -A set of functions to assist in finding info on nl80211 commands and attributes. -These are stored in the "data" files commands.help and attributes.help which are -json files. - Copyright (C) 2016 Dale V. Patterson (wraith.wireless@yandex.com) This program is free software: you can redistribute it and/or modify it under @@ -23,6 +19,10 @@ contributors may be used to endorse or promote products derived from this software without specific prior written permission. +A set of functions to assist in finding info on nl80211 commands and attributes. +These are stored in the "data" files commands.help and attributes.help which are +json files. + """ __name__ = 'nlhelp' diff --git a/pyric/docs/res/PyRIC.bib b/pyric/docs/res/PyRIC.bib index 61e08ca..d4b702d 100644 --- a/pyric/docs/res/PyRIC.bib +++ b/pyric/docs/res/PyRIC.bib @@ -1,7 +1,3 @@ -% This file was created with JabRef 2.10b2. -% Encoding: UTF-8 - - @Misc{libnl, Title = {Netlink Library (libnl)}, Author = {Thomas Graf}, @@ -48,5 +44,4 @@ @Misc{gplv3 Shorthand = {GPL}, Url = {http://www.gnu.org/licenses/gpl.html}, Version = {3} -} - +} \ No newline at end of file diff --git a/pyric/docs/res/PyRIC.tex b/pyric/docs/res/PyRIC.tex index 418e92c..8e8e707 100644 --- a/pyric/docs/res/PyRIC.tex +++ b/pyric/docs/res/PyRIC.tex @@ -72,7 +72,7 @@ basicstyle=\footnotesize } -\title{PyRIC v0.0.7: User Manual} +\title{PyRIC v0.0.8: User Manual} \author{Dale V. Patterson\\ wraith.wireless@yandex.com} \begin{document} @@ -98,6 +98,7 @@ \section{About PyRIC}\label{sec:About} \item enumerate interfaces and wireless interfaces, \item get/set regulatory domain, \item get/set hw address, +\item get/set ip4, netmask and broadcast address \item identify a radio's chipset and driver, \item turn device on/off, \item get supported standards, @@ -656,6 +657,8 @@ \subsection{Constants} \item \textbf{\_FAM80211ID\_}: Global netlink family id of nl80211. Do not touch \item \textbf{IFTYPES}: redefined (from nl80211\_h.py) interface modes \item \textbf{MNTRFLAGS}: redefined (from nl80211\_h.py) monitor mode flags +\item \textbf{IPADDR}: Regular Expression for ip4 address validation +\item \textbf{MACADDR}: Regular Expression for mac address validation \end{itemize} \subsection{Objects/Classes} @@ -751,6 +754,9 @@ \subsection{Functions} \item devdel(card,[nlsock]): (iw card. del), type: netlink, deletes dev \begin{itemize} \item \_hex2mac\_(v): returns a ':' separated mac address from byte stream v +\item \_hex2ip4\_(v): returns a '.' separated ip4 address from byte stream v +\item \_validip4\_(addr): determines if addr is a valid ip4 address +\item \_validmac\_(addr): determines if addr is a valid mac address \item \_issetf\_(flags,flag): determines if flag is set in flags \item \_setf\_(flags,flag): set flag in flags to on \item \_unsetf\_(flags,flag): set flag in flags to off @@ -759,6 +765,8 @@ \subsection{Functions} \item \_ifindex\_(dev,[iosock]): returns dev's ifindex \item \_flagsget\_(dev,[iosock]): get's the dev's interface flags \item \_flagsset\_(dev,flags,[iosock]): set's the dev's interface flags +\item \_getfreqs\_(band): returns a list of frequencies from the packed byte string +band \item \_iostub\_(fct,*argv): ioctl stub function, calls fct with parameter list argv and an allocated ioctl socket \item \_nlstub\_(fct,*argv): netlink stub function, calls fct with parameter list diff --git a/pyric/lib/__init__.py b/pyric/lib/__init__.py index 8429e1e..b65ddbc 100644 --- a/pyric/lib/__init__.py +++ b/pyric/lib/__init__.py @@ -35,6 +35,7 @@ - remove nla_* from GENLMsg stand-alone functions as this was my original intent where the classes should only be 'placeholders', similar to C structs and not full blow objects + """ __name__ = 'lib' diff --git a/pyric/lib/libio.py b/pyric/lib/libio.py index 9ee0254..e6224c4 100644 --- a/pyric/lib/libio.py +++ b/pyric/lib/libio.py @@ -74,4 +74,4 @@ def io_transfer(iosock,flag,ifreq): else: raise pyric.error(pyric.EUNDEF,e) except Exception as e: - raise pyric.error(pyric.EUNDEF,e.args[0]) \ No newline at end of file + raise pyric.error(pyric.EUNDEF,e.args[0]) diff --git a/pyric/lib/libnl.py b/pyric/lib/libnl.py index b0713f1..b87d821 100644 --- a/pyric/lib/libnl.py +++ b/pyric/lib/libnl.py @@ -25,9 +25,8 @@ liberties with the below as these functions only handle nl80211 generic netlink messages. -see http://www.carisma.slowglass.com/~tgr/libnl/doc/core.html - Provides access to netlink sockets and messages in a manner similar to libnl. +see http://www.carisma.slowglass.com/~tgr/libnl/doc/core.html """ diff --git a/pyric/net/__init__.py b/pyric/net/__init__.py index 499c8e0..3b2cb56 100644 --- a/pyric/net/__init__.py +++ b/pyric/net/__init__.py @@ -32,6 +32,7 @@ o changed policies from list to dict o removed nle_error related as we use python errno o added ip4 to sockaddr and set ip4 to ifreq + """ __name__ = 'net' diff --git a/pyric/net/genetlink_h.py b/pyric/net/genetlink_h.py index 4ef1fc5..be29629 100644 --- a/pyric/net/genetlink_h.py +++ b/pyric/net/genetlink_h.py @@ -27,8 +27,8 @@ contributors may be used to endorse or promote products derived from this software without specific prior written permission. -A port of genetlink.h to python. Includes as well the nla_policy for generic -netlink attributes. +A port of genetlink.h to python and defines the nla_policy for generic netlink +attributes. """ diff --git a/pyric/net/if_h.py b/pyric/net/if_h.py index fd340d7..c4ed7ad 100644 --- a/pyric/net/if_h.py +++ b/pyric/net/if_h.py @@ -39,7 +39,8 @@ contributors may be used to endorse or promote products derived from this software without specific prior written permission. -A port of if.h, iw_param from wireless.h and sockaddr from socket.h to python +A port of if.h, with some definitions from iw_param, wireless.h and sockaddr +from socket.h to python Additionally 1) imports definitions from wireless_h to check if a nic is wireless and get @@ -50,8 +51,7 @@ __name__ = 'if_h' __license__ = 'GPLv3' -__version__ = '0.0.3Dark' \ - '' +__version__ = '0.0.3' __date__ = 'February 2016' __author__ = 'Dale Patterson' __maintainer__ = 'Dale Patterson' diff --git a/pyric/net/netlink_h.py b/pyric/net/netlink_h.py index d29f9a0..dab9830 100644 --- a/pyric/net/netlink_h.py +++ b/pyric/net/netlink_h.py @@ -320,20 +320,6 @@ def nlattrhdr(alen,atype): #NLA_HDRLEN = ((int) NLA_ALIGN(sizeof(struct nlattr))) # defined error codes -""" - For ease of use, I define netlink errors (netlink/errno.h) here - -/* - * netlink/errno.h Error Numbers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * Copyright (c) 2008 Thomas Graf - */ -""" # only use success and failure -> using errno for other error numbers NLE = ['Success','Unspecified failure'] NLE_SUCCESS = 0 diff --git a/pyric/net/policy.py b/pyric/net/policy.py index df4df7e..67f10ef 100644 --- a/pyric/net/policy.py +++ b/pyric/net/policy.py @@ -77,7 +77,7 @@ def nla_datatype(policy,attr): nla_dts["nl80211_attr"] = nl80211c.nl80211_policy -# ATT we do include the below +# ATT we do include the below as defined in nl80211_c #nla_dts["nl80211_key"] = nl80211c.nl80211_key_policy #nla_dts["nl80211_wowlan_trig"] = nl80211_wowlan_trig_policy #nla_dts["nl80211_wowlan_tcp"] = nl80211_wowlan_tcp_policy diff --git a/pyric/net/sockios_h.py b/pyric/net/sockios_h.py index 649d3a1..40f2125 100644 --- a/pyric/net/sockios_h.py +++ b/pyric/net/sockios_h.py @@ -52,10 +52,6 @@ __email__ = 'wraith.wireless@yandex.com' __status__ = 'Production' -# Linux-specific socket ioctls -#SIOCINQ = FIONREAD -#SIOCOUTQ = TIOCOUTQ # output queue size (not sent + not acked) - # Routing table calls SIOCADDRT = 0x890B # add routing table entry SIOCDELRT = 0x890C # delete routing table entry diff --git a/pyric/net/wireless/__init__.py b/pyric/net/wireless/__init__.py index 89464f2..d598680 100644 --- a/pyric/net/wireless/__init__.py +++ b/pyric/net/wireless/__init__.py @@ -18,10 +18,8 @@ contributors may be used to endorse or promote products derived from this software without specific prior written permission. -Linux header port nl80211.h, .c - - net 0.0.1 - desc: linux port of nl80211.h + wireless 0.0.1 + desc: linux port of nl80211.h, nl80211.c includes: nl80211_h 0.0.2 nl80211_c 0.0.1 changes: o added nl80211_c to handle attribute policies diff --git a/pyric/net/wireless/nl80211_c.py b/pyric/net/wireless/nl80211_c.py index e371326..d9b96a2 100644 --- a/pyric/net/wireless/nl80211_c.py +++ b/pyric/net/wireless/nl80211_c.py @@ -285,56 +285,3 @@ # nl80211h.NL80211_SCHED_SCAN_PLAN_INTERVAL:nlh.NLA_U32, # nl80211h.NL80211_SCHED_SCAN_PLAN_ITERATIONS:nlh.NLA_U32 #} - -def nl80211_parse_freqs(bands): - """ - extracts frequencies from bands - :param bands: packed bytes containing band data - :returns: list of frequencies found in bands - hack for parsing NL80211_ATTR_WIPHY_BANDS to extract supported frequencies - - Each band (or frequency list) begins with \x01\x01 (\x01 = NL80211_BAND_ATTR_FREQS) - - Each freq appears to be listed as - - +-------+-----+-------+------+-----+-----+-------+ - | buff1 | RF | [unk] |buff2 | freq data | [pad] | - +-------+-----+-------+------+-----+-----+-------+ - 9 4 7 4 1 - - where buff1 = - - +------+-----+------+-----+----------------------+ - | \x00 | | \x00 | cnt | \x00\x08\x00\x01\x00 | - +------+-----+------+-----+----------------------+ - - such that f is some unknown flag or value (have currently seen \x14 and - \x1c) and cnt is the number (starting at 0) of the current freq - - unk = \x04\x00\x03\x00\x04\x00\x04 - - and - - buff2 = \x08\x00\x06\x00 - - Works on single band ISM radios but does not extract all freqs for UNII - """ - bands = bands[bands.find('\x01\x01'):] - - cnt = 0 - rfs = [] - while True: - # pull out the freq - cur = "\x00{0}\x00\x08\x00\x01\x00".format(struct.pack("B",cnt)) - idx = bands.find(cur) - if idx < 0: break - idx += len(cur) - rfs.append(struct.unpack_from("I",bands,idx)[0]) - bands = bands[idx:] - - # move to the end of freq data - end = "\x08\x00\x06\x00" - bands = bands[bands.find(end)+len(end):] - - cnt += 1 - return rfs \ No newline at end of file diff --git a/pyric/net/wireless/nl80211_h.py b/pyric/net/wireless/nl80211_h.py index ca393e7..e84f4af 100644 --- a/pyric/net/wireless/nl80211_h.py +++ b/pyric/net/wireless/nl80211_h.py @@ -47,7 +47,7 @@ NOTE: 1. Most of these constants are not used but are left for possible future use - 2. I have removed *_AFTER_LAST and only kept MAX_* for enums for those nums + 2. Have removed *_AFTER_LAST and only kept MAX_* for enums for those nums """ __name__ = 'nl80211_h' diff --git a/pyric/pyw.py b/pyric/pyw.py index a8bc95b..5af35e0 100644 --- a/pyric/pyw.py +++ b/pyric/pyw.py @@ -708,7 +708,7 @@ def phyinfo(card, *argv): :returns: dict with the following key:value pairs generation -> wiphy generation modes -> list of supported modes - bands -> list of supported bands (still working on unpacking) + freqs -> list of supported freqs scan_ssids -> max number of scan SSIDS retry_short -> retry short limit retry_long -> retry long limit @@ -743,7 +743,7 @@ def phyinfo(card, *argv): 'retry_long':None, 'frag_thresh':None, 'rts_thresh':None, 'cov_class':None, 'swmodes':None, 'commands':None} # singular attributes - info['bands'] = nl.nla_find(rmsg, nl80211h.NL80211_ATTR_WIPHY_BANDS) + info['freqs'] = _getfreqs_(nl.nla_find(rmsg, nl80211h.NL80211_ATTR_WIPHY_BANDS)) info['generation'] = nl.nla_find(rmsg, nl80211h.NL80211_ATTR_GENERATION) info['retry_short'] = nl.nla_find(rmsg, nl80211h.NL80211_ATTR_WIPHY_RETRY_SHORT) info['retry_long'] = nl.nla_find(rmsg, nl80211h.NL80211_ATTR_WIPHY_RETRY_LONG) @@ -1164,6 +1164,21 @@ def _iftypes_(i): except IndexError: return "Unknown mode ({0})".format(i) +def _getfreqs_(band): + """ + extract list of supported freqs packed byte stream band + :param band: packed byte string from NL80211_ATTR_WIPHY_BANDS + :returns: list of supported frequencies + + NOTE: this is an inefficient hack until I can get the parsing of the + *_WIPHY_BANDS functional + """ + rfs = [] + for freq in channels.freqs(): + if band.find(struct.pack("I", freq)) != -1: + rfs.append(freq) + return rfs + #### TRANSLATION FUNCTIONS #### def _iostub_(fct, *argv): diff --git a/setup.cfg b/setup.cfg index 8235868..298f1e6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,3 @@ [bdist_wheel] - universal=1 description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py index 28b57a0..a340626 100644 --- a/setup.py +++ b/setup.py @@ -32,8 +32,6 @@ __status__ = 'Development' from setuptools import setup, find_packages -#from codecs import open -#from os import path import pyric