Re: [HACKERS] cidr

From: Paul A Vixie <paul(at)vix(dot)com>
To: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] cidr
Date: 1998-07-24 07:30:23
Message-ID: 199807240730.AAA18087@bb.rc.vix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> OK, let me explain what I think Paul was saying. cidr is used for
> networks. You can use it for hosts by specifying /32. It is not the
> same as a netmask. For example:
>
> host 192.24.45.32
>
> Now, this is a host address. We can say its netmask is 255.255.255.0,
> or was can say it is part of network 192.24.45/24, which would allow you
> compute the netmask as 255.255.255.0. The problem is that you need the
> type to support cidr, hosts, and netmasks.

in that case "hosts" and "netmasks" are completely unrelated to "cidr"'s
and no design should try to cover all three similar-sounding-but-different
needs.

> My idea is to internally store the new type as 8 bytes:
>
> ____ ____ ____ ____ ____ ___ ___ ____
> cidr addr x . x . x . x ip6 ip6
> bits len
>
> That way, if they specify cidr bits, we store it. If they don't we make
> the bits field equal -1, and print/sort appropriately. The addr len is
> usually 3, but ip6 is also easy to add by making the addr len equal 6.

ouch!

the cidr i posted has an address family. there was a reason for that.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maarten Boekhold 1998-07-24 07:46:08 Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Previous Message Brandon Ibach 1998-07-24 05:38:03 CIDR type