Re: [DNG] simple-netaid-gtk is comming soon

2018-07-21 Thread aitor_czr

Hi Edward,

... and sorry for my delay.

El 09/07/18 a las 17:44, Edward Bartolo escribió:

Aitor, aitor whose netaid is going to be preferred?


I'll follow working on the same backend you started and using also some 
services of ifup, ifdown..., but a shared library would simplify the 
code a lot.

Here you are, for example, some advantages of the use of this library:

1) This library removes the dependency on some services like, for 
example, iwlist.


2) It also fixes an existent bug in the status icon of both 
simple-netaid and wicd projects (and surelly also existent in 
network-manager, i' ve not used it for a long time).


3) It solves the problem of the renamed network devices.


  What did you do to
the 'infamous' SUID backend? Did you add functions to it? Have you
completely revamped it with completely new code and a different
algorithms?


I still didn't arrive to the part of the algoritms (automated_scanner?). 
As i mentioned above, i'm working on the shared library and its 
existence obviously will affect to the code of the backend.

Here you are an example about how to use this library in a C code file:



/***  BEGIN  **/

#include 

int main()
{
    netstat *ns; // struct defined in netstat.h

    ns = g_new0(netstat, 1);
    if(!ns) {
        printf("Memory failure\n");
        exit( EXIT_FAILURE );
    }

    ns->fnetd = (FNETD*)malloc(sizeof(FNETD));
    ns->fnetd->netdevlist = (NETDEVLIST*)malloc(sizeof(NETDEVLIST));


    netinfo(ns->fnetd->netdevlist);    // THIS LINE DOES THE WORK ! !


    / * *
      *  And now we can get the netdev information:

    // The name of the wired device:
    GString *wired_device =  g_string_new 
(ns->fnetd->netdevlist->info.wired_device_name);


    // The name of the wireless device:
    GString *wireless_device = g_string_new 
(ns->fnetd->netdevlist->info.wireless_device_name);


    // Are we connected or disconnected?
    gboolean connected = ns->fnetd->netdevlist->info.connected;

// Is the wire plugged or unplugged?
    gboolean plugged = ns->fnetd->netdevlist->info.plug;

    // The label of the status of the network connection will be 
something like: "Connected to wlan2 Euskaltel-58YA (90%)"

GString *label = g_string_new (ns->fnetd->netdevlist->info.label);
     / *
       *  etc
       *  */


 // Free the memory:

    if(ns->fnetd->netdev_fp) netproc_close(ns->fnetd->netdev_fp);
    netproc_netdevlist_clear(ns->fnetd->netdevlist);
    free(ns->fnetd->netdevlist); 
//netproc_netdevlist_clear(ns->fnetd->netdevlist);

    free(ns->fnetd);

    return 0;
}

/*** END   **/



SOME COMMENTS:

- The scan_active_wifis() will not be included in the shared library. It 
requires granted permissions and will be included in the SUID backend.


- The function "netinfo(NETDEVLIST*)" will do the work in the 
"window_main_worker_thread" class. It uses sockets following the 
internet protocols, and also uses some features of Alexey Kuznetsov's 
NETLINK and iproute2 projects.


- The lines above this funcion will be included in the constructor of 
the "window_main_worker_thread" class, and the memory will be destroyed 
only when the worker thread's standing up.


- The shared library will be written in C, but the SUID backend of 
simple-netaid might be rewritten in C++




I say 'Sorry' to Devuan for being absent almost regularly but at the
moment I am indisposed. At least, I had quite good fruit harvests for
this year. So, life for me is not as dark as it may seem.


I'm glad the plague of armadillos didn't affect to your fruit harvests :-P


I am still using my dear Devuan (ASCII): I don't think I have enough
patience to return to MS Windows, too many 'verboten' freedoms in
that!



Cheers,

    Aitor.



___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] New user of Devuan

2018-07-21 Thread Miroslav Skoric

Hi,

I suppose that this list is the right place to ask for help related to 
Devuan. (If it is not, let me know. Tnx.)


Recently I installed Devuan Jessie live to a spare machine, just to test 
it for a while, since I wasn't much happy after upgrading some of my 
systems from Debian Wheezy LTS to Debian Jessie (regarding some systemd 
issues, you bet). And although I had some previous experience with LXDE 
GUI, I faced to some issues:


1. How to add a language switch (notification) after OS installation? I 
suppose that I had opted for the US English keyboard and everything 
during the installation. However, now I would like to add some more 
keyboard stuff for local users, such as Serbian Cyrillic & Latin, 
German, etc. but dunno how to do it. The comp is not on the Internet.


2. After inserting a CD/DVD into the comp's drive, it gets recognized 
and is used properly. However, probably I missed to find an easy way to 
eject the medium from the drive. Any simple solution (without much 
unmounting or like in CLI or so)? The comp should be used primarily to 
make Linux popular among the elderly visitors of a seniors' club.


Thanks for now!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng