--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#include <limits.h>
+
+#include "graph.h"
+#include "legacy-port-scans.h"
+
+static int legacy_port_scans_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Port Scans"));
+}
+
+static int legacy_port_scans_render(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, td_args* args, const char* object) {
+ int r;
+
+ const char* sources[] = {
+ "DROP_PSCAN",
+ "DROP_PSCAN_ICMP",
+ "DROP_PSCAN_TCP",
+ "DROP_PSCAN_UDP",
+ "DROP_PSCAN_FRAG",
+ NULL,
+ };
+
+ // Load all sources
+ r = td_graph_require_sources(graph, args, "iptables", sources);
+ if (r < 0)
+ return r;
+
+ // Draw the area backgrouns
+ DRAW_AREA_BACKGROUND(args, "packets", "DROP_PSCAN_FRAG", COLOR_IP_FRAG, 0);
+ DRAW_AREA_BACKGROUND(args, "packets", "DROP_PSCAN_ICMP", COLOR_ICMP, STACKED);
+ DRAW_AREA_BACKGROUND(args, "packets", "DROP_PSCAN_UDP", COLOR_UDP, STACKED);
+ DRAW_AREA_BACKGROUND(args, "packets", "DROP_PSCAN_TCP", COLOR_TCP, STACKED);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_FRAG",
+ COLOR_IP_FRAG, 0, _("Fragmented Packets"));
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_FRAG", PPS);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_ICMP",
+ COLOR_ICMP, STACKED, _("ICMP"));
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_ICMP", PPS);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_UDP",
+ COLOR_UDP, STACKED, _("UDP"));
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_UDP", PPS);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "packets", "DROP_PSCAN_TCP",
+ COLOR_TCP, STACKED, _("TCP"));
+ PRINT_CAMM(args, "packets", "DROP_PSCAN_TCP", PPS);
+
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ return 0;
+}
+
+const td_graph_impl legacy_port_scans_graph = {
+ .name = "LegacyPortScans",
+ .render = legacy_port_scans_render,
+ .title = legacy_port_scans_title,
+ .vlabel = td_graph_vlabel_pps,
+
+ // Flags
+ .flags = TELEMETRY_GRAPH_REVERSE,
+
+ // Limits
+ .lower_limit = 0,
+ .upper_limit = LONG_MAX,
+};
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef TELEMETRY_GRAPH_LEGACY_PORT_SCANS_H
+#define TELEMETRY_GRAPH_LEGACY_PORT_SCANS_H
+
+#include "../graph.h"
+
+extern const td_graph_impl legacy_port_scans_graph;
+
+#endif /* TELEMETRY_GRAPH_LEGACY_PORT_SCANS_H */