From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@inl.fr>
Subject: [ULOGD PATCH 7/7] Convert SQL procedure to function in MySQL plugins.
Date: Wed, 16 Apr 2008 15:22:41 +0200 [thread overview]
Message-ID: <12083521621679-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <4805E566.7010902@netfilter.org>
DB output plugins have been modified to use function instead of procedure.
This patch convert the conntrack insertion procedure to function.
Signed-off-by: Eric Leblond <eric@inl.fr>
---
:100644 100644 72575b3... b40c961... M doc/mysql-ulogd2.sql
doc/mysql-ulogd2.sql | 56 +++++++++++++++++++++++++------------------------
1 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/doc/mysql-ulogd2.sql b/doc/mysql-ulogd2.sql
index 72575b3..b40c961 100644
--- a/doc/mysql-ulogd2.sql
+++ b/doc/mysql-ulogd2.sql
@@ -703,46 +703,48 @@ END
$$
delimiter $$
-DROP PROCEDURE IF EXISTS INSERT_CT;
-CREATE PROCEDURE INSERT_CT(
- IN `_orig_ip_saddr` binary(16),
- IN `_orig_ip_daddr` binary(16),
- IN `_orig_ip_protocol` tinyint(3) unsigned,
- IN `_orig_l4_sport` int(5),
- IN `_orig_l4_dport` int(5),
- IN `_orig_bytes` bigint,
- IN `_orig_packets` bigint,
- IN `_reply_ip_saddr` binary(16),
- IN `_reply_ip_daddr` binary(16),
- IN `_reply_ip_protocol` tinyint(3) unsigned,
- IN `_reply_l4_sport` int(5),
- IN `_reply_l4_dport` int(5),
- IN `_reply_bytes` bigint,
- IN `_reply_packets` bigint,
- IN `_icmp_code` tinyint(3),
- IN `_icmp_type` tinyint(3),
- IN `_ct_mark` bigint,
- IN `_flow_start_sec` int(10),
- IN `_flow_start_usec` int(10),
- IN `_flow_end_sec` int(10),
- IN `_flow_end_usec` int(10)
- )
+DROP FUNCTION IF EXISTS INSERT_CT;
+CREATE FUNCTION INSERT_CT(
+ `_oob_family` bigint,
+ `_orig_ip_saddr` binary(16),
+ `_orig_ip_daddr` binary(16),
+ `_orig_ip_protocol` tinyint(3) unsigned,
+ `_orig_l4_sport` int(5),
+ `_orig_l4_dport` int(5),
+ `_orig_bytes` bigint,
+ `_orig_packets` bigint,
+ `_reply_ip_saddr` binary(16),
+ `_reply_ip_daddr` binary(16),
+ `_reply_ip_protocol` tinyint(3) unsigned,
+ `_reply_l4_sport` int(5),
+ `_reply_l4_dport` int(5),
+ `_reply_bytes` bigint,
+ `_reply_packets` bigint,
+ `_icmp_code` tinyint(3),
+ `_icmp_type` tinyint(3),
+ `_ct_mark` bigint,
+ `_flow_start_sec` int(10),
+ `_flow_start_usec` int(10),
+ `_flow_end_sec` int(10),
+ `_flow_end_usec` int(10)
+ ) RETURNS bigint unsigned
+READS SQL DATA
BEGIN
- INSERT INTO ulog2_ct (orig_ip_saddr, orig_ip_daddr, orig_ip_protocol,
+ INSERT INTO ulog2_ct (oob_family, orig_ip_saddr, orig_ip_daddr, orig_ip_protocol,
orig_l4_sport, orig_l4_dport, orig_bytes, orig_packets,
reply_ip_saddr, reply_ip_daddr, 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)
- VALUES (_orig_ip_saddr, _orig_ip_daddr, _orig_ip_protocol,
+ VALUES (_oob_family, _orig_ip_saddr, _orig_ip_daddr, _orig_ip_protocol,
_orig_l4_sport, _orig_l4_dport, _orig_bytes, _orig_packets,
_reply_ip_saddr, _reply_ip_daddr, _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);
-
+ RETURN LAST_INSERT_ID();
END
$$
--
1.5.2.5
next prev parent reply other threads:[~2008-04-16 13:22 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-23 16:25 [ULOGD PATCH 0/14] Misc improvements and bugfixes Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 01/14] Fix SQL reconnection algorithm Eric Leblond
2008-04-05 13:55 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 02/14] Suppress ip_as_string configuration variable Eric Leblond
2008-04-05 15:05 ` Pablo Neira Ayuso
2008-04-05 19:00 ` Eric Leblond
2008-04-07 23:50 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 03/14] Fix type of raw.mac_len key in NFLOG Eric Leblond
2008-04-05 14:30 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 04/14] Fix type of raw.mac_len key in ULOG Eric Leblond
2008-04-05 14:33 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 05/14] New MAC2STR plugin for hwmac address conversion Eric Leblond
2008-04-05 14:35 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 06/14] MAC address handling in MySQL output plugin Eric Leblond
2008-04-05 14:51 ` Pablo Neira Ayuso
2008-04-05 19:03 ` Eric Leblond
2008-04-07 23:52 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 07/14] MAC address handling in PgSQL " Eric Leblond
2008-04-05 14:52 ` Pablo Neira Ayuso
2008-03-23 16:25 ` [ULOGD PATCH 08/14] Add state option to NFLOG input plugin Eric Leblond
2008-04-05 15:10 ` Pablo Neira Ayuso
2008-04-05 19:15 ` Eric Leblond
2008-04-07 23:56 ` Pablo Neira Ayuso
2008-04-10 4:56 ` Eric Leblond
2008-04-13 7:03 ` Eric Leblond
2008-04-16 11:39 ` Pablo Neira Ayuso
2008-04-16 13:22 ` [ULOGD PATCH 0/7] Resend, add label to SQL logging Eric Leblond
2008-04-16 13:22 ` [ULOGD PATCH 1/7] Add label option to NFLOG input plugin Eric Leblond
2008-04-27 7:27 ` Pablo Neira Ayuso
2008-04-27 8:44 ` Eric Leblond
2008-04-28 13:44 ` Pablo Neira Ayuso
2008-04-28 13:53 ` [ULOGD PATCH 0/3] Resend: rename label to numeric_label Eric Leblond
2008-04-28 13:53 ` [PATCH 1/3] Add numeric_label option to ULOG input plugin Eric Leblond
2008-04-28 13:53 ` [PATCH 2/3] Add numeric_label option to NFLOG " Eric Leblond
2008-04-28 13:53 ` [PATCH 3/3] Update default configuration to fit last changes Eric Leblond
2008-04-29 14:26 ` [ULOGD PATCH 0/3] Resend: rename label to numeric_label Pablo Neira Ayuso
2008-04-16 13:22 ` [ULOGD PATCH 2/7] Add label support to MySQL schema Eric Leblond
2008-04-16 13:22 ` [ULOGD PATCH 3/7] Add label option to ULOG input plugin Eric Leblond
2008-04-16 13:22 ` [ULOGD PATCH 4/7] Add hook output to ULOG input module Eric Leblond
2008-04-16 13:22 ` [ULOGD PATCH 5/7] Add label support to PGSQL output module Eric Leblond
2008-04-16 13:22 ` [ULOGD PATCH 6/7] Update default configuration to fit last changes Eric Leblond
2008-04-16 13:22 ` Eric Leblond [this message]
2008-03-23 16:25 ` [ULOGD PATCH 09/14] Add state support to MySQL schema Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 10/14] Add state option to ULOG input plugin Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 11/14] Add hook output to ULOG input module Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 12/14] Add state support to PGSQL output module Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 13/14] Update default configuration to fit last changes Eric Leblond
2008-03-23 16:25 ` [ULOGD PATCH 14/14] Fix computation of length of mac address Eric Leblond
2008-04-05 14:56 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12083521621679-git-send-email-eric@inl.fr \
--to=eric@inl.fr \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox