source: branches/stable/cgi-bin/ipdb.psql@ 52

Last change on this file since 52 was 4, checked in by Kris Deugau, 20 years ago

Import "new" IPDB development:

March 2004 through end of August 2004

Changes include:

-> Entirely new method of allocating IP space; which should

hopefully reduce the amount of messiness in allocations.

-> IP address processing provided by NetAddr::IP rather than

homebrew code

-> Change DB to PostgreSQL to eliminate some of the problems

caused by using MySQL, and to gain native RDBMS support for
IP addresses.

-> Using NetAddr::IP and Postgres allows (eventually, with

PG >= 7.4) IPV6 without any code changes. In theory.

-> Logging so that if someone makes a change that turns out

to have been wrong for some reason, Blame Can Be Assigned.

-> General code cleanups (split IPDB.pm from CommonWeb.pm,

for instance)

File size: 3.0 KB
Line 
1--
2-- Selected TOC Entries:
3--
4\connect - postgres
5
6--
7-- TOC Entry ID 9 (OID 16556)
8--
9-- Name: "plpgsql_call_handler" () Type: FUNCTION Owner: postgres
10--
11
12CREATE FUNCTION "plpgsql_call_handler" () RETURNS opaque AS '$libdir/plpgsql', 'plpgsql_call_handler' LANGUAGE 'C';
13
14--
15-- TOC Entry ID 10 (OID 16557)
16--
17-- Name: plpgsql Type: PROCEDURAL LANGUAGE Owner:
18--
19
20CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER "plpgsql_call_handler" LANCOMPILER '';
21
22\connect - ipdb
23
24--
25-- TOC Entry ID 2 (OID 25848)
26--
27-- Name: allocations Type: TABLE Owner: ipdb
28--
29
30CREATE TABLE "allocations" (
31 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
32 "custid" character varying(16) DEFAULT '',
33 "type" character(2) DEFAULT '',
34 "city" character varying(30) DEFAULT '',
35 "description" character varying(64) DEFAULT '',
36 "notes" text,
37 "maskbits" integer DEFAULT 128,
38 Constraint "allocations_pkey" Primary Key ("cidr")
39);
40
41--
42-- TOC Entry ID 3 (OID 25854)
43--
44-- Name: customers Type: TABLE Owner: ipdb
45--
46
47CREATE TABLE "customers" (
48 "custid" character varying(16) DEFAULT '' NOT NULL,
49 "name" character varying(64),
50 "street" character varying(25),
51 "street2" character varying(25),
52 "city" character varying(30),
53 "province" character(2),
54 "pocode" character varying(7),
55 "phone" character varying(15),
56 "abuse" character varying(50),
57 "def_rdns" character varying(40),
58 "description" text,
59 Constraint "customers_pkey" Primary Key ("custid")
60);
61
62--
63-- TOC Entry ID 4 (OID 25860)
64--
65-- Name: freeblocks Type: TABLE Owner: ipdb
66--
67
68CREATE TABLE "freeblocks" (
69 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
70 "maskbits" integer DEFAULT 128,
71 "city" character varying(30) DEFAULT '',
72 "routed" character(1) DEFAULT 'n',
73 CHECK (((routed = 'y'::bpchar) OR (routed = 'n'::bpchar))),
74 Constraint "freeblocks_pkey" Primary Key ("cidr")
75);
76
77--
78-- TOC Entry ID 5 (OID 25866)
79--
80-- Name: poolips Type: TABLE Owner: ipdb
81--
82
83CREATE TABLE "poolips" (
84 "pool" cidr DEFAULT '255.255.255.255/32' NOT NULL,
85 "ip" cidr DEFAULT '255.255.255.255/32' NOT NULL,
86 "custid" character varying(16) DEFAULT '' NOT NULL,
87 "city" character varying(30) DEFAULT '',
88 "ptype" character(1) DEFAULT 'c' NOT NULL,
89 "available" character(1) DEFAULT 'y',
90 "notes" text,
91 CHECK ((((ptype = 'c'::bpchar) OR (ptype = 'd'::bpchar)) OR (ptype = 's'::bpchar))),
92 CHECK (((available = 'y'::bpchar) OR (available = 'n'::bpchar))),
93 Constraint "poolips_pkey" Primary Key ("ip")
94);
95
96--
97-- TOC Entry ID 6 (OID 25872)
98--
99-- Name: masterblocks Type: TABLE Owner: ipdb
100--
101
102CREATE TABLE "masterblocks" (
103 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
104 Constraint "masterblocks_pkey" Primary Key ("cidr")
105);
106
107--
108-- TOC Entry ID 7 (OID 25875)
109--
110-- Name: routed Type: TABLE Owner: ipdb
111--
112
113CREATE TABLE "routed" (
114 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
115 "maskbits" integer DEFAULT 128,
116 "city" character varying(30) DEFAULT '',
117 Constraint "routed_pkey" Primary Key ("cidr")
118);
119
120--
121-- TOC Entry ID 8 (OID 31131)
122--
123-- Name: temp Type: TABLE Owner: ipdb
124--
125
126CREATE TABLE "temp" (
127 "ofs" integer
128);
129
Note: See TracBrowser for help on using the repository browser.