Browse Source

Add icmp id everywhere

Thomas Chevalier 4 years ago
parent
commit
a749da2433
  1. 14
      pgsql-schema.sql

14
pgsql-schema.sql

@ -29,6 +29,7 @@ CREATE TABLE IF NOT EXISTS ct_logs (
reply_raw_pktcount bigint default 0, reply_raw_pktcount bigint default 0,
icmp_code smallint default NULL, icmp_code smallint default NULL,
icmp_type smallint default NULL, icmp_type smallint default NULL,
icmp_id smallint default NULL,
ct_mark bigint default 0, ct_mark bigint default 0,
flow_start timestamp default NULL, flow_start timestamp default NULL,
flow_end timestamp default NULL, flow_end timestamp default NULL,
@ -143,6 +144,7 @@ CREATE OR REPLACE VIEW view_log AS
reply_raw_pktcount as reply_pktcount, reply_raw_pktcount as reply_pktcount,
icmp_code, icmp_code,
icmp_type, icmp_type,
icmp_id,
ct_event, ct_event,
event_name event_name
FROM ct_logs FROM ct_logs
@ -174,6 +176,7 @@ CREATE OR REPLACE FUNCTION INSERT_CT(
IN _reply_raw_pktcount bigint, IN _reply_raw_pktcount bigint,
IN _icmp_code integer, IN _icmp_code integer,
IN _icmp_type integer, IN _icmp_type integer,
IN _icmp_id integer,
IN _ct_mark bigint, IN _ct_mark bigint,
IN _flow_start_sec bigint, IN _flow_start_sec bigint,
IN _flow_start_usec bigint, IN _flow_start_usec bigint,
@ -190,10 +193,10 @@ BEGIN
reply_l4_sport, reply_l4_dport, reply_raw_pktlen, reply_raw_pktcount, reply_l4_sport, reply_l4_dport, reply_raw_pktlen, reply_raw_pktcount,
icmp_code, icmp_type, ct_mark, icmp_code, icmp_type, ct_mark,
flow_start, flow_end, ct_event) flow_start, flow_end, ct_event)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19, VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,
to_timestamp($20) + $21 * interval '1 microsecond', to_timestamp($21) + $22 * interval '1 microsecond',
to_timestamp($22) + $23 * interval '1 microsecond', to_timestamp($23) + $24 * interval '1 microsecond',
$24); $25);
_id = $1; _id = $1;
RETURN _id; RETURN _id;
END END
@ -218,6 +221,7 @@ CREATE OR REPLACE FUNCTION INSERT_OR_REPLACE_CT(
IN _reply_raw_pktcount bigint, IN _reply_raw_pktcount bigint,
IN _icmp_code integer, IN _icmp_code integer,
IN _icmp_type integer, IN _icmp_type integer,
IN _icmp_id integer,
IN _ct_mark bigint, IN _ct_mark bigint,
IN _flow_start_sec bigint, IN _flow_start_sec bigint,
IN _flow_start_usec bigint, IN _flow_start_usec bigint,
@ -255,7 +259,7 @@ BEGIN
AND ct_event < 4; AND ct_event < 4;
END IF; END IF;
ELSE ELSE
_id := INSERT_CT($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24); _id := INSERT_CT($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25);
END IF; END IF;
RETURN _id; RETURN _id;
END END

Loading…
Cancel
Save