Re: INET/CIDR types

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: Sevo Stille <sevo(at)ip23(dot)net>, pgsql-hackers(at)hub(dot)org
Subject: Re: INET/CIDR types
Date: 2000-07-25 02:53:20
Message-ID: Pine.BSO.4.10.10007242252290.4362-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 24 Jul 2000, Larry Rosenman wrote:

> > This whole discussion is quite silly guys.
> >
> > It is quite reasonable to have ability to split CIDR net into two pieces:
> > the network and the bitshift. Second one is already possible, the first
> > one can be accomplished by having functions to convert a cidr/inet to int8
> > (not int4 because of sign thing), and back.
> >
> > Its also very easy to implement ;)
> >
> > This will actually come very useful for many applications. Something I'm
> > working on now (allocation of 'most appropriate' block) requires ability
> > to split a netblock into two, which could be most easily accomplished
> > using int8 math. (net::int8+2^(netmask(net)-1)).
> All I'm looking for is to be able to print all 4 octets of an IP address
> out so that joe user can take the 4 numbers and type it into the
> 4 boxes on a Windows 98 box, and use them.
>
> Is that really that abhorrent?
>
> They also need the 4 octet netmask which I can get now.
>
> All we are missing is a way to print ALL 4 NUMBERS ALL THE TIME
> for the output. It's not asking for classful, and for sure
> we use CIDR all over the place, but for the final output that my
> users see, why can't I have the database just print all 4 octets?

Larry,
With my suggestion, you can do it as follows:

net::int8::inet

(net being of cidr type)
-alex

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Trond Eivind=?iso-8859-1?q?_Glomsr=F8d?= 2000-07-25 02:54:12 Re: State of RPMs
Previous Message Larry Rosenman 2000-07-25 02:40:31 Re: INET/CIDR types