* Seminario Fiscalización Dirección del Trabajo - Santiago.
From: =?iso-8859-1?q?Sitiven_Capacitaci=F3n_ @ 2005-08-12 0:30 UTC (permalink / raw)
[-- Attachment #1: Type: text/html, Size: 15100 bytes --]
^ permalink raw reply
* ПРАКТИЧЕСКИЙ КУРС ДЛЯ СОТРУДНИКОВ ФИНАНСОВО-ЭКОНОМИЧЕСКИХ СЛУЖБ
From: 22-26 августа 2005 г. @ 2005-08-12 0:28 UTC (permalink / raw)
To: netdev
[-- Attachment #1.1: Type: text/plain, Size: 1590 bytes --]
Уникальная возможность за одну неделю овладеть новыми прикладными тех-нологиями
и проверенными методиками повышения эффективности
финансовой деятельности компании и при этом сэкономить.
В целях создания оптимального учебного курса нами был проведен опрос финансо-вых
менеджеров, который позволил выявить общие для всех специалистов, занимающих
эту должность, функции и обязанности. Именно для решения конкретных задач,
стоящих перед каждым сотрудником финансово-экономического отдела, мы собрали
прикладные технологии и инструменты, объединив их в программу шестидневного
специализированного семинара-практикума:
ПРАКТИЧЕСКИЙ КУРС
ДЛЯ СОТРУДНИКОВ ФИНАНСОВО-ЭКОНОМИЧЕСКИХ СЛУЖБ
22-26 августа 2005 г.
В программе курса: Финансовая политика предприятия Управление оборотными
активами Анализ финансового состояния Управление денежными потоками
Анализ кредитоспособности, платежеспособности и ликвидности Финансовые
и экономические показателей Практические аспекты ведения управленческого
учета (мероприятия, расчеты и ве-домости) Управленческий учет и аудит
Финансовый анализ и прогнозирование Инвестиционная политика компании
Привлечение стороннего финансирования Методика и техника бюджетирования
Внедрение системы финансового планирования и контроля на предприятии
Семинар проходит в интенсивной интерактивной форме с разбором большого
ко-личества примеров и кейсов, как из практики российских так и иностранных
компаний.
Чтобы подать заявку или получить подробную программу курса,
позвоните по тел. (095) 980-65-49
[-- Attachment #1.2: Type: text/html, Size: 2572 bytes --]
^ permalink raw reply
* °¡°ÝÆ÷±â~´«¹°ÀÇóºÐ~
From: Donnie Padgett @ 2005-08-12 0:06 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/html, Size: 437 bytes --]
^ permalink raw reply
* (unknown),
From: Ƽ¼ÅÃ÷ @ 2005-08-12 0:05 UTC (permalink / raw)
To: linux-xfs
[-- Attachment #1: Type: text/html, Size: 1409 bytes --]
^ permalink raw reply
* ¸ô·¡Ä«¸Þ¶ó³ª ÀüȵµÃ»ÀåÄ¡¸¦ Á·Áý°Ôó·³ ã¾Æ³À´Ï´Ù~~~
From: ¸ôīŽÁö±â @ 2005-08-12 0:02 UTC (permalink / raw)
To: linux-xfs
[-- Attachment #1: Type: text/html, Size: 1364 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: David S. Miller @ 2005-08-11 22:43 UTC (permalink / raw)
To: herbert; +Cc: netdev, netfilter-devel, netdev, laforge
In-Reply-To: <E1E3Kt5-0006jy-00@gondolin.me.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 12 Aug 2005 07:46:55 +1000
> Actually, these two versions are different. & is higher than | so
> Harald's version is actually
>
> #define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
>
> Which is it?
It's the former that is the intended version.
I put Harald's patch in as-is, if people want to pretty it
up please do so with a follow-on patch but I really don't
think it matters :-)
^ permalink raw reply
* Re: [PATCH] add new iptables ipt_connbytes match
From: David S. Miller @ 2005-08-11 22:42 UTC (permalink / raw)
To: laforge; +Cc: netdev, netfilter-devel
In-Reply-To: <20050811200349.GN5353@rama.de.gnumonks.org>
From: Harald Welte <laforge@netfilter.org>
Date: Thu, 11 Aug 2005 22:03:49 +0200
> +struct ipt_connbytes_info
> +{
> + struct {
> + u_int64_t from; /* count to be matched */
> + u_int64_t to; /* count to be matched */
> + } count;
> + u_int8_t what; /* ipt_connbytes_what */
> + u_int8_t direction; /* ipt_connbytes_direction */
> +};
Won't work in x86 --> x86_64 compat environments.
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: Harald Welte @ 2005-08-11 22:40 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev, netfilter-devel, Ingo Oeser
In-Reply-To: <E1E3Kt5-0006jy-00@gondolin.me.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]
On Fri, Aug 12, 2005 at 07:46:55AM +1000, Herbert Xu wrote:
> Ingo Oeser <netdev@axxeo.de> wrote:
> >
> > What about using a brace more:
> >
> >>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> >>--- a/include/linux/netfilter.h
> >>+++ b/include/linux/netfilter.h
> >>@@ -29,7 +29,7 @@
> >> #define NF_VERDICT_QMASK 0xffff0000
> >> #define NF_VERDICT_QBITS 16
> >>
> >>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
> >>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
> >
> > #define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))
>
> Actually, these two versions are different. & is higher than | so
> Harald's version is actually
>
> #define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
>
> Which is it?
the latter. So my original patch is right (and is also confirmed to
work in tests by some users and myself), I 'just' didn't review Ingo's
alternative line (embarrassing).
We have that saying in german: "I didn't see the wood because of all the
trees". Somehow I feel like that now...
--
- Harald Welte <laforge@netfilter.org> http://netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: David S. Miller @ 2005-08-11 22:31 UTC (permalink / raw)
To: laforge; +Cc: netdev, netfilter-devel
In-Reply-To: <20050811071320.GB4137@rama.de.gnumonks.org>
From: Harald Welte <laforge@gnumonks.org>
Date: Thu, 11 Aug 2005 09:13:21 +0200
> [NETFILTER] Fix NF_QUEUE_NR() macro
>
> I obviously wanted to use bitwise-or, not logical or.
>
> Signed-off-by: Harald Welte <laforge@netfilter.org>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] make nf_log compile with PROC_FS == n
From: David S. Miller @ 2005-08-11 22:31 UTC (permalink / raw)
To: laforge; +Cc: netdev, netfilter-devel
In-Reply-To: <20050811071243.GA4137@rama.de.gnumonks.org>
From: Harald Welte <laforge@gnumonks.org>
Date: Thu, 11 Aug 2005 09:12:43 +0200
> [NETFILTER] Fix compilation when no PROC_FS enabled
>
> Signed-off-by: Harald Welte <laforge@netfilter.org>
Applied.
^ permalink raw reply
* [RESEND] [PATCH] bond inherits zero-copy flags of slaves
From: Arthur Kepner @ 2005-08-11 21:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, bonding-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 468 bytes --]
The attached patch allows a bonding device to inherit the "zero-copy"
features of its slave devices.
It was inspired by a couple of previous postings on this topic:
http://marc.theaimsgroup.com/?l=bonding-devel&m=111924607327794&w=2
http://marc.theaimsgroup.com/?l=bonding-devel&m=111925242706297&w=2
and it's largely a combination of the patches that appear in those
emails.
Patch is against net-2.6.git
Signed-off-by: Arthur Kepner <akepner@sgi.com>
--
Arthur
[-- Attachment #2: bonding_features.git.patch --]
[-- Type: TEXT/PLAIN, Size: 4240 bytes --]
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1604,6 +1604,44 @@ static int bond_sethwaddr(struct net_dev
return 0;
}
+#define BOND_INTERSECT_FEATURES \
+ (NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)
+
+/*
+ * Compute the features available to the bonding device by
+ * intersection of all of the slave devices' BOND_INTERSECT_FEATURES.
+ * Call this after attaching or detaching a slave to update the
+ * bond's features.
+ */
+static int bond_compute_features(struct bonding *bond)
+{
+ int i;
+ struct slave *slave;
+ struct net_device *bond_dev = bond->dev;
+ int features = bond->bond_features;
+
+ bond_for_each_slave(bond, slave, i) {
+ struct net_device * slave_dev = slave->dev;
+ if (i == 0) {
+ features |= BOND_INTERSECT_FEATURES;
+ }
+ features &=
+ ~(~slave_dev->features & BOND_INTERSECT_FEATURES);
+ }
+
+ /* turn off NETIF_F_SG if we need a csum and h/w can't do it */
+ if ((features & NETIF_F_SG) &&
+ !(features & (NETIF_F_IP_CSUM |
+ NETIF_F_NO_CSUM |
+ NETIF_F_HW_CSUM))) {
+ features &= ~NETIF_F_SG;
+ }
+
+ bond_dev->features = features;
+
+ return 0;
+}
+
/* enslave device <slave> to bond device <master> */
static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
{
@@ -1811,6 +1849,8 @@ static int bond_enslave(struct net_devic
new_slave->delay = 0;
new_slave->link_failure_count = 0;
+ bond_compute_features(bond);
+
if (bond->params.miimon && !bond->params.use_carrier) {
link_reporting = bond_check_dev_link(bond, slave_dev, 1);
@@ -2015,7 +2055,7 @@ err_free:
err_undo_flags:
bond_dev->features = old_features;
-
+
return res;
}
@@ -2100,6 +2140,8 @@ static int bond_release(struct net_devic
/* release the slave from its bond */
bond_detach_slave(bond, slave);
+ bond_compute_features(bond);
+
if (bond->primary_slave == slave) {
bond->primary_slave = NULL;
}
@@ -2243,6 +2285,8 @@ static int bond_release_all(struct net_d
bond_alb_deinit_slave(bond, slave);
}
+ bond_compute_features(bond);
+
/* now that the slave is detached, unlock and perform
* all the undo steps that should not be called from
* within a lock.
@@ -3588,6 +3632,7 @@ static int bond_master_netdev_event(unsi
static int bond_slave_netdev_event(unsigned long event, struct net_device *slave_dev)
{
struct net_device *bond_dev = slave_dev->master;
+ struct bonding *bond = bond_dev->priv;
switch (event) {
case NETDEV_UNREGISTER:
@@ -3626,6 +3671,9 @@ static int bond_slave_netdev_event(unsig
* TODO: handle changing the primary's name
*/
break;
+ case NETDEV_FEAT_CHANGE:
+ bond_compute_features(bond);
+ break;
default:
break;
}
@@ -4526,6 +4574,11 @@ static inline void bond_set_mode_ops(str
}
}
+static struct ethtool_ops bond_ethtool_ops = {
+ .get_tx_csum = ethtool_op_get_tx_csum,
+ .get_sg = ethtool_op_get_sg,
+};
+
/*
* Does not allocate but creates a /proc entry.
* Allowed to fail.
@@ -4555,6 +4608,7 @@ static int __init bond_init(struct net_d
bond_dev->stop = bond_close;
bond_dev->get_stats = bond_get_stats;
bond_dev->do_ioctl = bond_do_ioctl;
+ bond_dev->ethtool_ops = &bond_ethtool_ops;
bond_dev->set_multicast_list = bond_set_multicast_list;
bond_dev->change_mtu = bond_change_mtu;
bond_dev->set_mac_address = bond_set_mac_address;
@@ -4591,6 +4645,8 @@ static int __init bond_init(struct net_d
NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER);
+ bond->bond_features = bond_dev->features;
+
#ifdef CONFIG_PROC_FS
bond_create_proc_entry(bond);
#endif
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -211,6 +211,9 @@ struct bonding {
struct bond_params params;
struct list_head vlan_list;
struct vlan_group *vlgrp;
+ /* the features the bonding device supports, independently
+ * of any slaves */
+ int bond_features;
};
/**
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: Herbert Xu @ 2005-08-11 21:46 UTC (permalink / raw)
To: Ingo Oeser; +Cc: netdev, netfilter-devel, laforge
In-Reply-To: <200508111631.24785.netdev@axxeo.de>
Ingo Oeser <netdev@axxeo.de> wrote:
>
> What about using a brace more:
>
>>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
>>--- a/include/linux/netfilter.h
>>+++ b/include/linux/netfilter.h
>>@@ -29,7 +29,7 @@
>> #define NF_VERDICT_QMASK 0xffff0000
>> #define NF_VERDICT_QBITS 16
>>
>>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
>>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
>
> #define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))
Actually, these two versions are different. & is higher than | so
Harald's version is actually
#define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
Which is it?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] emac: add support for platform-specific unsupported PHY features
From: Matt Porter @ 2005-08-11 20:55 UTC (permalink / raw)
To: Wade Farnsworth; +Cc: Jeff Garzik, netdev, Eugene Surovegin
In-Reply-To: <1123792744.27734.30.camel@rhino.az.mvista.com>
On Thu, Aug 11, 2005 at 01:39:05PM -0700, Wade Farnsworth wrote:
> On Wed, 2005-08-10 at 21:03, Jeff Garzik wrote:
> > Wade Farnsworth wrote:
> > > Hello,
> > >
> > > This patch adds support to the ibm_emac driver for platform-specific
> > > unsupported PHY features.
> > >
> > > The patch attempts to determine the highest speed and duplex when
> > > autonegotiation is unsupported.
> > >
> > > -Wade Farnsworth
> > >
> > > Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
> >
> > Can you update this patch RE Eugene's comments?
> >
> > Jeff
> >
>
> Sorry for the delay. Here is the updated patch.
FWIW, akpm has the ppc32 relevant bits that go with this patch
pending now.
-Matt
^ permalink raw reply
* Re: [PATCH] emac: add support for platform-specific unsupported PHY features
From: Wade Farnsworth @ 2005-08-11 20:39 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, Matt Porter, Eugene Surovegin
In-Reply-To: <42FACE25.5080909@pobox.com>
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
On Wed, 2005-08-10 at 21:03, Jeff Garzik wrote:
> Wade Farnsworth wrote:
> > Hello,
> >
> > This patch adds support to the ibm_emac driver for platform-specific
> > unsupported PHY features.
> >
> > The patch attempts to determine the highest speed and duplex when
> > autonegotiation is unsupported.
> >
> > -Wade Farnsworth
> >
> > Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
>
> Can you update this patch RE Eugene's comments?
>
> Jeff
>
Sorry for the delay. Here is the updated patch.
-Wade Farnsworth
Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
[-- Attachment #2: ibm-emac-phy-feat-exc-core.patch --]
[-- Type: text/x-patch, Size: 1734 bytes --]
diff -upr linux-2.6/drivers/net/ibm_emac/ibm_emac_core.c linux-2.6-dev/drivers/net/ibm_emac/ibm_emac_core.c
--- linux-2.6/drivers/net/ibm_emac/ibm_emac_core.c 2005-08-11 13:29:43.000000000 -0700
+++ linux-2.6-dev/drivers/net/ibm_emac/ibm_emac_core.c 2005-08-11 13:13:40.000000000 -0700
@@ -1876,6 +1876,9 @@ static int emac_init_device(struct ocp_d
rc = -ENODEV;
goto bail;
}
+
+ /* Disable any PHY features not supported by the platform */
+ ep->phy_mii.def->features &= ~emacdata->phy_feat_exc;
/* Setup initial PHY config & startup aneg */
if (ep->phy_mii.def->ops->init)
@@ -1883,6 +1886,34 @@ static int emac_init_device(struct ocp_d
netif_carrier_off(ndev);
if (ep->phy_mii.def->features & SUPPORTED_Autoneg)
ep->want_autoneg = 1;
+ else {
+ ep->want_autoneg = 0;
+
+ /* Select highest supported speed/duplex */
+ if (ep->phy_mii.def->features & SUPPORTED_1000baseT_Full) {
+ ep->phy_mii.speed = SPEED_1000;
+ ep->phy_mii.duplex = DUPLEX_FULL;
+ } else if (ep->phy_mii.def->features &
+ SUPPORTED_1000baseT_Half) {
+ ep->phy_mii.speed = SPEED_1000;
+ ep->phy_mii.duplex = DUPLEX_HALF;
+ } else if (ep->phy_mii.def->features &
+ SUPPORTED_100baseT_Full) {
+ ep->phy_mii.speed = SPEED_100;
+ ep->phy_mii.duplex = DUPLEX_FULL;
+ } else if (ep->phy_mii.def->features &
+ SUPPORTED_100baseT_Half) {
+ ep->phy_mii.speed = SPEED_100;
+ ep->phy_mii.duplex = DUPLEX_HALF;
+ } else if (ep->phy_mii.def->features &
+ SUPPORTED_10baseT_Full) {
+ ep->phy_mii.speed = SPEED_10;
+ ep->phy_mii.duplex = DUPLEX_FULL;
+ } else {
+ ep->phy_mii.speed = SPEED_10;
+ ep->phy_mii.duplex = DUPLEX_HALF;
+ }
+ }
emac_start_link(ep, NULL);
/* read the MAC Address */
^ permalink raw reply
* [PATCH] add new iptables ipt_connbytes match
From: Harald Welte @ 2005-08-11 20:03 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 424 bytes --]
Hi Dave,
please apply to your net-2.6.14 tree:
--
- Harald Welte <laforge@netfilter.org> http://netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #1.2: 46-ipt_connbytes.patch --]
[-- Type: text/plain, Size: 8278 bytes --]
[NETFILTER] Add new iptables "connbytes" match
This patch ads a new "connbytes" match that utilizes the CONFIG_NF_CT_ACCT
per-connection byte and packet counters. Using it you can do things like
packet classification on average packet size within a connection.
Signed-off-by: Harald Welte <laforge@netfilter.org>
---
commit 98a0b5554e6e54a5a5a21b21b212186dc3c2118c
tree 43acbfa60366e1b111272851f1a1745a43a71d74
parent 5896088f554d8c2e7f3226973d1413df339e6b75
author Harald Welte <laforge@netfilter.org> Do, 11 Aug 2005 21:15:45 +0200
committer Harald Welte <laforge@netfilter.org> Do, 11 Aug 2005 21:15:45 +0200
include/linux/netfilter_ipv4/ipt_connbytes.h | 25 ++++
net/ipv4/netfilter/Kconfig | 11 ++
net/ipv4/netfilter/Makefile | 1
net/ipv4/netfilter/ipt_connbytes.c | 166 ++++++++++++++++++++++++++
4 files changed, 202 insertions(+), 1 deletions(-)
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h
new file mode 100644
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ipt_connbytes.h
@@ -0,0 +1,25 @@
+#ifndef _IPT_CONNBYTES_H
+#define _IPT_CONNBYTES_H
+
+enum ipt_connbytes_what {
+ IPT_CONNBYTES_WHAT_PKTS,
+ IPT_CONNBYTES_WHAT_BYTES,
+ IPT_CONNBYTES_WHAT_AVGPKT,
+};
+
+enum ipt_connbytes_direction {
+ IPT_CONNBYTES_DIR_ORIGINAL,
+ IPT_CONNBYTES_DIR_REPLY,
+ IPT_CONNBYTES_DIR_BOTH,
+};
+
+struct ipt_connbytes_info
+{
+ struct {
+ u_int64_t from; /* count to be matched */
+ u_int64_t to; /* count to be matched */
+ } count;
+ u_int8_t what; /* ipt_connbytes_what */
+ u_int8_t direction; /* ipt_connbytes_direction */
+};
+#endif
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -386,6 +386,16 @@ config IP_NF_MATCH_CONNMARK
<file:Documentation/modules.txt>. The module will be called
ipt_connmark.o. If unsure, say `N'.
+config IP_NF_MATCH_CONNBYTES
+ tristate 'Connection byte/packet counter match support'
+ depends on IP_NF_CT_ACCT && IP_NF_IPTABLES
+ help
+ This option adds a `connbytes' match, which allows you to match the
+ number of bytes and/or packets for each direction within a connection.
+
+ If you want to compile it as a module, say M here and read
+ <file:Documentation/modules.txt>. If unsure, say `N'.
+
config IP_NF_MATCH_HASHLIMIT
tristate 'hashlimit match support'
depends on IP_NF_IPTABLES
@@ -723,6 +733,5 @@ config IP_NF_CONNTRACK_NETLINK
help
This option enables support for a netlink-based userspace interface
-
endmenu
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
--- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl
obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
obj-$(CONFIG_IP_NF_MATCH_CONNMARK) += ipt_connmark.o
obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
+obj-$(CONFIG_IP_NF_MATCH_CONNBYTES) += ipt_connbytes.o
obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_realm.o
obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
diff --git a/net/ipv4/netfilter/ipt_connbytes.c b/net/ipv4/netfilter/ipt_connbytes.c
new file mode 100644
--- /dev/null
+++ b/net/ipv4/netfilter/ipt_connbytes.c
@@ -0,0 +1,166 @@
+/* Kernel module to match connection tracking byte counter.
+ * GPL (C) 2002 Martin Devera (devik@cdi.cz).
+ *
+ * 2004-07-20 Harald Welte <laforge@netfilter.org>
+ * - reimplemented to use per-connection accounting counters
+ * - add functionality to match number of packets
+ * - add functionality to match average packet size
+ * - add support to match directions seperately
+ *
+ */
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/netfilter_ipv4/ip_conntrack.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/netfilter_ipv4/ipt_connbytes.h>
+
+#include <asm/div64.h>
+#include <asm/bitops.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
+MODULE_DESCRIPTION("iptables match for matching number of pkts/bytes per connection");
+
+/* 64bit divisor, dividend and result. dynamic precision */
+static u_int64_t div64_64(u_int64_t divisor, u_int64_t dividend)
+{
+ u_int64_t result = divisor;
+
+ if (dividend > 0xffffffff) {
+ int first_bit = find_first_bit((unsigned long *) ÷nd, sizeof(dividend));
+ /* calculate number of bits to shift. shift exactly enough
+ * bits to make dividend fit in 32bits. */
+ int num_shift = (64 - 32 - first_bit);
+ /* first bit has to be < 32, since dividend was > 0xffffffff */
+ result = result >> num_shift;
+ dividend = dividend >> num_shift;
+ }
+
+ do_div(divisor, dividend);
+
+ return divisor;
+}
+
+static int
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *matchinfo,
+ int offset,
+ int *hotdrop)
+{
+ const struct ipt_connbytes_info *sinfo = matchinfo;
+ enum ip_conntrack_info ctinfo;
+ struct ip_conntrack *ct;
+ u_int64_t what = 0; /* initialize to make gcc happy */
+
+ if (!(ct = ip_conntrack_get((struct sk_buff *)skb, &ctinfo)))
+ return 0; /* no match */
+
+ switch (sinfo->what) {
+ case IPT_CONNBYTES_WHAT_PKTS:
+ switch (sinfo->direction) {
+ case IPT_CONNBYTES_DIR_ORIGINAL:
+ what = ct->counters[IP_CT_DIR_ORIGINAL].packets;
+ break;
+ case IPT_CONNBYTES_DIR_REPLY:
+ what = ct->counters[IP_CT_DIR_REPLY].packets;
+ break;
+ case IPT_CONNBYTES_DIR_BOTH:
+ what = ct->counters[IP_CT_DIR_ORIGINAL].packets;
+ what += ct->counters[IP_CT_DIR_REPLY].packets;
+ break;
+ }
+ break;
+ case IPT_CONNBYTES_WHAT_BYTES:
+ switch (sinfo->direction) {
+ case IPT_CONNBYTES_DIR_ORIGINAL:
+ what = ct->counters[IP_CT_DIR_ORIGINAL].bytes;
+ break;
+ case IPT_CONNBYTES_DIR_REPLY:
+ what = ct->counters[IP_CT_DIR_REPLY].bytes;
+ break;
+ case IPT_CONNBYTES_DIR_BOTH:
+ what = ct->counters[IP_CT_DIR_ORIGINAL].bytes;
+ what += ct->counters[IP_CT_DIR_REPLY].bytes;
+ break;
+ }
+ break;
+ case IPT_CONNBYTES_WHAT_AVGPKT:
+ switch (sinfo->direction) {
+ case IPT_CONNBYTES_DIR_ORIGINAL:
+ what = div64_64(ct->counters[IP_CT_DIR_ORIGINAL].bytes,
+ ct->counters[IP_CT_DIR_ORIGINAL].packets);
+ break;
+ case IPT_CONNBYTES_DIR_REPLY:
+ what = div64_64(ct->counters[IP_CT_DIR_REPLY].bytes,
+ ct->counters[IP_CT_DIR_REPLY].packets);
+ break;
+ case IPT_CONNBYTES_DIR_BOTH:
+ {
+ u_int64_t bytes;
+ u_int64_t pkts;
+ bytes = ct->counters[IP_CT_DIR_ORIGINAL].bytes +
+ ct->counters[IP_CT_DIR_REPLY].bytes;
+ pkts = ct->counters[IP_CT_DIR_ORIGINAL].packets+
+ ct->counters[IP_CT_DIR_REPLY].packets;
+
+ /* FIXME_THEORETICAL: what to do if sum
+ * overflows ? */
+
+ what = div64_64(bytes, pkts);
+ }
+ break;
+ }
+ break;
+ }
+
+ if (sinfo->count.to)
+ return (what <= sinfo->count.to && what >= sinfo->count.from);
+ else
+ return (what >= sinfo->count.from);
+}
+
+static int check(const char *tablename,
+ const struct ipt_ip *ip,
+ void *matchinfo,
+ unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ const struct ipt_connbytes_info *sinfo = matchinfo;
+
+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_connbytes_info)))
+ return 0;
+
+ if (sinfo->what != IPT_CONNBYTES_WHAT_PKTS &&
+ sinfo->what != IPT_CONNBYTES_WHAT_BYTES &&
+ sinfo->what != IPT_CONNBYTES_WHAT_AVGPKT)
+ return 0;
+
+ if (sinfo->direction != IPT_CONNBYTES_DIR_ORIGINAL &&
+ sinfo->direction != IPT_CONNBYTES_DIR_REPLY &&
+ sinfo->direction != IPT_CONNBYTES_DIR_BOTH)
+ return 0;
+
+ return 1;
+}
+
+static struct ipt_match state_match = {
+ .name = "connbytes",
+ .match = &match,
+ .checkentry = &check,
+ .me = THIS_MODULE
+};
+
+static int __init init(void)
+{
+ return ipt_register_match(&state_match);
+}
+
+static void __exit fini(void)
+{
+ ipt_unregister_match(&state_match);
+}
+
+module_init(init);
+module_exit(fini);
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] sockaddr_ll change for IPoIB interface
From: David S. Miller @ 2005-08-11 19:49 UTC (permalink / raw)
To: halr; +Cc: netdev, openib-general
In-Reply-To: <1123786117.4403.5835.camel@hal.voltaire.com>
From: Hal Rosenstock <halr@voltaire.com>
Date: 11 Aug 2005 14:48:37 -0400
> The patch below is to accomodate IPoIB link layer address in the
> sockaddr_ll struct so that user space can send and receive IPoIB link
> later packets. Unfortunately, IPoIB has 20 bytes LL addresses rather
> than the 8 byte MAC addresses (or under) used by other LLs.
Two problems. 1) it's a really ugly IPoIB specific hack to extend the
sockaddr_ll structure, it won't work for anything else without adding
more special tests to that af_packet.c code and 2) you inproperly
rooted your patch, so we get stuff like this:
> --- af_packet.c.orig 2005-06-29 19:00:53.000000000 -0400
> +++ af_packet.c 2005-08-05 13:28:49.000000000 -0400
Please find another way to extend the structure.
That's why I didn't respond, this patch was too ugly for words
so it went to the bottom of my prioritized list of things to
do.
^ permalink raw reply
* RE: [ANNOUNCE] Experimental Driver for Neterion/S2io 10GbE Adapters
From: Leonid Grossman @ 2005-08-11 19:40 UTC (permalink / raw)
To: Jeff Garzik, alex; +Cc: netdev, davem, ak
Hi Jeff,
Thanks for remembering about the submission. My assumption was that the
submission did not get a consensus and died quietly :-), so we stopped
maintenance on the experimental driver several weeks ago and pulled it
from the ftp site.
I guess the original idea behind developing the "experimental" driver
was to eventually use it as a replacement for the "s2io" driver in the
kernel, mainly for the maintenance reasons - since "experimental" driver
shares hardware-oriented code with other Neterion drivers, our team
could run mature network test suites in other Operating Systems and
indirectly find/fix issues in Linux driver in a very efficient fashion.
This benefit seemed to be outweighed by other concerns that some of you
guys raised on the list.
In a long run (as 10GbE Xframe cards get shipped in volumes and the
patches start coming in from the community), these concerns may be
valid, so we have decided to stay with "s2io" driver as our production
code.
Leonid
> -----Original Message-----
> From: netdev-bounce@oss.sgi.com
> [mailto:netdev-bounce@oss.sgi.com] On Behalf Of Jeff Garzik
> Sent: Thursday, August 11, 2005 10:48 AM
> To: alex@neterion.com
> Cc: netdev@oss.sgi.com; davem@davemloft.net; ak@muc.de
> Subject: Re: [ANNOUNCE] Experimental Driver for Neterion/S2io
> 10GbE Adapters
>
> Alex Aizman wrote:
> > This is our 2nd attempt to submit "xge", the experimental
> driver for
> > Neterion, Inc (formerly S2io, Inc) family of 10GbE adapters.
>
> Can you send a link to the latest version of this driver, for review?
>
> Jeff
>
>
>
>
>
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: Harald Welte @ 2005-08-11 19:26 UTC (permalink / raw)
To: Ingo Oeser; +Cc: Linux Netdev List, Netfilter Development Mailinglist
In-Reply-To: <200508111631.24785.netdev@axxeo.de>
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
On Thu, Aug 11, 2005 at 04:31:24PM +0200, Ingo Oeser wrote:
> Harald Welte wrote:
> > Hi Dave, please apply!
>
> What about using a brace more:
I wouldn't mind the extra brace, but I don't want to make this more
difficult for Dave. So it's his call whether he would manually edit the
line before applying the patch ;)
--
- Harald Welte <laforge@netfilter.org> http://netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* øåöä ìùìí ôçåúîùëðúà?
From: ùøéú @ 2005-08-11 18:59 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/html, Size: 695 bytes --]
[-- Attachment #2: amg.jpg --]
[-- Type: image/jpeg, Size: 79149 bytes --]
[-- Attachment #3: hsr.jpg --]
[-- Type: image/jpeg, Size: 7076 bytes --]
^ permalink raw reply
* [PATCH] sockaddr_ll change for IPoIB interface
From: Hal Rosenstock @ 2005-08-11 18:48 UTC (permalink / raw)
To: David S. Miller, netdev; +Cc: openib-general
Hi,
This is a repost of a patch which was posted last week which appears to
have been lost in the shuffle.
The patch below is to accomodate IPoIB link layer address in the
sockaddr_ll struct so that user space can send and receive IPoIB link
later packets. Unfortunately, IPoIB has 20 bytes LL addresses rather
than the 8 byte MAC addresses (or under) used by other LLs.
There is a similar change to both:
/usr/include/linux/if_packet.h
/usr/include/netpacket/packet.h
as in:
include/linux/if_packet.h below
to increase sll_addr from 8 to 20 bytes.
Thanks.
-- Hal
sockaddr_ll changes to accomodate IPoIB interfaces.
This is due to the fact that the IPoIB link layer
address is 20 bytes rather than 8 bytes. With the current 8 byte
address, it is not possible to send ARPs and RARPs from userspace as the
broadcast and unicast IPoIB addresses cannot be supplied properly.
There is backward compatibility support for those applications built
with the existing structure (prior to this patch).
Signed-off-by: Hal Rosenstock <halr@voltaire.com>
--- include/linux/if_packet.h.orig 2005-06-29 19:00:53.000000000 -0400
+++ include/linux/if_packet.h 2005-08-05 10:04:06.000000000 -0400
@@ -8,6 +8,7 @@ struct sockaddr_pkt
unsigned short spkt_protocol;
};
+#define SOCKADDR_LL_COMPAT 12
struct sockaddr_ll
{
unsigned short sll_family;
@@ -16,7 +17,7 @@ struct sockaddr_ll
unsigned short sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
- unsigned char sll_addr[8];
+ unsigned char sll_addr[20];
};
/* Packet types */
--- af_packet.c.orig 2005-06-29 19:00:53.000000000 -0400
+++ af_packet.c 2005-08-05 13:28:49.000000000 -0400
@@ -708,8 +708,12 @@ static int packet_sendmsg(struct kiocb *
addr = NULL;
} else {
err = -EINVAL;
- if (msg->msg_namelen < sizeof(struct sockaddr_ll))
- goto out;
+ if (msg->msg_namelen < sizeof(struct sockaddr_ll)) {
+ /* Support for older sockaddr_ll structs */
+ if ((msg->msg_namelen != sizeof(struct sockaddr_ll) - SOCKADDR_LL_COMPAT) ||
+ (saddr->sll_hatype == ARPHRD_INFINIBAND))
+ goto out;
+ }
ifindex = saddr->sll_ifindex;
proto = saddr->sll_protocol;
addr = saddr->sll_addr;
@@ -937,7 +941,11 @@ static int packet_bind(struct socket *so
*/
if (addr_len < sizeof(struct sockaddr_ll))
- return -EINVAL;
+ /* Support for older sockaddr_ll structs */
+ if ((addr_len != sizeof(struct sockaddr_ll) -
+ SOCKADDR_LL_COMPAT) ||
+ (sll->sll_hatype == ARPHRD_INFINIBAND))
+ return -EINVAL;
if (sll->sll_family != AF_PACKET)
return -EINVAL;
^ permalink raw reply
* 投资教育 让你一夜变富!
From: 中鼎教育 @ 2005-08-11 18:42 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/html, Size: 17037 bytes --]
^ permalink raw reply
* Re: [ANNOUNCE] Experimental Driver for Neterion/S2io 10GbE Adapters
From: Jeff Garzik @ 2005-08-11 17:48 UTC (permalink / raw)
To: alex; +Cc: netdev, davem, ak
In-Reply-To: <200503222330.j2MNU2DD028953@guinness.s2io.com>
Alex Aizman wrote:
> This is our 2nd attempt to submit "xge", the experimental driver for
> Neterion, Inc (formerly S2io, Inc) family of 10GbE adapters.
Can you send a link to the latest version of this driver, for review?
Jeff
^ permalink raw reply
* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
From: Ingo Oeser @ 2005-08-11 14:31 UTC (permalink / raw)
To: Harald Welte, David Miller, Linux Netdev List,
Netfilter Development Mailinglist
In-Reply-To: <20050811071320.GB4137@rama.de.gnumonks.org>
Harald Welte wrote:
> Hi Dave, please apply!
What about using a brace more:
>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
>--- a/include/linux/netfilter.h
>+++ b/include/linux/netfilter.h
>@@ -29,7 +29,7 @@
> #define NF_VERDICT_QMASK 0xffff0000
> #define NF_VERDICT_QBITS 16
>
>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))
I know we are cool and know operator precedence even after 10 beer, but some people
consider it difficult to understand without :-)
Regards
Ingo Oeser
^ permalink raw reply
* [PATCH 2/2] fix NF_QUEUE_NR() macro
From: Harald Welte @ 2005-08-11 7:13 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 337 bytes --]
Hi Dave, please apply!
--
- Harald Welte <laforge@gnumonks.org> http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
[-- Attachment #1.2: 44-nf_queue_nr.patch --]
[-- Type: text/plain, Size: 1001 bytes --]
[NETFILTER] Fix NF_QUEUE_NR() macro
I obviously wanted to use bitwise-or, not logical or.
Signed-off-by: Harald Welte <laforge@netfilter.org>
---
commit 359a4ba102b661dbd8da28b9dcb3330656a7a963
tree 3d1549cbff8af472bf761322b468ccd0d5be55c2
parent 5d6a0527049e43780fdaef065d0240a3338f92fd
author Harald Welte <laforge@netfilter.org> Di, 09 Aug 2005 09:32:02 +0200
committer Harald Welte <laforge@netfilter.org> Di, 09 Aug 2005 09:32:02 +0200
include/linux/netfilter.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -29,7 +29,7 @@
#define NF_VERDICT_QMASK 0xffff0000
#define NF_VERDICT_QBITS 16
-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
/* only for userspace compatibility */
#ifndef __KERNEL__
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH 1/2] make nf_log compile with PROC_FS == n
From: Harald Welte @ 2005-08-11 7:12 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 337 bytes --]
Hi Dave, please apply!
--
- Harald Welte <laforge@gnumonks.org> http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
[-- Attachment #1.2: 42-nflog_no_procfs.patch --]
[-- Type: text/plain, Size: 526 bytes --]
[NETFILTER] Fix compilation when no PROC_FS enabled
Signed-off-by: Harald Welte <laforge@netfilter.org>
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -166,12 +166,12 @@ int __init netfilter_log_init(void)
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *pde;
+
pde = create_proc_entry("nf_log", S_IRUGO, proc_net_netfilter);
-#endif
if (!pde)
return -1;
pde->proc_fops = &nflog_file_ops;
-
+#endif
return 0;
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox