[123690] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: PL/SQL & CIDR?

daemon@ATHENA.MIT.EDU (Matthew Kaufman)
Fri Mar 12 21:36:18 2010

Date: Fri, 12 Mar 2010 18:36:08 -0800
From: Matthew Kaufman <matthew@matthew.at>
To: Seth Mattinen <sethm@rollernet.us>
In-Reply-To: <4B9AF343.4040704@rollernet.us>
Cc: nanog@nanog.org
Reply-To: matthew@matthew.at
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org

Seth Mattinen wrote:
> On 3/12/2010 09:13, J.D. Falk wrote:
>   
>> Does anyone know of a library, sample code, etc. to help Oracle PL/SQL do CIDR math?
>>
>>     
>
>
> Not exactly sample code, but: I do that with MySQL by storing the IP as
> its integer value and using simple comparisons to see if that stored
> value is within the range of values that a given CIDR mask represents.
> Works great for IPv4 and IPv6 addresses.
>
> ~Seth
>
>   
I do it in MySQL by storing the IP as an integer and the mask as an 
integer and using bitwise operators in the SELECT.

Just something to think about...

Matthew Kaufman


home help back first fref pref prev next nref lref last post