netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* The differences between hash:ip and hash:net.
@ 2015-10-14  7:19 Hongyi Zhao
  2015-10-14  7:41 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 3+ messages in thread
From: Hongyi Zhao @ 2015-10-14  7:19 UTC (permalink / raw)
  To: netfilter

Hi all,

From the ipset manpage, I can see the following depictions:

hash:ip
  The  hash:ip  set type uses a hash to store
  IP host addresses (default) or network addresses.

hash:net
  The hash:net set type uses a hash to store different
  sized  IP  network addresses.

So, it seems that both types can be used to store the network addresses.

Hence, my issues are:

1- Since the hash:ip can be used to store both host addresses and network 
addresses, why the developer design another set type hash:net?

2- It's well know that any host addresses can be written into the form of 
the 32-bits cidr prefix form. Since the ipset type hash:net should also 
can be used to store the host addresses and network addresses.

In one word: what's the differences between hash:ip and hash:net?

Regards
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: The differences between hash:ip and hash:net.
  2015-10-14  7:19 The differences between hash:ip and hash:net Hongyi Zhao
@ 2015-10-14  7:41 ` Jozsef Kadlecsik
  2015-10-14  8:01   ` Hongyi Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Jozsef Kadlecsik @ 2015-10-14  7:41 UTC (permalink / raw)
  To: Hongyi Zhao; +Cc: netfilter

On Wed, 14 Oct 2015, Hongyi Zhao wrote:

> From the ipset manpage, I can see the following depictions:
> 
> hash:ip
>   The  hash:ip  set type uses a hash to store
>   IP host addresses (default) or network addresses.
> 
> hash:net
>   The hash:net set type uses a hash to store different
>   sized  IP  network addresses.
> 
> So, it seems that both types can be used to store the network addresses.
> 
> Hence, my issues are:
> 
> 1- Since the hash:ip can be used to store both host addresses and network 
> addresses, why the developer design another set type hash:net?
> 
> 2- It's well know that any host addresses can be written into the form of 
> the 32-bits cidr prefix form. Since the ipset type hash:net should also 
> can be used to store the host addresses and network addresses.
> 
> In one word: what's the differences between hash:ip and hash:net?

hash:ip can store same size network addresses only (for example all of 
them are /24) while hash:net supports all kind of netblocks (except /0).

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: The differences between hash:ip and hash:net.
  2015-10-14  7:41 ` Jozsef Kadlecsik
@ 2015-10-14  8:01   ` Hongyi Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Hongyi Zhao @ 2015-10-14  8:01 UTC (permalink / raw)
  To: netfilter

On Wed, 14 Oct 2015 09:41:49 +0200, Jozsef Kadlecsik wrote:

> hash:ip can store same size network addresses only (for example all of
> them are /24) while hash:net supports all kind of netblocks (except /0).

Thanks a lot for your notes.

> 
> Best regards,
> Jozsef
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-14  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14  7:19 The differences between hash:ip and hash:net Hongyi Zhao
2015-10-14  7:41 ` Jozsef Kadlecsik
2015-10-14  8:01   ` Hongyi Zhao

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).