svn commit: r195456 - projects/mesh11s/sbin/ifconfig
Rui Paulo
rpaulo at FreeBSD.org
Wed Jul 8 14:52:38 UTC 2009
Author: rpaulo
Date: Wed Jul 8 14:52:31 2009
New Revision: 195456
URL: http://svn.freebsd.org/changeset/base/195456
Log:
* print and allow setting mesh metric and mesh path protocols
Sponsored by: The FreeBSD Foundation
Modified:
projects/mesh11s/sbin/ifconfig/ifieee80211.c
Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c
==============================================================================
--- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 14:17:03 2009 (r195455)
+++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 14:52:31 2009 (r195456)
@@ -77,8 +77,6 @@
#include <net/if_media.h>
#include <net/route.h>
-#include <arpa/inet.h>
-
#include <net80211/ieee80211_ioctl.h>
#include <net80211/ieee80211_freebsd.h>
#include <net80211/ieee80211_superg.h>
@@ -1872,6 +1870,24 @@ DECL_CMD_FUNC(set80211meshpeering, val,
set80211(s, IEEE80211_IOC_MESH_AP, atoi(val), 0, NULL);
}
+static
+DECL_CMD_FUNC(set80211meshmetric, val, d)
+{
+ char v[12];
+
+ memcpy(v, val, sizeof(v));
+ set80211(s, IEEE80211_IOC_MESH_PR_METRIC, 0, 0, v);
+}
+
+static
+DECL_CMD_FUNC(set80211meshpath, val, d)
+{
+ char v[12];
+
+ memcpy(v, val, sizeof(v));
+ set80211(s, IEEE80211_IOC_MESH_PR_PATH, 0, 0, v);
+}
+
static int
regdomain_sort(const void *a, const void *b)
{
@@ -4821,6 +4837,16 @@ end:
else
LINE_CHECK("-meshforward");
}
+ if (get80211len(s, IEEE80211_IOC_MESH_PR_METRIC, data, 12,
+ &len) != -1) {
+ data[len] = '\0';
+ LINE_CHECK("meshmetric %s", data);
+ }
+ if (get80211len(s, IEEE80211_IOC_MESH_PR_PATH, data, 12,
+ &len) != -1) {
+ data[len] = '\0';
+ LINE_CHECK("meshpath %s", data);
+ }
if (get80211val(s, IEEE80211_IOC_HWMP_ROOTMODE, &val) != -1) {
switch (val) {
case IEEE80211_HWMP_ROOTMODE_DISABLED:
@@ -5249,6 +5275,8 @@ static struct cmd ieee80211_cmds[] = {
DEF_CMD("-meshforward", 0, set80211meshforward),
DEF_CMD("meshpeering", 1, set80211meshpeering),
DEF_CMD("-meshpeering", 0, set80211meshpeering),
+ DEF_CMD_ARG("meshmetric", set80211meshmetric),
+ DEF_CMD_ARG("meshpath", set80211meshpath),
DEF_CMD("meshrt:flush", IEEE80211_MESH_RTCMD_FLUSH, set80211meshrtcmd),
DEF_CMD_ARG("meshrt:add", set80211addmeshrt),
DEF_CMD_ARG("meshrt:del", set80211delmeshrt),
More information about the svn-src-projects
mailing list