]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
Update PostgreSQL schema to add the insert procedure for conntrack
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>
Sun, 27 Apr 2008 07:54:56 +0000 (07:54 +0000)
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>
Sun, 27 Apr 2008 07:54:56 +0000 (07:54 +0000)
connections.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
doc/pgsql-ulogd2.sql

index cfef2676e4d868d5e9471d78e360c9f05e7ef46a..a5d686d004fb2f278df064858495d5f49ddac35b 100644 (file)
@@ -228,10 +228,10 @@ CREATE TABLE ulog2_ct (
   icmp_code smallint default NULL,
   icmp_type smallint default NULL,
   ct_mark bigint default 0,
-  flow_start_sec integer default 0,
-  flow_start_usec integer default 0,
-  flow_end_sec integer default 0,
-  flow_end_usec integer default 0,
+  flow_start_sec bigint default 0,
+  flow_start_usec bigint default 0,
+  flow_end_sec bigint default 0,
+  flow_end_usec bigint default 0,
   state smallint default 0
 ) WITH (OIDS=FALSE);
 
@@ -518,6 +518,46 @@ $$ LANGUAGE plpgsql SECURITY INVOKER;
 
 
 
+CREATE OR REPLACE FUNCTION INSERT_CT(
+                IN _oob_family integer,
+                IN _orig_ip_saddr inet,
+                IN _orig_ip_daddr inet,
+                IN _orig_ip_protocol integer,
+                IN _orig_l4_sport integer,
+                IN _orig_l4_dport integer,
+                IN _orig_bytes bigint,
+                IN _orig_packets bigint,
+                IN _reply_ip_saddr inet,
+                IN _reply_ip_daddr inet,
+                IN _reply_ip_protocol integer,
+                IN _reply_l4_sport integer,
+                IN _reply_l4_dport integer,
+                IN _reply_bytes bigint,
+                IN _reply_packets bigint,
+                IN _icmp_code integer,
+                IN _icmp_type integer,
+                IN _ct_mark bigint,
+                IN _flow_start_sec bigint,
+                IN _flow_start_usec bigint,
+                IN _flow_end_sec bigint,
+                IN _flow_end_usec bigint,
+                IN _state smallint
+        )
+RETURNS bigint AS $$
+        INSERT INTO ulog2_ct (oob_family, orig_ip_saddr_str, orig_ip_daddr_str, orig_ip_protocol,
+                        orig_l4_sport, orig_l4_dport, orig_bytes, orig_packets,
+                        reply_ip_saddr_str, reply_ip_daddr_str, reply_ip_protocol,
+                        reply_l4_sport, reply_l4_dport, reply_bytes, reply_packets,
+                        icmp_code, icmp_type, ct_mark, 
+                        flow_start_sec, flow_start_usec,
+                        flow_end_sec, flow_end_usec, state)
+                VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23);
+        SELECT currval('ulog2_ct__ct_id_seq');
+$$ LANGUAGE SQL SECURITY INVOKER;
+
+
+
+
 CREATE OR REPLACE FUNCTION DELETE_PACKET(
                 IN _packet_id bigint
         )