From ad38df33455ccaa2fe724bad762374ff635f1675 Mon Sep 17 00:00:00 2001 From: vgilc Date: Tue, 10 Jan 2012 15:23:56 +0000 Subject: [PATCH] 2012-01-10 Vanessa Gil * pandoradb.sql pandoradb.oracle.sql pandoradb.postgreSQL.sql extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql godmode/netflow/nf_edit_form.php operation/netflow/nf_view.php: Changes in output format of netflow. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5339 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++++++ .../pandoradb_migrate_4.0.x_to_4.1.mysql.sql | 5 +-- .../pandoradb_migrate_4.0.x_to_4.1.oracle.sql | 19 ++++++++++ ...doradb_migrate_4.0.x_to_4.1.postgreSQL.sql | 5 +-- .../godmode/netflow/nf_edit_form.php | 38 ++++--------------- pandora_console/operation/netflow/nf_view.php | 14 +------ pandora_console/pandoradb.oracle.sql | 5 +-- pandora_console/pandoradb.postgreSQL.sql | 5 +-- pandora_console/pandoradb.sql | 5 +-- 9 files changed, 44 insertions(+), 63 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b2230deb06..6644db5480 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-01-10 Vanessa Gil + * pandoradb.sql + pandoradb.oracle.sql + pandoradb.postgreSQL.sql + extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql + extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql + extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql + godmode/netflow/nf_edit_form.php + operation/netflow/nf_view.php: Changes in output format + of netflow. + 2012-01-10 Vanessa Gil * operation/netflow/nf_view.php: Fixed filter netflow. diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql index 231d1ce5bd..3fd5924631 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql @@ -11,10 +11,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` ( `dst_port` varchar(100), `src_port` varchar(100), `aggregate` varchar(60), - `show_packets` int(1) default '0', - `show_bytes` int(1) default '0', - `show_bps` int(1) default '0', - `show_bpp` int(1) default '0', + `output` varchar(60), PRIMARY KEY (`id_sg`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql index 1a71ddc6e1..7ddf4cf8e2 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql @@ -4,6 +4,25 @@ alter table tusuario add (disabled NUMBER(10,0) default 0 NOT NULL); +-- ----------------------------------------------------- +-- Table "tnetflow_filter" +-- ----------------------------------------------------- + +CREATE TABLE tnetflow_filter ( +id_sg NUMBER(10, 0) NOT NULL PRIMARY KEY, +id_name VARCHAR2(100) NOT NULL, +"group" VARCHAR2(50), +ip_dst VARCHAR2(100), +ip_src VARCHAR2(100), +dst_port VARCHAR2(100), +src_port VARCHAR2(100), +aggregate VARCHAR2(60), +output VARCHAR2(60) +); + +CREATE SEQUENCE tnetflow_filter_s INCREMENT BY 1 START WITH 1; +CREATE OR REPLACE TRIGGER tnetflow_filter_inc BEFORE INSERT ON tnetflow_filter REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetflow_filter_s.nextval INTO :NEW.ID_SG FROM dual; END tnetflow_filter_inc;; + -- ----------------------------------------------------- -- Table "tnetflow_report" -- ----------------------------------------------------- diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql index dfabde8eab..16785f6932 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql @@ -16,10 +16,7 @@ CREATE TABLE "tnetflow_filter" ( "dst_port" varchar(100), "src_port" varchar(100), "aggregate" varchar(60), - "show_packets" SMALLINT default 0, - "show_bytes" SMALLINT default 0, - "show_bps" SMALLINT default 0, - "show_bpp" SMALLINT default 0 + "output" varchar(60) ); -- ----------------------------------------------------- diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 0d91c91f6d..0ae024217b 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -56,10 +56,7 @@ if ($id) { $dst_port = $filter['dst_port']; $src_port = $filter['src_port']; $aggregate = $filter['aggregate']; - $show_packets = $filter['show_packets']; - $show_bytes = $filter['show_bytes']; - $show_bps = $filter['show_bps']; - $show_bpp = $filter['show_bpp']; + $output = $filter['output']; } else { $name = ''; @@ -69,21 +66,14 @@ if ($id) { $dst_port = ''; $src_port = ''; $aggregate = 'none'; - $show_packets = ''; - $show_bytes = 1; - $show_bps = ''; - $show_bpp = ''; - + $output = 'bytes'; } if ($update) { $name = (string) get_parameter ('name'); $assign_group = (int) get_parameter ('assign_group'); $aggregate = get_parameter('aggregate',''); - $show_packets = (bool)get_parameter('show_packets'); - $show_bytes = (bool)get_parameter('show_bytes'); - $show_bps = (bool)get_parameter('show_bps'); - $show_bpp = (bool)get_parameter('show_bpp'); + $output = get_parameter('output','bytes'); $ip_dst = get_parameter('ip_dst',''); $ip_src = get_parameter('ip_src',''); $dst_port = get_parameter('dst_port',''); @@ -117,10 +107,7 @@ if ($create){ $name = (string) get_parameter ('name'); $assign_group = (int) get_parameter ('assign_group'); $aggregate = get_parameter('aggregate','none'); - $show_packets = (bool)get_parameter('show_packets',0); - $show_bytes = (bool)get_parameter('show_bytes',1); - $show_bps = (bool)get_parameter('show_bps',0); - $show_bpp = (bool)get_parameter('show_bpp',0); + $output = get_parameter('output','bytes'); $ip_dst = get_parameter('ip_dst',''); $ip_src = get_parameter('ip_src',''); $dst_port = get_parameter('dst_port',''); @@ -137,10 +124,7 @@ if ($create){ 'dst_port'=>$dst_port, 'src_port'=>$src_port, 'aggregate'=>$aggregate, - 'show_packets'=>$show_packets, - 'show_bytes'=>$show_bytes, - 'show_bps'=>$show_bps, - 'show_bpp'=>$show_bpp + 'output'=>$output ); $result = db_process_sql_insert('tnetflow_filter', $values); } @@ -190,15 +174,9 @@ $aggregate_list = array ('none' => __('None'), 'proto' => __('Protocol'), 'srcip $table->data[7][1] = html_print_select ($aggregate_list, "aggregate", $aggregate, '', '', 0, true, false, true, '', false); $table->data[8][0] = ''.__('Output format').''; - -$table->data[8][1] = __('Packets'); -$table->data[8][1] .= html_print_checkbox ('show_packets', 1, $show_packets, true); -$table->data[8][1] .= __('Bytes'); -$table->data[8][1] .= html_print_checkbox ('show_bytes', 1, $show_bytes, true); -$table->data[8][1] .= __('Bits per second'); -$table->data[8][1] .= html_print_checkbox ('show_bps', 1, $show_bps, true); -$table->data[8][1] .= __('Bytes per packet'); -$table->data[8][1] .= html_print_checkbox ('show_bpp', 1, $show_bpp, true); +$show_output = array(); +$show_output = array ('packets' => __('Packets'), 'bytes' => __('Bytes'), 'bps' =>__('Bits per second'), 'bpp' =>__('Bytes per packet')); +$table->data[8][1] = html_print_select ($show_output, 'output', $output, '', '', 0, true, false, true, '', false); echo '
'; html_print_table ($table); diff --git a/pandora_console/operation/netflow/nf_view.php b/pandora_console/operation/netflow/nf_view.php index f3ae48da24..a62e43dbf1 100644 --- a/pandora_console/operation/netflow/nf_view.php +++ b/pandora_console/operation/netflow/nf_view.php @@ -285,10 +285,7 @@ if ($id!=''){ $dst_port = $result['dst_port']; $src_port = $result['src_port']; $aggregate = $result['aggregate']; - $show_packets = $result['show_packets']; - $show_bytes = $result['show_bytes']; - $show_bps = $result['show_bps']; - $show_bpp = $result['show_bpp']; + $show = $result['output']; if(isset($ip_dst)){ $val_ipdst = explode(',',$ip_dst); @@ -389,15 +386,6 @@ if ($id!=''){ $command .= $filter; } - if ($show_packets) - $show = 'packets'; - if ($show_bytes) - $show = 'bytes'; - if ($show_bps) - $show = 'bps'; - if ($show_bpp) - $show = 'bpp'; - // Data iterator $j = 0; $values = array(); diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 94e66f8ff7..1fa3a6bb37 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -1489,10 +1489,7 @@ ip_src VARCHAR2(100), dst_port VARCHAR2(100), src_port VARCHAR2(100), aggregate VARCHAR2(60), -show_packets NUMBER(1, 0) default 0, -show_bytes NUMBER(1, 0) default 0, -show_bps NUMBER(1, 0) default 0, -show_bpp NUMBER(1, 0) default 0 +output VARCHAR2(60) ); CREATE SEQUENCE tnetflow_filter_s INCREMENT BY 1 START WITH 1; diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 4bf54234b7..0b3729cc60 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -1202,10 +1202,7 @@ CREATE TABLE "tnetflow_filter" ( "dst_port" varchar(100), "src_port" varchar(100), "aggregate" varchar(60), - "show_packets" SMALLINT default 0, - "show_bytes" SMALLINT default 0, - "show_bps" SMALLINT default 0, - "show_bpp" SMALLINT default 0 + "output" varchar(60) ); -- ----------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 28753f66d8..51086b4958 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1293,10 +1293,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` ( `dst_port` varchar(100), `src_port` varchar(100), `aggregate` varchar(60), - `show_packets` int(1) default '0', - `show_bytes` int(1) default '0', - `show_bps` int(1) default '0', - `show_bpp` int(1) default '0', + `output` varchar(60), PRIMARY KEY (`id_sg`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;