#
# Copyright (C) 2003, David E. Blacka
#
-# $Id: MemIndex.py,v 1.2 2003/04/28 16:43:19 davidb Exp $
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
ci.add("127.0.0.1/24", "net-local-1");
ci.add("127.0.0.1/32", "net-local-2");
- ci.add(Cidr.Cidr.create("216.168.224.0", 22), "net-vrsn-1")
- ci.add(Cidr.Cidr.create("216.168.252.1", 32), "net-vrsn-2")
+ ci.add(Cidr.new("216.168.224.0", 22), "net-vrsn-1")
+ ci.add(Cidr.new("216.168.252.1", 32), "net-vrsn-2")
ci.add("24.36.191.0/24", "net-foo-c")
ci.add("24.36.191.32/27", "net-foo-sub-c")
ci.add("24.36/16", "net-foo-b")
ci.add("48.12.6.0 - 48.12.6.95", "net-bar-1")
print "finding exactly 127.0.0.0/24"
- res = ci.find(Cidr.Cidr.create("127.0.0.0/24"))
+ res = ci.find(Cidr.new("127.0.0.0/24"))
print res
print "finding exactly 127.0.0.16/32"
- res = ci.find(Cidr.Cidr.create("127.0.0.16/32"))
+ res = ci.find(Cidr.new("127.0.0.16/32"))
print res
print "finding exactly 3ffe:4:5:6::0/64"
print res
print "finding supernets of 127.0.0.16/32"
- res = ci.find_supernets(Cidr.Cidr.create("127.0.0.16/32"))
+ res = ci.find_supernets(Cidr.new("127.0.0.16/32"))
print res
print "finding supernets of 24.36.191.32/27"
- res = ci.find(Cidr.Cidr.create("24.36.191.32/27"), 1)
+ res = ci.find(Cidr.new("24.36.191.32/27"), 1)
print res
print "finding supernets of 24.36.191.33/27"
- res = ci.find_supernets(Cidr.Cidr.create("24.36.191.33/27"))
+ res = ci.find_supernets(Cidr.new("24.36.191.33/27"))
print res
print "finding supernets of 24.36.191.64/27"
- res = ci.find_supernets(Cidr.Cidr.create("24.36.191.64/27"))
+ res = ci.find_supernets(Cidr.new("24.36.191.64/27"))
print res
print "finding supernets of 3ffe:4:5:6:7::0/80"
print res
print "finding subnets of 127.0/16"
- res = ci.find_subnets(Cidr.Cidr.create("127.0/16"))
+ res = ci.find_subnets(Cidr.new("127.0/16"))
print res
print "finding subnets of 3ffe:4::0/32"