C where / how to get WiFi information access programmability in FreeBSD?

Hello, I am running e16 on FreeBSD (obviously) and if you don't know they have some add ons called epplets which are dockapps that only work on e16. On Linux I've always modified them easily but replacing everywhere in whatever files it pertains to (only 3 files) the 'eth0' with 'wlan0' compliled then installed and they operate off of the wifi information.

With FreeBSD not so easy as that does not work, I've tried wlan0 and em0 to replace eth0 and neither work, and even the wifi one they have for it there is no '/proc/net/wireless' . so where is FreeBSD hiding this access to the information?
Code:
static void
load_conf(void)
{
   const char         *s;

   s = Epplet_query_config_def("upstream_max", "1540000");
   upstream_max = (double)atof(s);

   s = Epplet_query_config_def("downstream_max", "1540000");
   downstream_max = (double)atof(s);

   netdev = Epplet_query_config_def("device", "wlan0");
}
and this
Code:
 fpStat = fopen("/proc/net/wireless", "r");
   if (fpStat)
     {
    fgets(s, sizeof(s), fpStat);
    fgets(s, sizeof(s), fpStat);
    fgets(s, sizeof(s), fpStat);
Don't work
 
Rather than scraping files in proc, You can get i.e the interfaces via the sysctl(3) interfaces in C.

If you prefer to scrape stuff (I tend to when dealing with awk/sh), then wpa_cli(8) is pretty stable (or even ifconfig(8)).

Going back to C, check out the ifconfig.c source code to see how to access all the info. It isn't too complex luckily. Looking through now, it seems like we even have libifconfig these days which I thought was 3rd party when I looked some years ago. Glad to see they have integrated it.
 
Rather than scraping files in proc, You can get i.e the interfaces via the sysctl(3) interfaces in C.

If you prefer to scrape stuff (I tend to when dealing with awk/sh), then wpa_cli(8) is pretty stable (or even ifconfig(8)).

Going back to C, check out the ifconfig.c source code to see how to access all the info. It isn't too complex luckily. Looking through now, it seems like we even have libifconfig these days which I thought was 3rd party when I looked some years ago. Glad to see they have integrated it.
again I didn't write the code I am just (hacking it) modifing existing code to work. but thanks for the lead on sysctl and ifconfig
 
Back
Top