Re: [HACKERS] cidr

Поиск
Список
Период
Сортировка
От Paul A Vixie
Тема Re: [HACKERS] cidr
Дата
Msg-id 199807240730.AAA18087@bb.rc.vix.com
обсуждение исходный текст
Ответ на Re: [HACKERS] cidr  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] cidr
Список 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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Brandon Ibach
Дата:
Сообщение: CIDR type
Следующее
От: darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Сообщение: Re: [HACKERS] cidr