-static void madwifi_proc_file(const char *ifname, const char *file,
- char *buf, int blen)
-{
- int fd;
- const char *wifi = madwifi_isvap(ifname, NULL);
-
- if (!wifi && madwifi_iswifi(ifname))
- wifi = ifname;
-
- snprintf(buf, blen, "/proc/sys/dev/%s/%s", wifi, file);
-
- if ((fd = open(buf, O_RDONLY)) > 0)
- {
- if (read(fd, buf, blen) > 1)
- buf[strlen(buf)-1] = 0;
- else
- buf[0] = 0;
-
- close(fd);
- }
- else
- {
- buf[0] = 0;
- }
-}
-
-static int madwifi_startswith(const char *a, const char *b)
-{
- int l1 = strlen(a);
- int l2 = strlen(b);
- int ln = (l1 < l2) ? l1 : l2;
- return !strncmp(a, b, ln);
-}
-