From e6e06eb824ecf63e4ee76a5bb319c12a7694a338 Mon Sep 17 00:00:00 2001 From: Monthadar Al Jaberi Date: Tue, 1 May 2012 16:15:34 +0000 Subject: [PATCH] * Added new command to ifconfig to activate Mesh Gate Announcement called meshgate with corresponding explanation; Approved by: adrian --- sbin/ifconfig/ifconfig.8 | 6 ++++++ sbin/ifconfig/ifieee80211.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 0cd24b3aa4ce..2b16dd1fc2df 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1979,6 +1979,12 @@ Enable or disable forwarding packets by a mesh interface. By default .Cm meshforward is enabled. +.It Cm meshgate +This attribute specifies whether or not the mesh STA activates mesh gate +announcements. +By default +.Cm meshgate +is disabled. .It Cm meshmetric Ar protocol Set the specified .Ar protocol diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 3ecdf0ebd0c3..599f5082d28d 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -1882,6 +1882,12 @@ DECL_CMD_FUNC(set80211meshforward, val, d) set80211(s, IEEE80211_IOC_MESH_FWRD, d, 0, NULL); } +static +DECL_CMD_FUNC(set80211meshgate, val, d) +{ + set80211(s, IEEE80211_IOC_MESH_GATE, d, 0, NULL); +} + static DECL_CMD_FUNC(set80211meshpeering, val, d) { @@ -4832,6 +4838,12 @@ ieee80211_status(int s) else LINE_CHECK("-meshforward"); } + if (get80211val(s, IEEE80211_IOC_MESH_GATE, &val) != -1) { + if (val) + LINE_CHECK("meshgate"); + else + LINE_CHECK("-meshgate"); + } if (get80211len(s, IEEE80211_IOC_MESH_PR_METRIC, data, 12, &len) != -1) { data[len] = '\0'; @@ -5271,6 +5283,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD_ARG("meshttl", set80211meshttl), DEF_CMD("meshforward", 1, set80211meshforward), DEF_CMD("-meshforward", 0, set80211meshforward), + DEF_CMD("meshgate", 1, set80211meshgate), + DEF_CMD("-meshgate", 0, set80211meshgate), DEF_CMD("meshpeering", 1, set80211meshpeering), DEF_CMD("-meshpeering", 0, set80211meshpeering), DEF_CMD_ARG("meshmetric", set80211meshmetric),