netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Vlad Dogaru <ddvlad@rosedu.org>
Cc: netdev@vger.kernel.org, Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH v3 1/3] iproute2: add support for setting device groups
Date: Wed, 02 Feb 2011 09:56:28 +0100	[thread overview]
Message-ID: <4D491C3C.2010805@trash.net> (raw)
In-Reply-To: <1296060086-18777-2-git-send-email-ddvlad@rosedu.org>

On 26.01.2011 17:41, Vlad Dogaru wrote:
> Use the group keyword to specify what group the device should belong to.
> Since the kernel uses numbers internally, mapping of group names to
> numbers is defined in /etc/iproute2/group_map. Example usage:
> 
>   ip link set dev eth0 group default
> 
> @@ -297,6 +299,13 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
>  			if (get_integer(&mtu, *argv, 0))
>  				invarg("Invalid \"mtu\" value\n", *argv);
>  			addattr_l(&req->n, sizeof(*req), IFLA_MTU, &mtu, 4);
> +		} else if (strcmp(*argv, "group") == 0) {
> +			NEXT_ARG();
> +			if (group != -1)
> +				duparg("group", *argv);
> +			if (lookup_map_id(*argv, &group, GROUP_MAP))
> +				invarg("Invalid \"group\" value\n", *argv);
> +			addattr_l(&req->n, sizeof(*req), IFLA_GROUP, &group, 4);

I think it would be preferrable to use a function similar to
rt_realm_n2a() that can also handle plain numerical values.

  reply	other threads:[~2011-02-02  8:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 16:41 [PATCH v3 0/3] iproute2: support for device groups Vlad Dogaru
2011-01-26 16:41 ` [PATCH v3 1/3] iproute2: add support for setting " Vlad Dogaru
2011-02-02  8:56   ` Patrick McHardy [this message]
2011-02-02  9:13     ` Vlad Dogaru
2011-02-02  9:21       ` Patrick McHardy
2011-02-02  9:23       ` Patrick McHardy
2011-02-02  9:56         ` Vlad Dogaru
2011-01-26 16:41 ` [PATCH v3 2/3] iproute2: support listing devices by group Vlad Dogaru
2011-01-26 16:41 ` [PATCH v3 3/3] iproute2: support setting device parameters " Vlad Dogaru

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=4D491C3C.2010805@trash.net \
    --to=kaber@trash.net \
    --cc=ddvlad@rosedu.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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).