:: Re: [DNG] libnetaid-0.1
Inizio della pagina
Delete this message
Reply to this message
Autore: aitor
Data:  
To: dng
Oggetto: Re: [DNG] libnetaid-0.1
Hi again,

On 1/3/20 22:36, aitor wrote:
>
> Hi all,
>
> The shared library of simple-netaid is ready for use.
> Here you are the packages for devuan beowulf in amd64:
>
> http://gnuinos.org/libnetaid/
>
> Install all the packages and  write the following simple program:
>
> _______________________________
>
> #include <backend.h>
>
> int main (int argc, char **argv)
> {
>     print_active_wifis(argv[1]);
>     return 0;
> }
>
> _______________________________
>
> You can build it linking the shared library and the headers with the
> following flags:
>
> $ gcc main.c -o main -lnetaid
> -I/usr/include/x86_64-linux-gnu/simple-netaid
>
> Maybe  first of all you will need to update the ld cache via:
>
> $ sudo ldconfig
>
> Now, if you run the binary:
>
> $ sudo ./main wlan0
>
> you will get all the available active wifis (replace wlan0 by your
> <wireless_device>.
>
> The above program is a very simple example, but shortly i will
> document the usage
> of this library and some functions like, for example:
>
> bool is_plugged(const char *device);
> void show_devices();
> void interface_up(const char *device);
> void interface_down(const char *device);
> void ifup(const char *device);
> void ifdown(const char *device);
> void print_active_wifis(const char *device);
> void wired_connection(const char *device);
> void wireless_connection(const char *device, const char *essid, const
> char *password);
> void show_network_connection();
> void disconnect(const char *device);
>
> etc...
>
> Cheers,
>
> Aitor.
>

I fixed a bug related with the wireless_connection and uploaded the new
packages.

You can test this function building the following code:


______________________________________________

#include <backend.h>

int main (int argc, char **argv)
{
    wireless_connection(argv[1], argv[2], argv[3]);
    return 0;
}

_______________________________________________


and running:

$ sudo ./main wlan0 <essid> <password>

It's working for me without failures.

Cheers,

Aitor.