Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > b41da6b83e16a4820dac9966ce5b183a > files > 8

fwmon-1.1.0-9mdv2010.0.i586.rpm

/* Describe the firewall host */
CREATE TABLE "hosts" (
	"uname"		varchar(64) PRIMARY KEY,
	"ip"		inet
);

/* Actual filtered packets */
CREATE TABLE "ip_quads" (	
	"id"		SERIAL PRIMARY KEY,
	"host"		varchar(64) NOT NULL,
	"ts"		timestamp NOT NULL,
	"proto"		int4 NOT NULL,
	"src_ip"	inet NOT NULL,
	"dst_ip" 	inet NOT NULL,
	"src_port"	int4 NOT NULL,
	"dst_port" 	int4 NOT NULL,
	CONSTRAINT "ip_quad_host" FOREIGN KEY ("host")
	REFERENCES "hosts" ("uname")
);

/* Our indexes */
CREATE INDEX "dst_ip_ip_quads_key" ON "ip_quads" ("dst_ip");
CREATE INDEX "src_ip_ip_quads_key" ON "ip_quads" ("src_ip");
CREATE INDEX "dst_port_ip_quads_key" ON "ip_quads" ("dst_port");
CREATE INDEX "proto_ip_quads_key" ON "ip_quads" ("proto");
CREATE INDEX "ip_hosts_key" ON "hosts" ("ip");