From: swds.mlowe@home.com
To: linux-kernel@vger.kernel.org
Subject: Re: IP Acounting Idea for 2.5
Date: Sun, 15 Apr 2001 19:58:01 -0600 [thread overview]
Message-ID: <3ADA51A9.C3028950@home.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0104152048250.17111-100000@asdf.capslock.lan>
No, one rule would be MUCH faster. What's do you think would be faster of the two:
if ((ipaddr>=3232235521)&&(ipaddr<=3232235774))
return 1;
else
return 0;
or
for (a=0;a<(3232235774-3232235521);a++)
if (ipaddr==a)
return 1;
return 0;
Obviously it compares the 192.168.0.1 - 192.168.0.255 range, but I think we both
know which one will be faster. Not to mention countless other redundant checks
will be added in on both, but on the second one the time of the checks is
multiplied by the number of times you have too loop.
But, I'm just a newbie so I don't really know :P Just taking up bandwith :(
L8ers,
Matt
"Mike A. Harris" wrote:
> On Tue, 17 Apr 2001, David Findlay wrote:
>
> >> Perhaps I misunderstand what it is exactly you are trying to do,
> >> but I would think that this could be done entirely in userland by
> >> software that just adds rules for you instead of you having to do
> >> it manually.
> >
> >I suppose, but it would be so much easier if the kernel did it automatically.
> >Having a rule to go through for each IP address to be logged would be slower
> >than implementing one rule that would log all of them. Doing this in the
> >kernel would improve preformance.
>
> I don't think it would, but then only benchmarking it both ways
> would know for sure. Even with incredibly large rulesets,
> ipchains &&/|| netfilter works admirably well. Rusty?
>
> ----------------------------------------------------------------------
> Mike A. Harris - Linux advocate - Free Software advocate
> This message is copyright 2001, all rights reserved.
> Views expressed are my own, not necessarily shared by my employer.
> ----------------------------------------------------------------------
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-04-16 2:02 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-16 21:53 IP Acounting Idea for 2.5 David Findlay
2001-04-16 0:21 ` Michael Clark
2001-04-16 0:40 ` Mike A. Harris
2001-04-16 22:46 ` David Findlay
2001-04-16 0:50 ` Mike A. Harris
2001-04-16 1:58 ` swds.mlowe [this message]
2001-04-16 1:24 ` Matti Aarnio
2001-04-16 2:07 ` Manfred Bartz
2001-04-16 9:43 ` Russell King
2001-04-16 22:24 ` Manfred Bartz
2001-04-17 10:29 ` Olaf Titz
2001-04-20 16:21 ` Counters [Re: IP Acounting Idea for 2.5] Harald Welte
2001-04-17 1:43 ` IP Acounting Idea for 2.5 Harald Welte
2001-04-17 2:37 ` Manfred Bartz
2001-04-17 6:56 ` Henning P. Schmiedehausen
2001-04-20 16:17 ` Harald Welte
2001-04-20 21:00 ` Henning P. Schmiedehausen
2001-04-16 11:21 ` Andreas Ferber
2001-04-16 2:40 ` Dax Kelson
2001-04-17 1:39 ` Harald Welte
-- strict thread matches above, loose matches on Subject: below --
2001-04-16 22:35 Leif Sawyer
2001-04-16 23:42 ` Ian Stirling
2001-04-17 1:13 ` Manfred Bartz
2001-04-17 10:34 ` Olaf Titz
2001-04-16 23:52 Leif Sawyer
2001-04-17 12:28 Jesse Pollard
2001-04-17 16:57 Leif Sawyer
2001-04-17 18:31 Jesse Pollard
2001-04-17 19:09 Leif Sawyer
2001-04-17 19:37 ` Matti Aarnio
2001-04-18 13:49 ` Michael Clark
2001-04-17 22:32 ` Manfred Bartz
2001-04-17 21:25 Jesse Pollard
2001-04-17 21:48 Leif Sawyer
2001-04-17 22:58 ` Manfred Bartz
2001-04-17 23:13 ` Alan Cox
2001-04-17 23:35 ` Manfred Bartz
2001-04-18 0:02 ` Alan Cox
2001-04-20 2:51 ` Ton Hospel
2001-05-01 23:13 ` Mark van Walraven
2001-04-18 8:16 ` Kenneth Johansson
2001-04-18 14:45 ` Jonathan Lundell
2001-04-17 23:06 Leif Sawyer
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=3ADA51A9.C3028950@home.com \
--to=swds.mlowe@home.com \
--cc=linux-kernel@vger.kernel.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