All of lore.kernel.org
 help / color / mirror / Atom feed
From: Born Without <blackhole@airpost.net>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Jan Engelhardt <jengelh@inai.de>,
	"netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Wrapper script for ipset listing
Date: Thu, 10 Jan 2013 22:15:54 +0100	[thread overview]
Message-ID: <50EF2F8A.7040804@airpost.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1301101605260.11492@blackhole.kfki.hu>

[-- Attachment #1: Type: text/plain, Size: 2603 bytes --]

On 10.01.2013 16:19, Jozsef Kadlecsik wrote:
> On Thu, 10 Jan 2013, Born Without wrote:
>
>> On 09.01.2013 12:52, Pablo Neira Ayuso wrote:
>> [...]
>>
>>> Suggestion: Some explicit header with licensing terms of your script
>>> is a good idea if you want to share things, otherwise the law in most
>>> countries defaults to "all right reserved".

[...]
>> Don't know much about them.
>> But I guess GPL 3 will do?
>
> GPL 2 or 3 will do, whichever you prefer.
>
>> Also for Jozsef, if he would consider adding it to contrib?
>
> Yes, of course.
>
>> One thing still is missing, to make it more foolproof, there's no checking for
>> supported ipset versions (i.e v2.x) in the script.
>> I only have 6.16.1 installed.
>> I don't know if the -v|--version option is persistent through ipset versions.
>
> Yes, assuming the 6.x branch. But 4.x is not developed anymore and 5.x was
> a very short lived branch. Please assume 6.x or above in your script.
>
> In the ipset version string the first number always corresponds to the
> protocol version. The second number indicates the release number and
> sometimes there's a third number when a quick release with a very minor
> change is required.
>
>> I don't know if the format of the version output is persistent through ipset
>> versions.
>
> It may change partially, from this
>
> ipset v6.14, protocol version: 6
>
> to
>
> ipset v7.Y, protocol versions: 6-7
>
>> I don't know from what version the \`list' action is valid (before it was -L i
>> think?).
>
> Starting from 6.0 both syntax is valid.
>
>> I don't know if the plain listing output (header - members) is persistent
>> through ipset versions.
>
> Yes, with the conditions I wrote previously, i.e. which prepares the
> script to accept new header lines inserted before Members or new values
> appended.

Thank you Jozsef for that information.

I chose GPL v3...
For version checking I just extract the first digit after 'ipset v'. 
Should be sufficient.
The script doesn't check for new appended values, so nothing to do there.
Regarding headers it just checks for 'Name:' and 'Members:' to find 
them. Some checks included if it's expecting an header or not.

Also changed the following:

- Added -i option to show only the members of a (single) selected set.
- Allow combination of -c and -t, to show headers and members sum of 
(selected) sets.
- Add ipset version checking (allow 6.x and upwards).
- Check for BASH variable.
- Added version.
- Don't display member count (of 0) if an invalid set name is used.
- More exammples and comments.

Attached and hopefully bug-free

Best regards



[-- Attachment #2: ipset_list_v1.tgz --]
[-- Type: application/x-compressed, Size: 2399 bytes --]

  reply	other threads:[~2013-01-10 21:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 16:05 Wrapper script for ipset listing Born Without
2013-01-05 16:16 ` Born Without
2013-01-06  4:54   ` Born Without
2013-01-05 17:10 ` Jan Engelhardt
2013-01-06  3:50   ` Born Without
2013-01-06 20:06     ` Jan Engelhardt
2013-01-07  7:59       ` Jozsef Kadlecsik
2013-01-09  6:52         ` Born Without
2013-01-09 11:52           ` Pablo Neira Ayuso
2013-01-10 12:53             ` Born Without
2013-01-10 15:01               ` Eliezer Croitoru
2013-01-10 21:18                 ` Born Without
2013-01-10 15:19               ` Jozsef Kadlecsik
2013-01-10 21:15                 ` Born Without [this message]
2013-01-10 21:37                   ` Born Without
2013-01-11  8:19             ` Born Without
2013-01-21  8:31             ` Born Without
2013-01-21  8:55               ` Jozsef Kadlecsik

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=50EF2F8A.7040804@airpost.net \
    --to=blackhole@airpost.net \
    --cc=jengelh@inai.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.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 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.