What's new

Understanding the router's FB wifi source code

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

hanusiak

New Around Here
Hello,

I'm just starting to dig around in the source code of Merlin.
I'm trying to get my head around the FB wificode and how it handles the communication with facebook.

I started by looking at the router/rc/lan.c where FB is handled:
#ifdef RTCONFIG_FBWIFI
void stop_fbwifi_check()
{
killall("fb_wifi_check", SIGTERM);
}
void start_fbwifi_check()
{
char *fbwifi_argv[] = {"fb_wifi_check",NULL};
pid_t pid;

_eval(fbwifi_argv, NULL, 0, &pid);
}

void restart_fbwifi_register()
{
char *fbwifi_argv[] = {"fb_wifi_register",nvram_get("wl_unit"),nvram_get("wl_subunit"),NULL};
pid_t pid;

_eval(fbwifi_argv, NULL, 0, &pid);
}
#endif


The first hurdle that I found was that I could not find anywhere the definition of fb_wifi_check or fb_wifi_register.

I found in router/Makefile following section:
#fbwifi
fb_wifi/stamp-h1:
touch $@

fb_wifi: curl fb_wifi/stamp-h1
@$(MAKE) -C fb_wifi

fb_wifi-install: fb_wifi
@$(SEP)
install -D fb_wifi/fb_wifi_check $(INSTALLDIR)/fb_wifi/usr/sbin/fb_wifi_check
install -D fb_wifi/fb_wifi_register $(INSTALLDIR)/fb_wifi/usr/sbin/fb_wifi_register
install -D fb_wifi/libfbwifi.so $(INSTALLDIR)/fb_wifi/usr/lib/libfbwifi.so
$(STRIP) $(INSTALLDIR)/fb_wifi/usr/sbin/fb_wifi_check
$(STRIP) $(INSTALLDIR)/fb_wifi/usr/sbin/fb_wifi_register
$(STRIP) $(INSTALLDIR)/fb_wifi/usr/lib/libfbwifi.so

fb_wifi-clean:
-@$(MAKE) -C fb_wifi clean
rm -rf fb_wifi/stamp-h1



I somehow have the feeling that these are proprietary utils maybe from facebook. I searched through the git repository but to no avail ... I can not find any definition of these utils

Who can help ?

Peter
 
I believe that code is obsolete. Asus stopped supporting it years ago so it's possible that parts of the code aren't included anymore.

I can tell you it is pretty active via my PIHOLE. I see the traffic coming from the Router.
1640653397588.png

This is coming straight from the router, (not a separate client via the router.). Why does Asuswrt need to request DNS from graph.facebook-hardware.com?
 
I believe that code is obsolete. Asus stopped supporting it years ago so it's possible that parts of the code aren't included anymore.

I see what you are saying, however it is odd that fb_wifi code was added into Merlin since Dec 28, 2016 and since that time is still there. Nobody removed it.
I found it here in this commit. Merged with GPL 380_4180 (missing MIPS and AC3200 binary blobs) · RMerl/asuswrt-merlin@2ade828 · GitHub

fb_wifi tools are still missing. Where do they come from?
 
I see what you are saying, however it is odd that fb_wifi code was added into Merlin since Dec 28, 2016 and since that time is still there. Nobody removed it.
I found it here in this commit. Merged with GPL 380_4180 (missing MIPS and AC3200 binary blobs) · RMerl/asuswrt-merlin@2ade828 · GitHub

fb_wifi tools are still missing. Where do they come from?
That's the old repository for 380 which is not maintained anymore. RMerlin moved to a newer code base and here's the repository for it: https://github.com/RMerl/asuswrt-merlin.ng
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top