Index: head/net-mgmt/pmacct/Makefile =================================================================== --- head/net-mgmt/pmacct/Makefile (revision 544222) +++ head/net-mgmt/pmacct/Makefile (revision 544223) @@ -1,175 +1,96 @@ # Created by: Kirill Ponomarew # $FreeBSD$ PORTNAME= pmacct -DISTVERSION= 1.7.4p1 +DISTVERSION= 1.7.5 CATEGORIES= net-mgmt MASTER_SITES= http://www.pmacct.net/ MAINTAINER= pi@FreeBSD.org COMMENT= Accounting and aggregation tool for IPv4 and IPv6 traffic LICENSE= GPLv2 -USES= libtool +USES= libtool pkgconfig localbase USE_RC_SUBR= pmacctd nfacctd sfacctd SUB_FILES= pkg-message GNU_CONFIGURE= yes -CPPFLAGS+= "-I${LOCALBASE}/include" -LDFLAGS+= "-L${LOCALBASE}/lib" -WRKSRC= ${WRKDIR}/pmacct-1.7.4 +OPTIONS_DEFINE= MYSQL PGSQL SQLITE3 LAYER2 DEBUG GEOIP2 \ + DOCS PLABEL RABBITMQ REDIS KAFKA AVRO EXAMPLES +OPTIONS_DEFAULT=LAYER2 +OPTIONS_SUB= 1 -OPTIONS_DEFINE= MYSQL PGSQL SQLITE3 THREADS LAYER2 IPV6 DEBUG GEOIP2 \ - DOCS PLABEL RABBITMQ KAFKA JANSSON AVRO EXAMPLES -OPTIONS_DEFAULT=MMAP LAYER2 THREADS SHARED - AVRO_DESC= Enable avro support GEOIP2_DESC= Enable GeoIPv2 (libmaxminddb) support -JANSSON_DESC= Enable Jansson support KAFKA_DESC= Enable Kafka support LAYER2_DESC= Enable Layer-2 support: MAC addresses and VLANs -# Requires libnetfilter_log port/package -# NFLOG_DESC= Enable NFLOG support -# Requires legacy mongo-c-driver version 0.8 which is not available -# MONGO_DESC= Enable MongoDB support PLABEL_DESC= Enable IP prefix labels RABBITMQ_DESC= Enable RabbitMQ/AMQP support +REDIS_DESC= Enable Redis support SQLITE3_DESC= Enable SQLite3 support -.include +SQLDOC= "@comment " -.if ${PORT_OPTIONS:MMYSQL} -USES+= mysql -CONFIGURE_ARGS+=--enable-mysql -PLIST_SUB+= WITH_MYSQL="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-mysql -PLIST_SUB+= WITH_MYSQL="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +MYSQL_USES= mysql +MYSQL_CONFIGURE_ENABLE= mysql +MYSQL_VARS+= SQLDOC="" -.if ${PORT_OPTIONS:MPGSQL} -USES+= pgsql -WANT_PGSQL= client -CONFIGURE_ARGS+=--enable-pgsql -PLIST_SUB+= WITH_PGSQL="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-pgsql -PLIST_SUB+= WITH_PGSQL="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +PGSQL_USES= pgsql +PGSQL_CONFIGURE_ENABLE= pgsql +PGSQL_VARS+= WANT_PGSQL=client +PGSQL_VARS+= SQLDOC="" -.if ${PORT_OPTIONS:MSQLITE3} -USES+= pkgconfig sqlite -CONFIGURE_ARGS+=--enable-sqlite3 \ - --with-sqlite3-includes=${LOCALBASE}/include -PLIST_SUB+= WITH_SQLITE3="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-sqlite3 -PLIST_SUB+= WITH_SQLITE3="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +SQLITE3_USES= sqlite +SQLITE3_CONFIGURE_ENABLE= sqlite3 +SQLITE3_VARS= SQLDOC="" -.if ${PORT_OPTIONS:MLAYER2} -CONFIGURE_ARGS+=--enable-l2 -.else -CONFIGURE_ARGS+=--disable-l2 -.endif +LAYER2_CONFIGURE_ENABLE= l2 +PLABEL_CONFIGURE_ENABLE= plabel +DEBUG_CONFIGURE_ENABLE= debug -.if ${PORT_OPTIONS:MIPV6} -CONFIGURE_ARGS+=--enable-ipv6 -.else -CONFIGURE_ARGS+=--disable-ipv6 -.endif +RABBITMQ_VARS= LIB_DEPENDS+=librabbitmq.so:net/rabbitmq-c-devel +RABBITMQ_CONFIGURE_ENABLE= rabbitmq -.if ${PORT_OPTIONS:MPLABEL} -CONFIGURE_ARGS+=--enable-plabel -.else -CONFIGURE_ARGS+=--disable-plabel -.endif +REDIS_VARS= LIB_DEPENDS+=libhiredis.so:databases/hiredis +REDIS_CONFIGURE_ENABLE= redis -.if ${PORT_OPTIONS:MTHREADS} -CONFIGURE_ARGS+=--enable-threads -.else -CONFIGURE_ARGS+=--disable-threads -.endif +KAFKA_VARS= LIB_DEPENDS+=librdkafka.so:net/librdkafka +KAFKA_CONFIGURE_ENABLE== kafka -.if ${PORT_OPTIONS:MDEBUG} -CONFIGURE_ARGS+=--enable-debug -.endif +AVRO_VARS= LIB_DEPENDS+=libavro.so:devel/avro-c +AVRO_CONFIGURE_ENABLE= avro -.if ${PORT_OPTIONS:MMONGO} -#CONFIGURE_ARGS+=--enable-mongodb -.else -CONFIGURE_ARGS+=--disable-mongodb -.endif +GEOIP2_VARS= LIB_DEPENDS+=libmaxminddb.so:net/libmaxminddb +GEOIP2_CONFIGURE_ENABLE= geoipv2 -.if ${PORT_OPTIONS:MRABBITMQ} -.if ${PORT_OPTIONS:MJANSSON} -USES+= pkgconfig -LIB_DEPENDS+= libjansson.so:devel/jansson -CONFIGURE_ARGS+=--enable-jansson -.else -IGNORE= RabbitMQ support requires enabled Jansson support -.endif -LIB_DEPENDS+= librabbitmq.so:net/rabbitmq-c-devel -CONFIGURE_ARGS+=--enable-rabbitmq -.endif +.include -.if ${PORT_OPTIONS:MKAFKA} -.if ${PORT_OPTIONS:MJANSSON} -USES+= pkgconfig +PLIST_SUB+= SQLDOC=${SQLDOC} +PLIST_SUB+= WITH_KAFKA=${KAFKA} + +.if ${PORT_OPTIONS:MRABBITMQ} || ${PORT_OPTIONS:MKAFKA} LIB_DEPENDS+= libjansson.so:devel/jansson CONFIGURE_ARGS+=--enable-jansson -.else -IGNORE= Kafaka support requires enabled Jansson support -.endif -LIB_DEPENDS+= librdkafka.so:net/librdkafka -CONFIGURE_ARGS+=--enable-kafka -PLIST_SUB+=WITH_KAFKA="" -.else -PLIST_SUB+=WITH_KAFKA="@comment " -.endif - -.if ${PORT_OPTIONS:MAVRO} -LIB_DEPENDS+= libavro.so:devel/avro-c -CONFIGURE_ARGS+=--enable-avro -.endif - -.if ${PORT_OPTIONS:MNFLOG} -#CONFIGURE_ARGS+=--enable-nflog -#PLIST_SUB+=WITH_NFLOG="" -.else -CONFIGURE_ARGS+=--disable-nflog -PLIST_SUB+=WITH_NFLOG="@comment " -.endif - -.if ${PORT_OPTIONS:MGEOIP2} -LIB_DEPENDS+= libmaxminddb.so:net/libmaxminddb -CONFIGURE_ARGS+=--enable-geoipv2 .endif .include .if ${ARCH} == "amd64" || ${ARCH} == "sparc64" CONFIGURE_ARGS+=--enable-64bit .endif post-patch: @${REINPLACE_CMD} -e 's|-O2||g' ${WRKSRC}/configure 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 Index: head/net-mgmt/pmacct/distinfo =================================================================== --- head/net-mgmt/pmacct/distinfo (revision 544222) +++ head/net-mgmt/pmacct/distinfo (revision 544223) @@ -1,3 +1,3 @@ -TIMESTAMP = 1582385432 -SHA256 (pmacct-1.7.4p1.tar.gz) = 8a35fdde01a2e34faf7c0d68cb3010bca56667638a6227b02384d015ee9c1335 -SIZE (pmacct-1.7.4p1.tar.gz) = 1581347 +TIMESTAMP = 1596635446 +SHA256 (pmacct-1.7.5.tar.gz) = 2e778bd3cdd968c4b9f22e28008b9b72f229980201d2cc2ee04cb02f6b0bdcd5 +SIZE (pmacct-1.7.5.tar.gz) = 1626770 Index: head/net-mgmt/pmacct/files/patch-Makefile.am =================================================================== --- head/net-mgmt/pmacct/files/patch-Makefile.am (revision 544222) +++ head/net-mgmt/pmacct/files/patch-Makefile.am (revision 544223) @@ -1,11 +1,11 @@ ---- Makefile.am.orig 2019-04-19 04:06:27.000000000 +0200 -+++ Makefile.am 2019-06-16 19:58:43.298406000 +0200 -@@ -17,7 +17,7 @@ - pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg +--- Makefile.am.orig 2019-12-07 17:48:46 UTC ++++ Makefile.am +@@ -22,7 +22,7 @@ pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_d + endif pmacct_examples_custom_dir = $(pmacct_examples_arch_dir)/custom if USING_SQL -pmacct_sql_dir = $(pmacct_data_dir)/sql +pmacct_sql_dir = $(pmacct_data_dir) endif pmacct_data__DATA = CONFIG-KEYS FAQS QUICKSTART UPGRADE Index: head/net-mgmt/pmacct/files/patch-Makefile.in =================================================================== --- head/net-mgmt/pmacct/files/patch-Makefile.in (revision 544222) +++ head/net-mgmt/pmacct/files/patch-Makefile.in (revision 544223) @@ -1,11 +1,11 @@ ---- Makefile.in.orig 2019-06-16 20:01:08.854403000 +0200 -+++ Makefile.in 2019-06-16 20:01:32.038160000 +0200 -@@ -346,7 +346,7 @@ - pmacct_examples_lg_dir = $(pmacct_examples_dir)/lg - pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg +--- Makefile.in.orig 2020-06-17 22:02:42 UTC ++++ Makefile.in +@@ -417,7 +417,7 @@ pmacct_examples_avro_dir = $(pmacct_examples_dir)/avro + @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 Index: head/net-mgmt/pmacct/files/patch-src_kafka__plugin.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_kafka__plugin.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_kafka__plugin.c (revision 544223) @@ -0,0 +1,11 @@ +--- src/kafka_plugin.c.orig 2020-05-10 13:57:54 UTC ++++ src/kafka_plugin.c +@@ -875,7 +875,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); Property changes on: head/net-mgmt/pmacct/files/patch-src_kafka__plugin.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c (revision 544223) @@ -0,0 +1,11 @@ +--- src/pgsql_plugin.c.orig 2019-12-07 17:48:46 UTC ++++ src/pgsql_plugin.c +@@ -611,7 +611,7 @@ void PG_cache_purge(struct db_cache *queue[], int inde + if (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) { Property changes on: head/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_pmacct.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_pmacct.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_pmacct.c (revision 544223) @@ -0,0 +1,22 @@ +--- src/pmacct.c.orig 2020-05-10 13:57:54 UTC ++++ src/pmacct.c +@@ -2898,7 +2898,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 " %zu\n", acc_elem->pkt_num, acc_elem->pkt_len, acc_elem->flo_num, acc_elem->time_start.tv_sec); + /* print flows */ + else if (which_counter == 3) printf("%" PRIu64 "\n", acc_elem->flo_num); + } +@@ -3725,8 +3725,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; Property changes on: head/net-mgmt/pmacct/files/patch-src_pmacct.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_sql__common.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_sql__common.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_sql__common.c (revision 544223) @@ -0,0 +1,13 @@ +--- src/sql_common.c.orig 2020-05-10 13:57:54 UTC ++++ src/sql_common.c +@@ -126,8 +126,8 @@ void sql_init_global_buffers() + lru_tail = &lru_head; + + Log(LOG_INFO, "INFO ( %s/%s ): cache entries=%d base cache memory=%luu bytes\n", config.name, config.type, +- config.sql_cache_entries, ((config.sql_cache_entries * sizeof(struct db_cache)) + +- (2 * (qq_size * sizeof(struct db_cache *))))); ++ config.sql_cache_entries, (unsigned long) ((config.sql_cache_entries * sizeof(struct db_cache)) + ++ (2 * (qq_size * sizeof(struct db_cache *)))) ); + + pipebuf = (unsigned char *) malloc(config.buffer_size); + sql_cache = (struct db_cache *) malloc(config.sql_cache_entries*sizeof(struct db_cache)); Property changes on: head/net-mgmt/pmacct/files/patch-src_sql__common.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_sql__common.h =================================================================== --- head/net-mgmt/pmacct/files/patch-src_sql__common.h (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_sql__common.h (revision 544223) @@ -0,0 +1,11 @@ +--- src/sql_common.h.orig 2020-02-22 20:28:47 UTC ++++ src/sql_common.h +@@ -64,7 +64,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)) + Property changes on: head/net-mgmt/pmacct/files/patch-src_sql__common.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +ON \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c (revision 544223) @@ -0,0 +1,11 @@ +--- src/sqlite3_plugin.c.orig 2020-05-10 13:57:54 UTC ++++ src/sqlite3_plugin.c +@@ -537,7 +537,7 @@ void SQLI_cache_purge(struct db_cache *queue[], int in + if (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) { Property changes on: head/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/pmacct/files/patch-src_util.c =================================================================== --- head/net-mgmt/pmacct/files/patch-src_util.c (nonexistent) +++ head/net-mgmt/pmacct/files/patch-src_util.c (revision 544223) @@ -0,0 +1,22 @@ +--- src/util.c.orig 2020-05-10 13:57:54 UTC ++++ src/util.c +@@ -1594,7 +1594,7 @@ void *pm_malloc(size_t size) + + obj = (unsigned char *) malloc(size); + if (!obj) { +- Log(LOG_ERR, "ERROR ( %s/%s ): Unable to grab enough memory (requested: %lu bytes). Exiting ...\n", ++ Log(LOG_ERR, "ERROR ( %s/%s ): Unable to grab enough memory (requested: %zu bytes). Exiting ...\n", + config.name, config.type, size); + exit_gracefully(1); + } +@@ -2010,8 +2010,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; Property changes on: head/net-mgmt/pmacct/files/patch-src_util.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property