static int wlc_iovar(wlc_param param, void *data, void *value) { int *val = (int *) value; char *iov = *((char **) data); int ret = 0; if (param & SET) { switch(param & PARAM_TYPE) { case INT: ret = wl_iovar_setint(interface, iov, *val); break; case MAC: ret = wl_iovar_set(interface, iov, value, 6); break; } } if (param & GET) { switch(param & PARAM_TYPE) { case INT: ret = wl_iovar_getint(interface, iov, val); break; case MAC: ret = wl_iovar_get(interface, iov, value, 6); break; } } return ret; }
bool wl_wlif_is_psta(char *ifname) { int32 psta = FALSE; if (wl_probe(ifname) < 0) return FALSE; wl_iovar_getint(ifname, "psta_if", &psta); return psta ? TRUE : FALSE; }
static int wlc_afterburner(wlc_param param, void *data, void *value) { int *val = (int *) value; int ret = 0; if ((param & PARAM_MODE) == GET) { ret = wl_iovar_getint(interface, "afterburner", val); } else { wl_iovar_setint(interface, "wlfeatureflag", (*val ? 3 : 0)); ret = wl_iovar_setint(interface, "afterburner", (*val ? 1 : 0)); wl_iovar_setint(interface, "afterburner_override", *val); } return ret; }
int get_rts_threshold(int *value) { char *iov_type; iov_type=malloc(20*sizeof(char)); strcpy(iov_type,"rtsthresh"); if(wl_iovar_getint(interface, iov_type, value) < 0) { perror("Ioctl error"); return(0); } printf("\nRTS/CTS threshold: %d\n", *value); return 1; }
int get_maxassoc(int *value) { char *iov_type; iov_type=malloc(20*sizeof(char)); strcpy(iov_type,"maxassoc"); if(wl_iovar_getint(interface, iov_type, value) < 0) { perror("Ioctl error"); return(0); } printf("\nMax. number of associated clients: %d\n", *value); return 1; }
int get_frag_threshold(int *value) { char *iov_type; iov_type=malloc(20*sizeof(char)); strcpy(iov_type,"fragthresh"); if(wl_iovar_getint(interface, iov_type, value) < 0) { perror("Ioctl error"); return(0); } printf("\nFragmentation threshold: %d\n", *value); return 1; }