Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, I am working on a small C program that should be able to scan for wifi networks and give JSON output. I know the same thing might be ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2014
    Posts
    2

    C library IW - Network scan: how to retrive auth types of a network?


    Hi all,

    I am working on a small C program that should be able to scan for wifi networks and give JSON output. I know the same thing might be acheived by using iwlist (compiled binary) by parsing the output and assemble it into a json string within a shell script, but for computational needs, I want to use plain C.

    To do so, I am now using iwlib.c and json.c libraries.
    I was able to use the iw_scan() function and retrive a list of networks. However, I can only get ESSID, signal quality and some other info, but nothing about AUTHENTICATION TYPE. What I need is to know which auth type does that AP require. Which methods of IW lib whould I use?

    Thankl you,

    Alberto.

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,486
    Have you downloaded wireless tools? I don't think iwlib.c has all that you need.
    Wireless Tools for Linux

  3. #3
    Just Joined!
    Join Date
    Jun 2014
    Posts
    2

    yep

    Hi,

    of course I did. However, the routine

    iw_process_scanning_token

    is not taking care of parsing auth types. So I don't know which network is WPA protected, which is WPA2 protected and so on.
    Any suggestion?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,486
    Have a look at iwlist.c

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •