Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] cidr

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] cidr
Date: 1998-07-24 04:14:03
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers
> I thought that that was the idea to begin with.
> >	cidr
> Right.
> >   host/netmask
> Converted internally to

This is a problem.  Suppose you have:

This is a host with netmask, while:

is a network address.  Paul?

> >	host, implied netmask A,B,C class?
> Letting this convert automatically to a C class may not be what was
> desired.  Better to specify the netmask.  You may be subnetting it
> or even supernetting it.
> >	host?
> I would suggest that should be the same thing unless we have
> a mask len of -1 to signal indeterminate mask length in which case
> gets converted internally to  Further, printing
> a cidr with mask len of 32 (or -1) should print as if the host function
> were called, that is don't print the network info in such cases.


> >  host?/netmask
> But or gives all the information
> that you need.

See example above.  You use the 3 here to know it is a host, because the
IP address extens past the netmask, but what if they are zeros?

> You mean printing netmasks?  As I said, it seems to me that netmasks will
> always be paired with a host or network but perhaps we can set up the
> function table so that netmask on an integer type converts to a netmask
> in the form you suggest.  That would be the truly oo way to do it.

Certainly we could, but it seems nice to have one type just for ip-type

Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

In response to


pgsql-hackers by date

Next:From: The Web AdministratorDate: 1998-07-24 04:22:17
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Previous:From: Ken McGlothlenDate: 1998-07-24 03:53:37
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group