Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 884

Přidáno uživatelem Michal Kliment před více než 13 roky(ů)

Merge oprav z vetve ulogd do testingu.

Zobrazit rozdíly:

freenetis/branches/testing/application/helpers/callback.php
break;
}
echo self::$order_number.'.';
echo $order_number.'.';
}
/**
freenetis/branches/testing/application/upgrade_sql/upgrade_sql.php
// array of sql queries that upgrade database
$upgrade_sql[get_SVN_rev()] = array(
"INSERT INTO `axo_sections` (`id`, `value`, `order_value`, `name`, `hidden`) VALUES ('26', 'Ulogd_Controller', '1', 'Network traffics of ip addresses and members', '0');",
"CREATE FUNCTION `INSERT_CT`(
`_orig_ip_saddr` int unsigned,
`_orig_ip_daddr` int unsigned,
`_orig_ip_protocol` tinyint(3) unsigned,
`_orig_l4_sport` int(5),
`_orig_l4_dport` int(5),
`_orig_raw_pktlen` bigint,
`_orig_raw_pktcount` bigint,
`_reply_ip_daddr` int unsigned,
`_reply_l4_dport` int(5),
`_reply_raw_pktlen` bigint,
`_reply_raw_pktcount` bigint,
`_icmp_code` tinyint(3),
`_icmp_type` tinyint(3),
`_flow_start_sec` int(10),
`_flow_end_sec` int(10)
) RETURNS bigint(20) unsigned
READS SQL DATA
BEGIN
INSERT INTO ulog2_ct
(orig_ip_saddr, orig_ip_daddr, orig_ip_protocol,
orig_l4_sport, orig_l4_dport, orig_raw_pktlen, orig_raw_pktcount,
reply_ip_daddr,
reply_l4_dport, reply_raw_pktlen, reply_raw_pktcount,
icmp_code, icmp_type,
flow_start_sec,
flow_end_sec
)
VALUES (_orig_ip_saddr, _orig_ip_daddr, _orig_ip_protocol,
_orig_l4_sport, _orig_l4_dport, _orig_raw_pktlen, _orig_raw_pktcount,
_reply_ip_daddr,
_reply_l4_dport, _reply_raw_pktlen, _reply_raw_pktcount,
_icmp_code, _icmp_type,
_flow_start_sec,
_flow_end_sec
);
RETURN LAST_INSERT_ID();
END",
"INSERT INTO `axo` (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES ('172', 'Ulogd_Controller', 'ip_address', '0', 'IP address', '0'), ('173', 'Ulogd_Controller', 'member', '0', 'Member', '0');",
"CREATE FUNCTION `insert_rand`() RETURNS bigint(20) unsigned
READS SQL DATA
BEGIN
SET @tnow=now();
INSERT INTO ulog2_ct
(orig_ip_daddr,
orig_l4_dport,
reply_l4_dport,
flow_start_sec,
flow_end_sec
)
VALUES (
rand()*4294967295,
rand()*80,
rand()*65535,
unix_timestamp(@tnow - interval (rand()*60) second),
unix_timestamp(@tnow)
);
RETURN LAST_INSERT_ID();
END",
"INSERT INTO `axo_map` (`acl_id`,`section_value`,`value`) VALUES ('38', 'Ulogd_Controller', 'ip_address'), ('38', 'Ulogd_Controller', 'member');",
"CREATE FUNCTION `ip2str`(ip INT UNSIGNED) RETURNS varchar(15) CHARSET latin1
DETERMINISTIC
RETURN concat(ip & 255, \".\", ip>>8 & 255, \".\", ip>>16 & 255, \".\", ip>>24)",
"INSERT INTO `axo_map` (`acl_id`,`section_value`,`value`) VALUES ('49', 'Ulogd_Controller', 'ip_address'), ('49', 'Ulogd_Controller', 'member');",
"CREATE FUNCTION `swap_endian`(ip INT UNSIGNED) RETURNS int(10) unsigned
DETERMINISTIC
RETURN ((ip & 255)<<24 | (ip & 65280)<<8 | (ip>>8 & 65280) | ip>>24)"
"CREATE TABLE IF NOT EXISTS `ip_addresses_traffics` (
`ip_address` varchar(15) COLLATE utf8_czech_ci NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`member_id` int(11) DEFAULT NULL,
PRIMARY KEY (`ip_address`),
KEY `member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `members_traffics` (
`member_id` int(11) NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`member_id`),
KEY `active` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `members_traffics_daily` (
`member_id` int(11) NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`day` date NOT NULL,
PRIMARY KEY (`member_id`,`day`),
KEY `member_id` (`member_id`),
KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `ulog2_ct` (
`_ct_id` tinyint(4) DEFAULT NULL,
`orig_ip_saddr` int(10) unsigned DEFAULT NULL,
`orig_ip_daddr` int(10) unsigned DEFAULT NULL,
`orig_ip_protocol` tinyint(3) unsigned DEFAULT NULL,
`orig_l4_sport` smallint(5) unsigned DEFAULT NULL,
`orig_l4_dport` smallint(5) unsigned DEFAULT NULL,
`orig_raw_pktlen` bigint(20) DEFAULT '0',
`orig_raw_pktcount` int(10) unsigned DEFAULT '0',
`reply_ip_daddr` int(10) unsigned DEFAULT NULL,
`reply_l4_dport` smallint(5) unsigned DEFAULT NULL,
`reply_raw_pktlen` bigint(20) DEFAULT '0',
`reply_raw_pktcount` int(10) unsigned DEFAULT '0',
`icmp_code` tinyint(3) DEFAULT NULL,
`icmp_type` tinyint(3) DEFAULT NULL,
`flow_start_sec` int(10) DEFAULT '0',
`flow_end_sec` int(10) DEFAULT '0',
KEY `ct_tuple` (`flow_start_sec`,`orig_ip_daddr`,`orig_l4_dport`,`reply_l4_dport`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
);
?>
freenetis/branches/testing/application/upgrade_sql/upgrade_sql_877.php
<?php
// array of sql queries that upgrade database
$upgrade_sql[877] = array(
"INSERT INTO `axo_sections` (`id`, `value`, `order_value`, `name`, `hidden`) VALUES ('26', 'Ulogd_Controller', '1', 'Network traffics of ip addresses and members', '0');",
"INSERT INTO `axo` (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES ('172', 'Ulogd_Controller', 'ip_address', '0', 'IP address', '0'), ('173', 'Ulogd_Controller', 'member', '0', 'Member', '0');",
"INSERT INTO `axo_map` (`acl_id`,`section_value`,`value`) VALUES ('38', 'Ulogd_Controller', 'ip_address'), ('38', 'Ulogd_Controller', 'member');",
"INSERT INTO `axo_map` (`acl_id`,`section_value`,`value`) VALUES ('49', 'Ulogd_Controller', 'ip_address'), ('49', 'Ulogd_Controller', 'member');",
"CREATE TABLE IF NOT EXISTS `ip_addresses_traffics` (
`ip_address` varchar(15) COLLATE utf8_czech_ci NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`member_id` int(11) DEFAULT NULL,
PRIMARY KEY (`ip_address`),
KEY `member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `members_traffics` (
`member_id` int(11) NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`member_id`),
KEY `active` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `members_traffics_daily` (
`member_id` int(11) NOT NULL,
`upload` int(11) unsigned NOT NULL,
`download` int(11) unsigned NOT NULL,
`day` date NOT NULL,
PRIMARY KEY (`member_id`,`day`),
KEY `member_id` (`member_id`),
KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `ulog2_ct` (
`_ct_id` tinyint(4) DEFAULT NULL,
`orig_ip_saddr` int(10) unsigned DEFAULT NULL,
`orig_ip_daddr` int(10) unsigned DEFAULT NULL,
`orig_ip_protocol` tinyint(3) unsigned DEFAULT NULL,
`orig_l4_sport` smallint(5) unsigned DEFAULT NULL,
`orig_l4_dport` smallint(5) unsigned DEFAULT NULL,
`orig_raw_pktlen` bigint(20) DEFAULT '0',
`orig_raw_pktcount` int(10) unsigned DEFAULT '0',
`reply_ip_daddr` int(10) unsigned DEFAULT NULL,
`reply_l4_dport` smallint(5) unsigned DEFAULT NULL,
`reply_raw_pktlen` bigint(20) DEFAULT '0',
`reply_raw_pktcount` int(10) unsigned DEFAULT '0',
`icmp_code` tinyint(3) DEFAULT NULL,
`icmp_type` tinyint(3) DEFAULT NULL,
`flow_start_sec` int(10) DEFAULT '0',
`flow_end_sec` int(10) DEFAULT '0',
KEY `ct_tuple` (`flow_start_sec`,`orig_ip_daddr`,`orig_l4_dport`,`reply_l4_dport`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
);
?>

Také k dispozici: Unified diff