From: Javier Cardona <javier@cozybit.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] iw: add a command for moving a STA into an AP VLAN
Date: Sat, 31 Jul 2010 09:35:38 +0200 [thread overview]
Message-ID: <AANLkTi=GDPWjj6zB4iCH2rFMWLL=8i5OD=oPfkoSkths@mail.gmail.com> (raw)
In-Reply-To: <4AFAAC7F.8000903@openwrt.org>
Felix,
This patch apparently broke the plink_action commands. Any chance you
could rework it?
Thanks,
Javier
On Wed, Nov 11, 2009 at 2:22 PM, Felix Fietkau <nbd@openwrt.org> wrote:
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
>
> --- a/station.c
> +++ b/station.c
> @@ -196,7 +196,7 @@ COMMAND(station, del, "<MAC address>",
> NL80211_CMD_DEL_STATION, 0, CIB_NETDEV, handle_station_get,
> "Remove the given station entry (use with caution!)");
>
> -static int handle_station_set(struct nl80211_state *state,
> +static int handle_station_set_plink(struct nl80211_state *state,
> struct nl_cb *cb,
> struct nl_msg *msg,
> int argc, char **argv)
> @@ -241,9 +241,56 @@ static int handle_station_set(struct nl8
> return -ENOBUFS;
> }
> COMMAND(station, set, "<MAC address> plink_action <open|block>",
> - NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set,
> + NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_plink,
> "Set mesh peer link action for this station (peer).");
>
> +static int handle_station_set_vlan(struct nl80211_state *state,
> + struct nl_cb *cb,
> + struct nl_msg *msg,
> + int argc, char **argv)
> +{
> + unsigned char mac_addr[ETH_ALEN];
> + unsigned long sta_vlan = 0;
> + char *err = NULL;
> +
> + if (argc < 3)
> + return 1;
> +
> + if (mac_addr_a2n(mac_addr, argv[0])) {
> + fprintf(stderr, "invalid mac address\n");
> + return 2;
> + }
> + argc--;
> + argv++;
> +
> + if (strcmp("vlan", argv[0]) != 0)
> + return 1;
> + argc--;
> + argv++;
> +
> + sta_vlan = strtoul(argv[0], &err, 0);
> + if (err && *err) {
> + fprintf(stderr, "invalid vlan id\n");
> + return 2;
> + }
> + argc--;
> + argv++;
> +
> + if (argc)
> + return 1;
> +
> + NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
> + NLA_PUT_U32(msg, NL80211_ATTR_STA_VLAN, sta_vlan);
> +
> + return 0;
> + nla_put_failure:
> + return -ENOBUFS;
> +}
> +COMMAND(station, set, "<MAC address> vlan <ifindex>",
> + NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_vlan,
> + "Set an AP VLAN for this station.");
> +
> +
> static int handle_station_dump(struct nl80211_state *state,
> struct nl_cb *cb,
> struct nl_msg *msg,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2010-07-31 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 12:22 [PATCH] iw: add a command for moving a STA into an AP VLAN Felix Fietkau
2010-07-31 7:35 ` Javier Cardona [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=GDPWjj6zB4iCH2rFMWLL=8i5OD=oPfkoSkths@mail.gmail.com' \
--to=javier@cozybit.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@openwrt.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).