All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lutz Jaenicke <ljaenicke@innominate.com>
To: Laszlo Attila Toth <panther@balabit.hu>
Cc: David Miller <davem@davemloft.net>,
	Patrick McHardy <kaber@trash.net>,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCHv6 2/3] Interface group: core (netlink) part
Date: Fri, 23 Nov 2007 14:18:00 +0100	[thread overview]
Message-ID: <20071123131800.GA31342@innominate.com> (raw)
In-Reply-To: <11955644702451-git-send-email-panther@balabit.hu>

On Tue, Nov 20, 2007 at 02:14:26PM +0100, Laszlo Attila Toth wrote:
> Interface groups let handle different interfaces together.
> Modified net device structure and netlink interface.
> 
> Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
> ---
>  include/linux/if_link.h   |    2 ++
>  include/linux/netdevice.h |    2 ++
>  net/core/rtnetlink.c      |   11 +++++++++++
>  3 files changed, 15 insertions(+), 0 deletions(-)

Adding read/write support via sysfs should not be too difficult:

diff -ruN a/net/core/net-sysfs.c b/net/core/net-sysfs.c
--- a/net/core/net-sysfs.c	2007-11-17 06:16:36.000000000 +0100
+++ b/net/core/net-sysfs.c	2007-11-23 14:04:47.000000000 +0100
@@ -219,6 +219,20 @@
 	return netdev_store(dev, attr, buf, len, change_tx_queue_len);
 }
 
+NETDEVICE_SHOW(ifgroup, fmt_hex);
+
+static int change_ifgroup(struct net_device *net, unsigned long new_ifgroup)
+{
+	net->ifgroup = new_ifgroup;
+	return 0;
+}
+
+static ssize_t store_ifgroup(struct device *dev, struct device_attribute *attr,
+			   const char *buf, size_t len)
+{
+	return netdev_store(dev, attr, buf, len, change_ifgroup);
+}
+
 static struct device_attribute net_class_attributes[] = {
 	__ATTR(addr_len, S_IRUGO, show_addr_len, NULL),
 	__ATTR(iflink, S_IRUGO, show_iflink, NULL),
@@ -235,6 +249,7 @@
 	__ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags),
 	__ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
 	       store_tx_queue_len),
+	__ATTR(ifgroup, S_IRUGO | S_IWUSR, show_ifgroup, store_ifgroup),
 	{}
 };
 
-- 
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG  /protecting industrial networks/
tel: +49.30.6392-3308
fax: +49.30.6392-3307
Albert-Einstein-Str. 14
D-12489 Berlin, Germany
www.innominate.com

Register Court: AG Charlottenburg, HR B 81603
Management Board: Joachim Fietz, Dirk Seewald
Chairman of the Supervisory Board: Edward M. Stadum

----------------------------------------------------------------------------

Visit us at the SPS/IPC/Drives in Nuremberg / Germany

27 - 29 November 2007, Hall 9, Stand 9-141

----------------------------------------------------------------------------

  parent reply	other threads:[~2007-11-23 13:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20 13:14 [PATCHv6 0/3] Interface group patches Laszlo Attila Toth
2007-11-20 13:14 ` [PATCHv6 1/3] rtnetlink: setlink changes are unprotected; with single notification Laszlo Attila Toth
2007-11-20 13:14   ` [PATCHv6 2/3] Interface group: core (netlink) part Laszlo Attila Toth
2007-11-20 13:14     ` [PATCHv6 3/3] Netfilter Interface group match Laszlo Attila Toth
2007-11-20 13:14       ` [PATCHv6 iptables]Interface " Laszlo Attila Toth
2007-11-20 13:14         ` [PATCHv6 iproute 1/2] Added IFLA_NET_NS_PID as in kernel v2.6.24-rc1 Laszlo Attila Toth
2007-11-20 13:14           ` [PATCHv6 iproute 2/2] Interface group as new ip link option Laszlo Attila Toth
2007-11-23 13:25             ` Lutz Jaenicke
2007-11-23 13:39         ` [PATCHv6 iptables]Interface group match Lutz Jaenicke
2007-11-29 12:50           ` Laszlo Attila Toth
2007-11-29 16:16             ` Patrick McHardy
2007-11-29 16:23               ` Laszlo Attila Toth
2007-11-29 16:27                 ` Patrick McHardy
2007-11-29 17:14                   ` Jan Engelhardt
2007-11-29 17:15                     ` Patrick McHardy
2007-11-27 13:10       ` [PATCHv6 3/3] Netfilter Interface " Patrick McHardy
2007-11-23 13:18     ` Lutz Jaenicke [this message]
2007-11-27 13:07     ` [PATCHv6 2/3] Interface group: core (netlink) part Patrick McHardy
2007-11-27 13:07   ` [PATCHv6 1/3] rtnetlink: setlink changes are unprotected; with single notification Patrick McHardy
2007-11-20 13:26 ` [PATCHv6 0/3] Interface group patches Jan Engelhardt
2007-11-20 13:52   ` Laszlo Attila Toth
2007-11-20 21:42     ` David Miller
2007-11-21  0:25       ` Patrick McHardy
2007-11-21  1:17         ` David Miller
2007-11-22  9:05           ` Laszlo Attila Toth
2007-11-21 15:56         ` Balazs Scheidler

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=20071123131800.GA31342@innominate.com \
    --to=ljaenicke@innominate.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=panther@balabit.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.