From e960e06621ac26448ce061f6cde001c6cec404f3 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 24 Sep 2009 20:18:47 +0200 Subject: [PATCH] add netns command iw phy# set netns --- phy.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/phy.c b/phy.c index b34f9db..8dd01aa 100644 --- a/phy.c +++ b/phy.c @@ -140,3 +140,27 @@ static int handle_rts(struct nl80211_state *state, COMMAND(set, rts, "", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_rts, "Set rts threshold."); + +static int handle_netns(struct nl80211_state *state, + struct nl_cb *cb, + struct nl_msg *msg, + int argc, char **argv) +{ + char *end; + + if (argc != 1) + return 1; + + NLA_PUT_U32(msg, NL80211_ATTR_PID, + strtoul(argv[0], &end, 10)); + + if (*end != '\0') + return 1; + + return 0; + nla_put_failure: + return -ENOBUFS; +} +COMMAND(set, netns, "", + NL80211_CMD_SET_WIPHY_NETNS, 0, CIB_PHY, handle_netns, + "Put this wireless device into a different network namespace"); -- 2.39.2