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; }
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; }
/*--------------------------- Fragmentation Threshold ---------------------------*/ int set_frag_threshold(int value) { char *iov_type; iov_type=malloc(20*sizeof(char)); strcpy(iov_type,"fragthresh"); if(wl_iovar_setint(interface, iov_type, value) < 0) { perror("Ioctl error"); return(0); } printf("\nFragmentation threshold impostato a: %d\n",value); return 1; }
/*--------------------------- Max. number of associated clients ---------------------------*/ int set_maxassoc(int value) { char *iov_type; iov_type=malloc(20*sizeof(char)); strcpy(iov_type,"maxassoc"); if(wl_iovar_setint(interface, iov_type, value) < 0) { perror("Ioctl error"); return(0); } printf("\nMax. number of associated clients impostato a: %d\n",value); return 1; }