I'm working on implementing iwlist python version. Here is a description of how iwlist works on Linux OS How does iwlist() command scans the wireless networks? what it does is to scan all nearby wifi access points, show a list of their ESSID, MAC address, signal/noise level, etc.
iwlist uses ioctl SIOCSIWSCAN to trigger a scan. Then it uses SIOCGIWSCAN to get scan results. For security reason I have to implement this without root access. But both these two command have to be run as root. The python equivalent iwlist has been implemented already http://pythonwifi.wikispot.org/ However it uses the same ioctl.
I'm wondering if it is possible to work around this without sudo. Or, besides ioctl, if there's other ways to implement a non-sudo iwlist.