:: Re: [DNG] simple-netaid from scratc…
Top Pagina
Delete this message
Reply to this message
Auteur: aitor_czr
Datum:  
Aan: dng
Onderwerp: Re: [DNG] simple-netaid from scratch
Hi Edward,

On 15/5/19 13:10, Edward Bartolo via Dng wrote:
> Hi Aitor,
>
> I, like many other Devuan users, hope that the last crises is over and
> that it will never happen again. The purpose of replying to your
> thread is to ask why you are rewriting the backend from the very
> beginning.

I started rewriting the backend from the very begining due to some
failures in the connection status systray icon and also in the
connection attempts.
But i started again rewriting it from scratch due to a wrong approach.
Today i pushed to gitlab the client/server unix socket, and I'm happy
with the result.

You can test it running the server in a secondary plane:

$ ./server &

and running the client below:

$ ./client

getting the info about the network connection status at every second,
something like this:

Connected to wlp1s0
DEVICE_TYPE=Wireless
IP Address=192.168.0.10
BROADCAST=192.168.0.255
NETMASK=255.255.255.0
PROTOCOL=IEEE 802.11
ESSID=Euskaltel-58YA
QUALITY=94%

Have a look at the server side:

https://git.devuan.org/aitor_czr/simple-netaid/blob/master/backend_src/server.c

concretly to the writeFileDescriptor ( int df, struct sbuf s ) function.
It works as follows:

- iproute(&s) gives the first line of the output in the command line,
that is: "Connected to <device>" or "Disconnected"

- In the case of a conneted state, netproc(&s) will give us the
information about the network connection, the rest of the output in the
command line.

I still didn't add the Mac address because the code (using
"g_strdup_printf") requires Glib:

https://git.devuan.org/aitor_czr/simple-netaid/blob/master/backend_src/netstat.c

and i'm trying to avoid it (not for any specific reason).

> Needless to state, I am still using my version of
> simple-netaid with its simple graphical interface. However, this does
> not mean I will not consider better competitors.


We must think on the devuan project, we hate narcissism :)

Cheers,

Aitor.