Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gluon independent respondd-wifi package #217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

genofire
Copy link
Contributor

No description provided.

@rotanid
Copy link
Member

rotanid commented Apr 13, 2019

@genofire have you changed anything besides the name?
@NeoRaider basically we diff if the code stays the same and merge it?

@genofire
Copy link
Contributor Author

Remove a lot of parts, which ware not necessary to run it in a minimal version to keep fit with the current state of gluon. (but yes, it is nearly the same then #188)

Copy link
Member

@neocturne neocturne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found a number of issues; unfortunately, some of them will require conceptual changes. I don't think we want to iterate over all wireless interfaces anywhere in Gluon - it should always be limited to the interfaces we actually use for meshing, or the interfaces we use for mesh clients. This makes a respondd provider that is completely independent of Gluon's internals infeasible.


clients = json_object_new_object();
if (!clients) {
json_object_put(wireless);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no wireless variable in this function, did you compile test this?


while (ifaces != NULL) {

if(ifaces->type != NL80211_IFTYPE_ADHOC)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about MESH_POINT?

Also, missing space before opening parenthesis.

free(freeptr);
}

//TODO maybe skip: if (wifi24 > 0 || wifi5 > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to skip if no AP interfaces were found at all.

//TODO maybe skip: if (wifi24 > 0 || wifi5 > 0) {
json_object_object_add(clients, "wifi24", json_object_new_int(wifi24));
json_object_object_add(clients, "wifi5", json_object_new_int(wifi5));
json_object_object_add(result, "clients", clients);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not sure if it really makes sense to count the clients in a generic respondd module after all. Since freifunk-gluon/gluon@b850fff, "wifi" is computed from "wifi24" and "wifi5" as well - which would need to be moved into this module as well; but the computation of "total" depends on "wifi" now.

A different approach would be to move this query into a reusable library included by both gluon-mesh-... respondd providers...

}

if (ifaces->frequency)
json_object_object_add(station, "frequency", json_object_new_int(ifaces->frequency));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frequency does not belong in the "neighbours" respondd object. If anything, nodeinfo would be the correct place (but let's not discuss extensions of the current format in this PR, but rather keep the exact output that is currently produced by gluon-mesh-*)

ifaces = get_ifaces();
while (ifaces != NULL) {
if(ifaces->type != NL80211_IFTYPE_AP)
goto next_statistics;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also include AP interfaces that are not used for mesh clients (for example the private-wifi interface). Another reason to only provide this as a library for the gluon-mesh-* respondd providers rather than an independent module.

next_statistics: ;
void *freeptr = ifaces;
ifaces = ifaces->next;
free(freeptr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The memory handling in both loops processing the get_ifaces() output is quite ugly. I think a for_each_iface() taking a callback function would be much nicer, as we could avoid building a list of all interfaces in memory.

@rotanid
Copy link
Member

rotanid commented Jun 26, 2019

@genofire do you plan to work on the feedback you got?

@rotanid
Copy link
Member

rotanid commented Sep 16, 2019

@genofire do you plan to work on the feedback you got?

any feedback possible? :)

@genofire
Copy link
Contributor Author

oh sry, miss it -> my fault - was just looking for #189 and thought it was not anymore possible to disable it in batman that it does not have any collision ....

I will work on it on Monday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants