diff --git a/net-mgmt/pmacct/Makefile b/net-mgmt/pmacct/Makefile index 0aaddaf8a6eb..f106397f51e6 100644 --- a/net-mgmt/pmacct/Makefile +++ b/net-mgmt/pmacct/Makefile @@ -1,89 +1,90 @@ PORTNAME= pmacct -DISTVERSION= 1.7.7 -PORTREVISION= 1 +DISTVERSION= 1.7.8 CATEGORIES= net-mgmt MASTER_SITES= http://www.pmacct.net/ MAINTAINER= pi@FreeBSD.org COMMENT= Accounting and aggregation tool for IPv4 and IPv6 traffic WWW= http://www.pmacct.net/ LICENSE= GPLv2 +LIB_DEPENDS= libcdada.so:devel/libcdada + USES= gmake libtool pkgconfig localbase autoreconf USE_RC_SUBR= pmacctd nfacctd sfacctd SUB_FILES= pkg-message GNU_CONFIGURE= yes OPTIONS_DEFINE= MYSQL PGSQL SQLITE3 LAYER2 DEBUG GEOIP2 \ DOCS RABBITMQ REDIS KAFKA AVRO EXAMPLES OPTIONS_DEFAULT=LAYER2 OPTIONS_SUB= yes AVRO_DESC= Enable avro support GEOIP2_DESC= Enable GeoIPv2 (libmaxminddb) support KAFKA_DESC= Enable Kafka support LAYER2_DESC= Enable Layer-2 support: MAC addresses and VLANs RABBITMQ_DESC= Enable RabbitMQ/AMQP support REDIS_DESC= Enable Redis support SQLITE3_DESC= Enable SQLite3 support SQLDOC= "@comment " MYSQL_USES= mysql MYSQL_CONFIGURE_ENABLE= mysql MYSQL_VARS+= SQLDOC="" PGSQL_USES= pgsql PGSQL_CONFIGURE_ENABLE= pgsql PGSQL_VARS+= WANT_PGSQL=client PGSQL_VARS+= SQLDOC="" SQLITE3_USES= sqlite SQLITE3_CONFIGURE_ENABLE= sqlite3 SQLITE3_VARS= SQLDOC="" LAYER2_CONFIGURE_ENABLE= l2 DEBUG_CONFIGURE_ENABLE= debug RABBITMQ_LIB_DEPENDS= librabbitmq.so:net/rabbitmq-c RABBITMQ_CONFIGURE_ENABLE= rabbitmq REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis REDIS_CONFIGURE_ENABLE= redis KAFKA_LIB_DEPENDS= librdkafka.so:net/librdkafka KAFKA_CONFIGURE_ENABLE= kafka AVRO_LIB_DEPENDS= libavro.so:devel/avro-c AVRO_CONFIGURE_ENABLE= avro GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb GEOIP2_CONFIGURE_ENABLE= geoipv2 .include .include .if ${ARCH} == "i386" -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-i386 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-i386 .endif PLIST_SUB+= SQLDOC=${SQLDOC} .if ${PORT_OPTIONS:MRABBITMQ} || ${PORT_OPTIONS:MKAFKA} LIB_DEPENDS+= libjansson.so:devel/jansson CONFIGURE_ARGS+=--enable-jansson .endif post-install: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} (cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/[A-Z]* ${STAGEDIR}${DOCSDIR} .for i in AUTHORS CONFIG-KEYS COPYING ChangeLog FAQS INSTALL QUICKSTART UPGRADE ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} .endfor ${MKDIR} ${STAGEDIR}${DATADIR} .include diff --git a/net-mgmt/pmacct/distinfo b/net-mgmt/pmacct/distinfo index e0c589a9eb67..f8ecc9c78900 100644 --- a/net-mgmt/pmacct/distinfo +++ b/net-mgmt/pmacct/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1638535520 -SHA256 (pmacct-1.7.7.tar.gz) = 8c781f38565bb899a31feb0962676a3c9ce712cf180fe0dca9120bfb15ddfb8c -SIZE (pmacct-1.7.7.tar.gz) = 2149629 +TIMESTAMP = 1677233508 +SHA256 (pmacct-1.7.8.tar.gz) = 4df50a3c6c7bdace3345bbf3bd4f6fa7a6722ec1fb45dfd266ad956b327da98a +SIZE (pmacct-1.7.8.tar.gz) = 2175335 diff --git a/net-mgmt/pmacct/files/patch-Makefile.in b/net-mgmt/pmacct/files/patch-Makefile.in index 7d6adba5db55..d6f1abc50bbf 100644 --- a/net-mgmt/pmacct/files/patch-Makefile.in +++ b/net-mgmt/pmacct/files/patch-Makefile.in @@ -1,11 +1,11 @@ ---- Makefile.in.orig 2021-11-05 15:04:53 UTC +--- Makefile.in.orig 2022-12-31 19:18:37 UTC +++ Makefile.in -@@ -429,7 +429,7 @@ pmacct_examples_avro_dir = $(pmacct_examples_dir)/avro +@@ -433,7 +433,7 @@ pmacct_examples_custom_dir = $(pmacct_examples_arch_di @USING_BGP_BINS_TRUE@pmacct_examples_lg_dir = $(pmacct_examples_dir)/lg @USING_BGP_BINS_TRUE@pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg pmacct_examples_custom_dir = $(pmacct_examples_arch_dir)/custom -@USING_SQL_TRUE@pmacct_sql_dir = $(pmacct_data_dir)/sql +@USING_SQL_TRUE@pmacct_sql_dir = $(pmacct_data_dir) pmacct_data__DATA = CONFIG-KEYS FAQS QUICKSTART UPGRADE pmacct_docs__DATA = docs/IPFIX docs/LOOKING_GLASS_FORMAT docs/SIGNALS \ docs/MSGLOG_DUMP_FORMATS docs/TRIGGER_VARS diff --git a/net-mgmt/pmacct/files/patch-configure.ac b/net-mgmt/pmacct/files/patch-configure.ac deleted file mode 100644 index c917463ca363..000000000000 --- a/net-mgmt/pmacct/files/patch-configure.ac +++ /dev/null @@ -1,20 +0,0 @@ ---- configure.ac.orig 2021-11-05 16:03:23.000000000 +0100 -+++ configure.ac 2022-04-15 16:15:06.250117000 +0200 -@@ -404,9 +404,14 @@ - AC_CHECK_HEADERS([mysql.h mysql/mysql.h]) - CFLAGS="$_save_CFLAGS" - -- AC_CHECK_LIB([numa], [numa_bind], [], [AC_MSG_ERROR([ -- ERROR: missing libnuma. Requirement for building MySQL. -- ])]) -+ case "$host_os" in -+ linux*) -+ AC_CHECK_LIB([numa], [numa_bind], [], [AC_MSG_ERROR([ -+ ERROR: missing libnuma. Requirement for building MySQL. -+ ])]) -+ ;; -+ esac -+ - ;; - no) - AC_MSG_RESULT(no) diff --git a/net-mgmt/pmacct/files/patch-src_bgp_bgp.c b/net-mgmt/pmacct/files/patch-src_bgp_bgp.c index 3c500325b54d..c49915049686 100644 --- a/net-mgmt/pmacct/files/patch-src_bgp_bgp.c +++ b/net-mgmt/pmacct/files/patch-src_bgp_bgp.c @@ -1,14 +1,14 @@ ---- src/bgp/bgp.c.orig 2022-05-28 08:30:21 UTC +--- src/bgp/bgp.c.orig 2022-12-31 19:17:17 UTC +++ src/bgp/bgp.c -@@ -830,9 +830,9 @@ void skinny_bgp_daemon_online() +@@ -898,9 +898,9 @@ void skinny_bgp_daemon_online() bgp_peer_close(&peers[peers_check_idx], FUNC_TYPE_BGP, FALSE, FALSE, FALSE, FALSE, NULL); } else { - Log(LOG_WARNING, "WARN ( %s/%s ): [%s] Refusing new connection from existing peer (residual holdtime: %ld).\n", + Log(LOG_WARNING, "WARN ( %s/%s ): [%s] Refusing new connection from existing peer (residual holdtime: %lld).\n", config.name, bgp_misc_db->log_str, bgp_peer_str, - (peers[peers_check_idx].ht - ((long)now - peers[peers_check_idx].last_keepalive))); + (long long)(peers[peers_check_idx].ht - ((long)now - peers[peers_check_idx].last_keepalive))); FD_CLR(peer->fd, &bkp_read_descs); bgp_peer_close(peer, FUNC_TYPE_BGP, FALSE, FALSE, FALSE, FALSE, NULL); goto read_data; diff --git a/net-mgmt/pmacct/files/patch-src_bgp_bgp__lookup.c b/net-mgmt/pmacct/files/patch-src_bgp_bgp__lookup.c new file mode 100644 index 000000000000..81fd259f464e --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_bgp_bgp__lookup.c @@ -0,0 +1,20 @@ +--- src/bgp/bgp_lookup.c.orig 2022-12-31 19:17:17 UTC ++++ src/bgp/bgp_lookup.c +@@ -349,7 +349,7 @@ + struct in6_addr pref6; + u_char *saved_agent = pptrs->f_agent; + pm_id_t bta; +- u_int32_t modulo, local_modulo, modulo_idx, modulo_max; ++ u_int32_t modulo, modulo_idx, modulo_max; + + bms = bgp_select_misc_db(type); + inter_domain_routing_db = bgp_select_routing_db(type); +@@ -421,7 +421,7 @@ + + // XXX: to be optimized + if (result_node) { +- for (local_modulo = modulo, modulo_idx = 0; modulo_idx < modulo_max; local_modulo++, modulo_idx++) { ++ for (modulo_idx = 0; modulo_idx < modulo_max; modulo_idx++) { + for (info = result_node->info[modulo]; info; info = info->next) { + if (info->peer == nh_peer) break; + } diff --git a/net-mgmt/pmacct/files/patch-src_external__libs_Makefile.am b/net-mgmt/pmacct/files/patch-src_external__libs_Makefile.am index aac851998bc8..f53a8c135f02 100644 --- a/net-mgmt/pmacct/files/patch-src_external__libs_Makefile.am +++ b/net-mgmt/pmacct/files/patch-src_external__libs_Makefile.am @@ -1,16 +1,81 @@ ---- src/external_libs/Makefile.am.orig 2021-11-05 15:03:23.000000000 +0000 -+++ src/external_libs/Makefile.am 2022-04-15 12:37:36.692736000 +0000 -@@ -45,11 +45,12 @@ - fi;\ +--- src/external_libs/Makefile.am.orig 2022-12-31 19:17:17 UTC ++++ src/external_libs/Makefile.am +@@ -12,45 +12,46 @@ libcdada: + ## LIBCDADA + ## + libcdada: +- @not_git=0; \ +- if [ -z "`git rev-parse HEAD 2> /dev/null`" ]; then \ +- if [ -f "$(abs_srcdir)/libcdada/include/cdada.h" ]; then \ +- not_git=1; \ +- PMACCT_EXT_LIBS_DONT_SYNC=1; \ +- cd $(abs_builddir); \ +- else \ +- echo "[dep: libcdada] Skipping, not a git repository and code not in tree!"; \ +- exit 0;\ +- fi;\ +- fi;\ +- echo "[dep: libcdada] Checking..."; \ +- if [ $$not_git -eq 0 ] && [ ! -f "$(abs_srcdir)/libcdada/.git" ]; then \ +- echo "[dep: libcdada] Cloning and checking out commit..";\ +- cd $(abs_top_srcdir); \ +- git submodule update --init --recursive src/external_libs/libcdada; \ +- if [ $$? != 0 ]; then exit 1; fi;\ +- cd $(abs_builddir); \ +- fi;\ ++# @not_git=0; \ ++# if [ -z "`git rev-parse HEAD 2> /dev/null`" ]; then \ ++# if [ -f "$(abs_srcdir)/libcdada/include/cdada.h" ]; then \ ++# not_git=1; \ ++# PMACCT_EXT_LIBS_DONT_SYNC=1; \ ++# cd $(abs_builddir); \ ++# else \ ++# echo "[dep: libcdada] Skipping, not a git repository and code not in tree!"; \ ++# exit 0;\ ++# fi;\ ++# fi;\ ++# echo "[dep: libcdada] Checking..."; \ ++# if [ $$not_git -eq 0 ] && [ ! -f "$(abs_srcdir)/libcdada/.git" ]; then \ ++# echo "[dep: libcdada] Cloning and checking out commit..";\ ++# cd $(abs_top_srcdir); \ ++# git submodule update --init --recursive src/external_libs/libcdada; \ ++# if [ $$? != 0 ]; then exit 1; fi;\ ++# cd $(abs_builddir); \ ++# fi;\ + if [ ! -f $(abs_builddir)/.libcdada_mark ] || \ +- [ "`cat $(abs_builddir)/.libcdada_mark 2> /dev/null`" != "`git ls-tree HEAD $(abs_srcdir)/libcdada/ | awk '{print $$3}' 2> /dev/null`" ] || \ +- [ "`cat $(abs_builddir)/.libcdada_mark 2> /dev/null`" != "`cd $(abs_srcdir)/libcdada && git rev-parse HEAD 2> /dev/null`" ]; then \ +- \ +- if [ -z "$$PMACCT_EXT_LIBS_DONT_SYNC" ]; then \ +- echo "[dep: libcdada] Syncing commit...";\ +- cd $(abs_top_srcdir); \ +- git submodule update --init --recursive src/external_libs/libcdada 2> /dev/null; \ +- if [ $$? != 0 ]; then exit 1; fi;\ +- cd $(abs_builddir); \ +- else\ +- echo "[dep: libcdada] Skipping commit sync..";\ +- fi;\ ++# [ "`cat $(abs_builddir)/.libcdada_mark 2> /dev/null`" != "`git ls-tree HEAD $(abs_srcdir)/libcdada/ | awk '{print $$3}' 2> /dev/null`" ] || \ ++# [ "`cat $(abs_builddir)/.libcdada_mark 2> /dev/null`" != "`cd $(abs_srcdir)/libcdada && git rev-parse HEAD 2> /dev/null`" ]; then \ ++# \ ++# if [ -z "$$PMACCT_EXT_LIBS_DONT_SYNC" ]; then \ ++# echo "[dep: libcdada] Syncing commit...";\ ++# cd $(abs_top_srcdir); \ ++# git submodule update --init --recursive src/external_libs/libcdada 2> /dev/null; \ ++# if [ $$? != 0 ]; then exit 1; fi;\ ++# cd $(abs_builddir); \ ++# else\ ++# echo "[dep: libcdada] Skipping commit sync..";\ ++# fi;\ echo "[dep: libcdada] Building...";\ mkdir -p $(abs_builddir)/libcdada/build || true; \ + unset LIBS; \ cd $(abs_srcdir)/libcdada/ && \ ./autogen.sh &&\ cd $(abs_builddir)/libcdada/build && \ $(abs_srcdir)/libcdada/configure --disable-shared --host=$(host_alias) @configure_silent_rules_val@ \ - --prefix=$(abs_builddir)/rootfs && make $(MAKE_JOBS) install;\ + --prefix=$(abs_builddir)/rootfs && gmake $(MAKE_JOBS) install;\ if [ $$? != 0 ]; then exit 1; fi; \ echo "`cd $(abs_srcdir)/libcdada && git rev-parse HEAD 2> /dev/null`" > $(abs_builddir)/.libcdada_mark;\ if [ $$? != 0 ]; then exit 1; fi; \ diff --git a/net-mgmt/pmacct/files/patch-src_imt__plugin.h b/net-mgmt/pmacct/files/patch-src_imt__plugin.h new file mode 100644 index 000000000000..d9d9e68580d4 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_imt__plugin.h @@ -0,0 +1,11 @@ +--- src/imt_plugin.h.orig 2022-12-31 19:17:17 UTC ++++ src/imt_plugin.h +@@ -129,7 +129,7 @@ extern int compare_accounting_structure(struct acc *, + extern struct acc *search_accounting_structure(struct primitives_ptrs *); + extern int compare_accounting_structure(struct acc *, struct primitives_ptrs *); + +-extern void init_memory_pool_table(); ++extern void init_memory_pool_table(struct configuration); + extern void clear_memory_pool_table(); + extern struct memory_pool_desc *request_memory_pool(int); + diff --git a/net-mgmt/pmacct/files/patch-src_kafka__plugin.c b/net-mgmt/pmacct/files/patch-src_kafka__plugin.c index 7dbb48e28b8e..4830c65ac188 100644 --- a/net-mgmt/pmacct/files/patch-src_kafka__plugin.c +++ b/net-mgmt/pmacct/files/patch-src_kafka__plugin.c @@ -1,11 +1,11 @@ ---- src/kafka_plugin.c.orig 2020-05-10 13:57:54 UTC +--- src/kafka_plugin.c.orig 2022-12-31 19:17:17 UTC +++ src/kafka_plugin.c -@@ -875,7 +875,7 @@ void kafka_cache_purge(struct chained_cache *queue[], +@@ -916,7 +916,7 @@ void kafka_cache_purge(struct chained_cache *queue[], p_kafka_close(&kafkap_kafka_host, FALSE); - Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", + Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", config.name, config.type, writer_pid, qn, saved_index, duration); if (config.sql_trigger_exec && !safe_action) P_trigger_exec(config.sql_trigger_exec); diff --git a/net-mgmt/pmacct/files/patch-src_memory.c b/net-mgmt/pmacct/files/patch-src_memory.c new file mode 100644 index 000000000000..f53ec578f874 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_memory.c @@ -0,0 +1,11 @@ +--- src/memory.c.orig 2022-12-31 19:17:17 UTC ++++ src/memory.c +@@ -27,7 +27,7 @@ + first pool descriptor id is 1 */ + + /* functions */ +-void init_memory_pool_table() ++void init_memory_pool_table(struct configuration config) + { + if (config.num_memory_pools) { + mpd = (unsigned char *) map_shared(0, (config.num_memory_pools+1)*sizeof(struct memory_pool_desc), diff --git a/net-mgmt/pmacct/files/patch-src_net__aggr.h b/net-mgmt/pmacct/files/patch-src_net__aggr.h new file mode 100644 index 000000000000..35be9ad2e2c2 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_net__aggr.h @@ -0,0 +1,11 @@ +--- src/net_aggr.h.orig 2022-12-31 19:17:17 UTC ++++ src/net_aggr.h +@@ -91,7 +91,7 @@ typedef void (*net_func) (struct networks_table *, str + typedef void (*net_func) (struct networks_table *, struct networks_cache *, struct pkt_primitives *, struct pkt_bgp_primitives *, struct networks_file_data *); + + /* prototypes */ +-extern void set_net_funcs(); ++extern void set_net_funcs(struct networks_table *); + extern void init_net_funcs(struct networks_table *, struct networks_cache *, struct pkt_primitives *, struct pkt_bgp_primitives *, struct networks_file_data *); + extern void mask_src_ipaddr(struct networks_table *, struct networks_cache *, struct pkt_primitives *, struct pkt_bgp_primitives *, struct networks_file_data *); + extern void mask_dst_ipaddr(struct networks_table *, struct networks_cache *, struct pkt_primitives *, struct pkt_bgp_primitives *, struct networks_file_data *); diff --git a/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c b/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c index 399f1e1b395d..f77791d228de 100644 --- a/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c +++ b/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c @@ -1,11 +1,11 @@ ---- src/nfprobe_plugin/netflow9.c.orig 2021-11-05 15:03:23 UTC +--- src/nfprobe_plugin/netflow9.c.orig 2022-12-31 19:17:17 UTC +++ src/nfprobe_plugin/netflow9.c -@@ -2232,7 +2232,7 @@ send_netflow_v9(struct FLOW **flows, int num_flows, in +@@ -2202,7 +2202,7 @@ send_netflow_v9(struct FLOW **flows, int num_flows, in /* Refresh template headers if we need to */ if (nf9_pkts_until_template <= 0) { - u_int16_t flows = 0, tot_len = 0; + u_int16_t flows = 0, tot_len __attribute__((unused)) = 0; memcpy(packet + offset, &v4_template, v4_template.tot_len); offset += v4_template.tot_len; diff --git a/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c b/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c index 29da2faf65c5..0bc2d9b351b1 100644 --- a/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c +++ b/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c @@ -1,11 +1,11 @@ ---- src/pgsql_plugin.c.orig 2021-11-05 15:03:23 UTC +--- src/pgsql_plugin.c.orig 2022-12-31 19:17:17 UTC +++ src/pgsql_plugin.c -@@ -611,7 +611,7 @@ void PG_cache_purge(struct db_cache *queue[], int inde +@@ -607,7 +607,7 @@ void PG_cache_purge(struct db_cache *queue[], int inde if (sql_pqq_ptr) goto start; idata->elap_time = time(NULL)-start; - Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", + Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", config.name, config.type, writer_pid, idata->qn, saved_index, idata->elap_time); if (config.sql_trigger_exec) { diff --git a/net-mgmt/pmacct/files/patch-src_plugin__cmn__avro.c b/net-mgmt/pmacct/files/patch-src_plugin__cmn__avro.c new file mode 100644 index 000000000000..13d9c4b33140 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_plugin__cmn__avro.c @@ -0,0 +1,11 @@ +--- src/plugin_cmn_avro.c.orig 2022-12-31 19:17:17 UTC ++++ src/plugin_cmn_avro.c +@@ -1583,7 +1583,7 @@ + memset(&lbl, 0, sizeof(lbl)); + cdada_list_get(ll, idx_0, &lbl); + /* handling label with value */ +- if (lbl.value) { ++ if (strlen(lbl.value) > 0) { + if (avro_value_get_by_name(&v_type_record, "label", &v_type_union, NULL) == 0) { + avro_value_set_branch(&v_type_union, TRUE, &v_type_branch); + if (avro_value_add(&v_type_branch, lbl.key, &v_type_string, NULL, NULL) == 0) { diff --git a/net-mgmt/pmacct/files/patch-src_pmacct.c b/net-mgmt/pmacct/files/patch-src_pmacct.c index 14d2edd28d6e..7d31883e1877 100644 --- a/net-mgmt/pmacct/files/patch-src_pmacct.c +++ b/net-mgmt/pmacct/files/patch-src_pmacct.c @@ -1,22 +1,22 @@ ---- src/pmacct.c.orig 2021-11-05 15:03:23 UTC +--- src/pmacct.c.orig 2022-12-31 19:17:17 UTC +++ src/pmacct.c -@@ -2915,7 +2915,7 @@ int main(int argc,char **argv) +@@ -2964,7 +2964,7 @@ int main(int argc,char **argv) /* print packets */ else if (which_counter == 1) printf("%" PRIu64 "\n", acc_elem->pkt_num); /* print packets+bytes+flows+num */ - else if (which_counter == 2) printf("%" PRIu64 " %" PRIu64 " %" PRIu64 " %lu\n", acc_elem->pkt_num, acc_elem->pkt_len, acc_elem->flo_num, acc_elem->time_start.tv_sec); + else if (which_counter == 2) printf("%" PRIu64 " %" PRIu64 " %" PRIu64 " %jd\n", acc_elem->pkt_num, acc_elem->pkt_len, acc_elem->flo_num, (intmax_t)acc_elem->time_start.tv_sec); /* print flows */ else if (which_counter == 3) printf("%" PRIu64 "\n", acc_elem->flo_num); } -@@ -3753,8 +3753,8 @@ void pmc_compose_timestamp(char *buf, int buflen, stru +@@ -3814,8 +3814,8 @@ void pmc_compose_timestamp(char *buf, int buflen, stru struct tm *time2; if (tstamp_since_epoch) { - if (usec) snprintf(buf, buflen, "%ld.%.6ld", tv->tv_sec, (long)tv->tv_usec); - else snprintf(buf, buflen, "%ld", tv->tv_sec); + if (usec) snprintf(buf, buflen, "%ld.%.6ld", (long)tv->tv_sec, (long)tv->tv_usec); + else snprintf(buf, buflen, "%ld", (long)tv->tv_sec); } else { time1 = tv->tv_sec; diff --git a/net-mgmt/pmacct/files/patch-src_pretag__handlers.c b/net-mgmt/pmacct/files/patch-src_pretag__handlers.c new file mode 100644 index 000000000000..90006a90c5a6 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_pretag__handlers.c @@ -0,0 +1,18 @@ +--- src/pretag_handlers.c.orig 2022-12-31 19:17:17 UTC ++++ src/pretag_handlers.c +@@ -4231,6 +4231,7 @@ int PT_map_index_fdata_src_net_handler(struct id_table + else return TRUE; + + if (idx_netmask >= 0 && idx->netmask.hdlr_no == (idx_hdlr + 1)) { ++ ret=-1; + if (e->key.src_net.a.family == AF_INET) { + ret = cdada_list_get(idx->netmask.v4.list, idx_netmask, &netmask); + } +@@ -4301,6 +4302,7 @@ int PT_map_index_fdata_dst_net_handler(struct id_table + else return TRUE; + + if (idx_netmask >= 0 && idx->netmask.hdlr_no == (idx_hdlr + 1)) { ++ ret=-1; + if (e->key.dst_net.a.family == AF_INET) { + ret = cdada_list_get(idx->netmask.v4.list, idx_netmask, &netmask); + } diff --git a/net-mgmt/pmacct/files/patch-src_setproctitle.c b/net-mgmt/pmacct/files/patch-src_setproctitle.c new file mode 100644 index 000000000000..7a5a25fc45f6 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_setproctitle.c @@ -0,0 +1,24 @@ +--- src/setproctitle.c.orig 2022-12-31 19:17:17 UTC ++++ src/setproctitle.c +@@ -38,8 +38,7 @@ extern char *__progname; + * NEWSTR -- Create a copy of a C string + */ + +-char *spt_newstr(s) +-const char *s; ++char *spt_newstr(const char *s) + { + size_t l; + char *n; +@@ -81,10 +80,7 @@ void + static char *LastArgv = NULL; /* end of argv */ + + void +-initsetproctitle(argc, argv, envp) +- int argc; +- char **argv; +- char **envp; ++initsetproctitle(int argc, char **argv, char **envp) + { + register int i; + extern char **environ; diff --git a/net-mgmt/pmacct/files/patch-src_sflow.c b/net-mgmt/pmacct/files/patch-src_sflow.c index 8a8df0620e6c..775d5bb85776 100644 --- a/net-mgmt/pmacct/files/patch-src_sflow.c +++ b/net-mgmt/pmacct/files/patch-src_sflow.c @@ -1,11 +1,11 @@ ---- src/sflow.c.orig 2020-05-10 13:57:54 UTC +--- src/sflow.c.orig 2022-12-31 19:17:17 UTC +++ src/sflow.c -@@ -306,7 +306,7 @@ void decodeIPV4(SFSample *sample) +@@ -326,7 +326,7 @@ void decodeIPV6(SFSample *sample) void decodeIPV6(SFSample *sample) { - u_int32_t label; + u_int32_t label __attribute__((unused)); u_int32_t nextHeader; u_char *end = sample->header + sample->headerLen; diff --git a/net-mgmt/pmacct/files/patch-src_sql__common.h b/net-mgmt/pmacct/files/patch-src_sql__common.h index 934a90351a0e..47ef9243d821 100644 --- a/net-mgmt/pmacct/files/patch-src_sql__common.h +++ b/net-mgmt/pmacct/files/patch-src_sql__common.h @@ -1,11 +1,11 @@ ---- src/sql_common.h.orig 2020-02-22 20:28:47 UTC +--- src/sql_common.h.orig 2022-12-31 19:17:17 UTC +++ src/sql_common.h -@@ -64,7 +64,7 @@ +@@ -63,7 +63,7 @@ #define SQL_TABLE_VERSION_BGP 1000 /* macros */ -#define SPACELEFT(x) (sizeof(x)-strlen(x)) +#define SPACELEFT(x) (sizeof(x)-strlen(x)-1) #define SPACELEFT_LEN(x,y) (sizeof(x)-y) #define SPACELEFT_PTR(x,y) (y-strlen(x)) diff --git a/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c b/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c index 27020d9b47a8..966e3eca9565 100644 --- a/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c +++ b/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c @@ -1,11 +1,11 @@ ---- src/sqlite3_plugin.c.orig 2021-11-05 15:03:23 UTC +--- src/sqlite3_plugin.c.orig 2022-12-31 19:17:17 UTC +++ src/sqlite3_plugin.c -@@ -537,7 +537,7 @@ void SQLI_cache_purge(struct db_cache *queue[], int in +@@ -533,7 +533,7 @@ void SQLI_cache_purge(struct db_cache *queue[], int in if (sql_pqq_ptr) goto start; idata->elap_time = time(NULL)-start; - Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", + Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", config.name, config.type, writer_pid, idata->qn, saved_index, idata->elap_time); if (config.sql_trigger_exec) { diff --git a/net-mgmt/pmacct/files/patch-src_util.c b/net-mgmt/pmacct/files/patch-src_util.c index 5217664662c8..370197831d77 100644 --- a/net-mgmt/pmacct/files/patch-src_util.c +++ b/net-mgmt/pmacct/files/patch-src_util.c @@ -1,13 +1,31 @@ ---- src/util.c.orig 2021-11-05 15:03:23 UTC +--- src/util.c.orig 2022-12-31 19:17:17 UTC +++ src/util.c -@@ -2069,8 +2069,8 @@ void compose_timestamp(char *buf, int buflen, struct t +@@ -878,7 +878,7 @@ int handle_dynname_internal_strings(char *new, int new + char proto_string[] = "$proto", in_iface_string[] = "$in_iface"; + + char buf[newlen], *ptr_start, *ptr_end, *ptr_var, *ptr_substr, *last_char; +- int oldlen, var_num, var_len, rem_len, sub_len; ++ int oldlen, var_len, rem_len, sub_len; + + if (!new || !old || !prim_ptrs) return ERR; + +@@ -886,7 +886,7 @@ int handle_dynname_internal_strings(char *new, int new + if (oldlen <= newlen) strcpy(new, old); + else return ERR; + +- for (var_num = 0, ptr_substr = new, ptr_var = strchr(ptr_substr, '$'); ptr_var; var_num++) { ++ for (ptr_substr = new, ptr_var = strchr(ptr_substr, '$'); ptr_var;) { + rem_len = newlen - (ptr_var - new); + + /* tokenizing: valid charset: a-z, A-Z, 0-9, _ */ +@@ -2422,8 +2422,8 @@ void compose_timestamp(char *buf, int buflen, struct t if (buflen < VERYSHORTBUFLEN) return; if (since_epoch) { - if (usec) snprintf(buf, buflen, "%ld.%.6ld", tv->tv_sec, (long)tv->tv_usec); - else snprintf(buf, buflen, "%ld", tv->tv_sec); + if (usec) snprintf(buf, buflen, "%ld.%.6ld", (long)tv->tv_sec, (long)tv->tv_usec); + else snprintf(buf, buflen, "%ld", (long)tv->tv_sec); } else { time1 = tv->tv_sec; diff --git a/net-mgmt/pmacct/pkg-plist b/net-mgmt/pmacct/pkg-plist index a64a1b764aeb..75af7936a429 100644 --- a/net-mgmt/pmacct/pkg-plist +++ b/net-mgmt/pmacct/pkg-plist @@ -1,163 +1,161 @@ bin/pmacct lib/pmacct/examples/lg/pmbgp sbin/nfacctd sbin/pmacctd sbin/pmbgpd sbin/pmbmpd sbin/pmtelemetryd sbin/sfacctd %%PORTDOCS%%%%DOCSDIR%%/AUTHORS %%PORTDOCS%%%%DOCSDIR%%/BGP_BMP_METRICS.md %%PORTDOCS%%%%DOCSDIR%%/CONFIG-KEYS %%PORTDOCS%%%%DOCSDIR%%/COPYING %%PORTDOCS%%%%DOCSDIR%%/ChangeLog %%PORTDOCS%%%%DOCSDIR%%/DOCKER.md %%PORTDOCS%%%%DOCSDIR%%/FAQS %%PORTDOCS%%%%DOCSDIR%%/FLOW_AUGMENTATION_PROCESS_DESCRIPTION.md %%PORTDOCS%%%%DOCSDIR%%/INSTALL %%PORTDOCS%%%%DOCSDIR%%/INTERNALS %%PORTDOCS%%%%DOCSDIR%%/IPFIX %%PORTDOCS%%%%DOCSDIR%%/LOOKING_GLASS_FORMAT %%PORTDOCS%%%%DOCSDIR%%/MSGLOG_DUMP_FORMATS %%PORTDOCS%%%%DOCSDIR%%/PLUGINS %%PORTDOCS%%%%DOCSDIR%%/QUICKSTART %%PORTDOCS%%%%DOCSDIR%%/SIGNALS %%PORTDOCS%%%%DOCSDIR%%/TRIGGER_VARS %%PORTDOCS%%%%DOCSDIR%%/UPGRADE %%PORTEXAMPLES%%%%EXAMPLESDIR%%/allow.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/amqp_receiver.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/avro/avro_file_decoder.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp_agent.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp_md5.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp_xconnects.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/.deps/libcustom_la-libcustom.Plo %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/.libs/libcustom.a %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/.libs/libcustom_la-libcustom.o %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/Makefile %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/Makefile.am %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/Makefile.in %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/libcustom.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/libcustom.h %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/libcustom_la-libcustom.lo %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/libcustom_la-libcustom.o %%PORTEXAMPLES%%%%EXAMPLESDIR%%/custom/nfacctd-custom.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/flow_to_rd.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/kafka/kafka_consumer.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/.deps/pmbgp-pmbgp.Po %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/Makefile %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/Makefile.am %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/Makefile.in %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/pmbgp %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/pmbgp-pmbgp.o %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/pmbgp.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/pmbgp.h %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lg/pmbgp.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/lpref.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/med.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/misc/gnuplot-example.sh %%PORTEXAMPLES%%%%EXAMPLESDIR%%/misc/gnuplot.script.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/misc/mrtg-example.sh %%PORTEXAMPLES%%%%EXAMPLESDIR%%/misc/mrtg.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/misc/rrdtool-example.sh %%PORTEXAMPLES%%%%EXAMPLESDIR%%/networks.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/nfacctd-print.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/nfacctd-sql.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pcap_interfaces.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/peers.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pmacctd-imt.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pmacctd-multiple-plugins.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pmacctd-sql.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pmacctd-sqlite3.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ports.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pretag.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/primitives.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/probe_netflow.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/probe_sflow.conf.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sampling.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/systemd/systemd_service_file.md %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tee_receivers.lst.example %%DATADIR%%/CONFIG-KEYS %%DATADIR%%/FAQS %%DATADIR%%/QUICKSTART -%%SQLDOC%%%%DATADIR%%/README.64bit %%SQLDOC%%%%DATADIR%%/README.GeoIP -%%SQLDOC%%%%DATADIR%%/README.IPv6 %%SQLDOC%%%%DATADIR%%/README.cos %%SQLDOC%%%%DATADIR%%/README.custom_primitives %%SQLDOC%%%%DATADIR%%/README.etype %%SQLDOC%%%%DATADIR%%/README.export_proto %%SQLDOC%%%%DATADIR%%/README.iface %%SQLDOC%%%%DATADIR%%/README.label %%SQLDOC%%%%DATADIR%%/README.mask %%SQLDOC%%%%DATADIR%%/README.mpls %%SQLDOC%%%%DATADIR%%/README.mysql %%SQLDOC%%%%DATADIR%%/README.nat %%SQLDOC%%%%DATADIR%%/README.pgsql %%SQLDOC%%%%DATADIR%%/README.sampling %%SQLDOC%%%%DATADIR%%/README.sqlite3 %%SQLDOC%%%%DATADIR%%/README.tag2 %%SQLDOC%%%%DATADIR%%/README.timestamp %%SQLDOC%%%%DATADIR%%/README.tunnel %%DATADIR%%/UPGRADE %%DATADIR%%/docs/IPFIX %%DATADIR%%/docs/LOOKING_GLASS_FORMAT %%DATADIR%%/docs/MSGLOG_DUMP_FORMATS %%DATADIR%%/docs/SIGNALS %%DATADIR%%/docs/TRIGGER_VARS %%DATADIR%%/examples/allow.lst.example %%DATADIR%%/examples/amqp/amqp_receiver.py %%DATADIR%%/examples/avro/avro_file_decoder.py %%DATADIR%%/examples/bgp_agent.map.example %%DATADIR%%/examples/bgp_md5.lst.example %%DATADIR%%/examples/bgp_xconnects.map.example %%DATADIR%%/examples/flow_to_rd.map.example %%DATADIR%%/examples/kafka/kafka_consumer.py %%DATADIR%%/examples/lg/pmbgp.py %%DATADIR%%/examples/networks.lst.example %%DATADIR%%/examples/nfacctd-sql.conf.example %%DATADIR%%/examples/pcap_interfaces.map.example %%DATADIR%%/examples/peers.map.example %%DATADIR%%/examples/pmacctd-imt.conf.example %%DATADIR%%/examples/pmacctd-multiple-plugins.conf.example %%DATADIR%%/examples/pmacctd-sql.conf.example %%DATADIR%%/examples/pmacctd-sqlite3.conf.example %%DATADIR%%/examples/ports.lst.example %%DATADIR%%/examples/pretag.map.example %%DATADIR%%/examples/primitives.lst.example %%DATADIR%%/examples/probe_netflow.conf.example %%DATADIR%%/examples/probe_sflow.conf.example %%DATADIR%%/examples/sampling.map.example %%DATADIR%%/examples/tee_receivers.lst.example %%SQLDOC%%%%DATADIR%%/pmacct-create-db.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_bgp_v1.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v1.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v2.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v3.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v4.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v5.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v6.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v7.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v8.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-db_v9.mysql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_bgp_v1.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_bgp_v1.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v1.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v1.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v2.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v2.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v3.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v3.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v4.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v4.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v5.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v5.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v6.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v6.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v7_v8.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v7.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v8.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v9.pgsql %%SQLDOC%%%%DATADIR%%/pmacct-create-table_v9.sqlite3 %%SQLDOC%%%%DATADIR%%/pmacct-grant-db.mysql @dir lib/pmacct/examples/custom %%PORTEXAMPLES%%@dir %%EXAMPLESDIR%%/lg/.libs