/*
* Wireless Tools
*
- * Jean II - HPLB 97->99 - HPL 99->04
+ * Jean II - HPLB 97->99 - HPL 99->07
*
* Main code for "iwconfig". This is the generic tool for most
* manipulations...
* You need to link this code against "iwlib.c" and "-lm".
*
* This file is released under the GPL license.
- * Copyright (c) 1997-2004 Jean Tourrilhes <jt@hpl.hp.com>
+ * Copyright (c) 1997-2007 Jean Tourrilhes <jt@hpl.hp.com>
*/
-#include "iwlib.h" /* Header */
+#include "iwlib-private.h" /* Private header */
/************************** DOCUMENTATION **************************/
iw_usage(void)
{
fprintf(stderr, "Usage: iwpriv interface [private-command [private-arguments]]\n");
- fprintf(stderr, " interface [roam {on|off}]\n");
- fprintf(stderr, " interface [port {ad-hoc|managed|N}]\n");
}
/************************* SETTING ROUTINES **************************/
int offset = 0; /* Space for sub-ioctl index */
/* Check if we have a token index.
- * Do it now so that sub-ioctl takes precendence, and so that we
+ * Do it now so that sub-ioctl takes precedence, and so that we
* don't have to bother with it later on... */
if((count >= 1) && (sscanf(args[0], "[%i]", &temp) == 1))
{
printf("Invalid float [%s]...\n", args[i]);
return(-1);
}
- if(index(args[i], 'G')) freq *= GIGA;
- if(index(args[i], 'M')) freq *= MEGA;
- if(index(args[i], 'k')) freq *= KILO;
+ if(strchr(args[i], 'G')) freq *= GIGA;
+ if(strchr(args[i], 'M')) freq *= MEGA;
+ if(strchr(args[i], 'k')) freq *= KILO;
sscanf(args[i], "%i", &temp);
iw_float2freq(freq, ((struct iw_freq *) buffer) + i);
}
break;
default:
- fprintf(stderr, "Not yet implemented...\n");
+ fprintf(stderr, "Not implemented...\n");
return(-1);
}
if((priv[k].set_args & IW_PRIV_SIZE_FIXED) &&
(wrq.u.data.length != (priv[k].set_args & IW_PRIV_SIZE_MASK)))
{
- printf("The command %s need exactly %d argument...\n",
+ printf("The command %s needs exactly %d argument(s)...\n",
cmdname, priv[k].set_args & IW_PRIV_SIZE_MASK);
return(-1);
}
}
else
{
- /* Thirst case : args won't fit in wrq, or variable number of args */
+ /* Third case : args won't fit in wrq, or variable number of args */
wrq.u.data.pointer = (caddr_t) buffer;
wrq.u.data.flags = subcmd;
}
if(j)
printf(" %.*s",
(int) strlen(cmdname), " ");
- printf("%s\n", iw_pr_ether(scratch, hwa->sa_data));
+ printf("%s\n", iw_saether_ntop(hwa, scratch));
}
}
break;
}
else
{
- printf("%-8.16s Available private ioctl :\n", ifname);
+ printf("%-8.16s Available private ioctls :\n", ifname);
/* Print them all */
for(k = 0; k < n; k++)
if(priv[k].name[0] != '\0')
* Convenient access to some private ioctls of some devices
*/
+#if 0
/*------------------------------------------------------------------*/
/*
* Set roaming mode on and off
free(priv);
return(-1);
}
+#endif
/******************************* MAIN ********************************/
(!strcmp(argv[2], "--all")))
print_priv_all(skfd, argv[1], NULL, 0);
else
+#if 0
/* Roaming */
if(!strncmp(argv[2], "roam", 4))
goterr = set_roaming(skfd, argv + 3, argc - 3, argv[1]);
if(!strncmp(argv[2], "port", 4))
goterr = port_type(skfd, argv + 3, argc - 3, argv[1]);
else
+#endif
/*-------------*/
/* Otherwise, it's a private ioctl */
goterr = set_private(skfd, argv + 2, argc - 2, argv[1]);