I'm trying to write a C program to perform a site scan on my embedded board and give me a list of SSIDs with their encryption type after which I use uci to write the info into /etc/config/wireless.
I'm following the example set by iwlist. When I try to get the encryption type however, my code segfaults when accessing a pointer returned as part of struct iw_point. This struct is returned as part of iw_event IWEVGENIE on performing an ioctl to SIOCGIWSCAN. I have been stuck on this for about a week now and I have confirmed that these are essentially the same steps carried out by iwinfo and wpa_supplicant to get information about active SSIDs.
Any guidance on this problem is highly appreciated.
Thanks
Aravind