aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifieee80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifieee80211.c')
-rw-r--r--sbin/ifconfig/ifieee80211.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 031dc8f03b4d..6f83de077407 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -286,6 +286,36 @@ set80211nwkey(const char *val, int d, int s, const struct afswtch *rafp)
}
void
+set80211rtsthreshold(const char *val, int d, int s, const struct afswtch *rafp)
+{
+ set80211(s, IEEE80211_IOC_RTSTHRESHOLD, atoi(val), 0, NULL);
+}
+
+void
+set80211protmode(const char *val, int d, int s, const struct afswtch *rafp)
+{
+ int mode;
+
+ if (strcasecmp(val, "off") == 0) {
+ mode = IEEE80211_PROTMODE_OFF;
+ } else if (strcasecmp(val, "cts") == 0) {
+ mode = IEEE80211_PROTMODE_CTS;
+ } else if (strcasecmp(val, "rtscts") == 0) {
+ mode = IEEE80211_PROTMODE_RTSCTS;
+ } else {
+ err(1, "unknown protection mode");
+ }
+
+ set80211(s, IEEE80211_IOC_PROTMODE, mode, 0, NULL);
+}
+
+void
+set80211txpower(const char *val, int d, int s, const struct afswtch *rafp)
+{
+ set80211(s, IEEE80211_IOC_TXPOWER, atoi(val), 0, NULL);
+}
+
+void
ieee80211_status (int s, struct rt_addrinfo *info __unused)
{
int i;
@@ -380,6 +410,42 @@ ieee80211_status (int s, struct rt_addrinfo *info __unused)
printf("\n");
+ spacer = '\t';
+ ireq.i_type = IEEE80211_IOC_RTSTHRESHOLD;
+ if (ioctl(s, SIOCG80211, &ireq) != -1) {
+ printf("%crtsthreshold %d", spacer, ireq.i_val);
+ spacer = ' ';
+ }
+
+ ireq.i_type = IEEE80211_IOC_PROTMODE;
+ if (ioctl(s, SIOCG80211, &ireq) != -1) {
+ printf("%cprotmode", spacer);
+ switch (ireq.i_val) {
+ case IEEE80211_PROTMODE_OFF:
+ printf(" OFF");
+ break;
+ case IEEE80211_PROTMODE_CTS:
+ printf(" CTS");
+ break;
+ case IEEE80211_PROTMODE_RTSCTS:
+ printf(" RTSCTS");
+ break;
+ default:
+ printf(" UNKNOWN");
+ break;
+ }
+ spacer = ' ';
+ }
+
+ ireq.i_type = IEEE80211_IOC_TXPOWER;
+ if (ioctl(s, SIOCG80211, &ireq) != -1) {
+ printf("%ctxpower %d", spacer, ireq.i_val);
+ spacer = ' ';
+ }
+
+ if (spacer != '\t')
+ printf("\n");
+
ireq.i_type = IEEE80211_IOC_WEP;
if (ioctl(s, SIOCG80211, &ireq) != -1 &&
ireq.i_val != IEEE80211_WEP_NOSUP) {