diff --git a/apps/edge.c b/apps/edge.c index 05af2919..9b38982a 100644 --- a/apps/edge.c +++ b/apps/edge.c @@ -1,6 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -21,6 +22,7 @@ #include // for isspace #include // for errno #include // for required_argument, no_argument +#include // for traceEvent #include // for signal, SIG_IGN, SIGPIPE, SIGCHLD #include #include // for uint8_t, uint16_t diff --git a/apps/supernode.c b/apps/supernode.c index d9ba353b..3788c042 100644 --- a/apps/supernode.c +++ b/apps/supernode.c @@ -1,6 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -21,6 +22,7 @@ #include // for isspace #include // for errno #include // for required_argument, getopt_long, no_arg... +#include // for traceEvent #include // for signal, SIGHUP, SIGINT, SIGPIPE, SIGTERM #include #include // for uint8_t, uint32_t @@ -30,7 +32,7 @@ #include // for time_t, u_char, u_int #include // for time #include // for _exit, daemon, getgid, getuid, setgid -#include "n2n.h" // for n2n_sn_t, sn_community, traceEvent +#include "n2n.h" // for n2n_sn_t, sn_community #include "pearson.h" // for pearson_hash_64 #include "uthash.h" // for UT_hash_handle, HASH_ITER, HASH_ADD_STR diff --git a/include/n2n.h b/include/n2n.h index 36da4271..77c79e0a 100644 --- a/include/n2n.h +++ b/include/n2n.h @@ -94,16 +94,6 @@ -/* ************************************** */ - -#ifndef TRACE_ERROR -#define TRACE_ERROR 0 -#define TRACE_WARNING 1 -#define TRACE_NORMAL 2 -#define TRACE_INFO 3 -#define TRACE_DEBUG 4 -#endif - /* ************************************** */ /* Transop Init Functions */ @@ -117,15 +107,6 @@ int n2n_transop_lzo_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); int n2n_transop_zstd_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); #endif -/* Log */ -void setTraceLevel (int level); -void setUseSyslog (int use_syslog); -void setTraceFile (FILE *f); -int getTraceLevel (); -void closeTraceFile (); -void _traceEvent (int eventTraceLevel, char* file, int line, char * format, ...); -#define traceEvent(level, format, ...) _traceEvent(level, __FILE__, __LINE__, format, ## __VA_ARGS__) - /* Tuntap API */ int tuntap_open (struct tuntap_dev *device, char *dev, const char *address_mode, char *device_ip, char *device_mask, const char * device_mac, int mtu, int metric); diff --git a/include/n3n/logging.h b/include/n3n/logging.h new file mode 100644 index 00000000..518430e8 --- /dev/null +++ b/include/n3n/logging.h @@ -0,0 +1,28 @@ +/** + * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only + * + * Public API for logging + */ + +#ifndef _N2N_LOGGING_H_ +#define _N2N_LOGGING_H_ + +#include // for FILE + +#define TRACE_ERROR 0 +#define TRACE_WARNING 1 +#define TRACE_NORMAL 2 +#define TRACE_INFO 3 +#define TRACE_DEBUG 4 + +void setTraceLevel (int level); +void setUseSyslog (int use_syslog); +void setTraceFile (FILE *f); +int getTraceLevel (); +void closeTraceFile (); +void _traceEvent (int eventTraceLevel, char* file, int line, char * format, ...); +#define traceEvent(level, format, ...) _traceEvent(level, __FILE__, __LINE__, format, ## __VA_ARGS__) + +#endif diff --git a/src/aes.c b/src/aes.c index 6cc0c740..e1ab8363 100644 --- a/src/aes.c +++ b/src/aes.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -18,11 +20,11 @@ #include "config.h" +#include // for traceEvent #include // for uint32_t, uint8_t #include // for calloc, free #include // for memcpy, size_t #include "aes.h" // for AES_BLOCK_SIZE, aes_context_t, AES128_KEY_BYTES -#include "n2n.h" // for TRACE_ERROR, traceEvent #include "portable_endian.h" // for be32toh, htobe32 diff --git a/src/auth.c b/src/auth.c index 3efddf42..f005de05 100644 --- a/src/auth.c +++ b/src/auth.c @@ -1,5 +1,7 @@ /* * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -18,6 +20,7 @@ #include "auth.h" +#include // for traceEvent #include // for calloc, free #include // for strlen, size_t #include "curve25519.h" // for curve25519 diff --git a/src/cc20.c b/src/cc20.c index 739812c6..0bde7b76 100644 --- a/src/cc20.c +++ b/src/cc20.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,11 +19,11 @@ */ +#include // for traceEvent #include // for calloc, free, size_t #include // for memcpy #include "cc20.h" #include "config.h" // HAVE_LIBCRYPTO -#include "n2n.h" // for TRACE_ERROR, traceEvent #include "portable_endian.h" // for htole32 diff --git a/src/edge_management.c b/src/edge_management.c index 341a71b7..c2012ba9 100644 --- a/src/edge_management.c +++ b/src/edge_management.c @@ -18,11 +18,12 @@ * */ -#include "n2n.h" // for n2n_edge_t, peer_info, getTraceLevel, N2N_... +#include "n2n.h" // for n2n_edge_t, N2N_... // FIXME: if this headers is sorted alphabetically, the test_integration_edge // fails with what looks like a struct rearrangement involving eee->stats #include // for errno +#include // for traceEvent #include #include // for uint32_t #include // for snprintf, size_t, NULL @@ -32,7 +33,7 @@ #include "config.h" // for PACKAGE_VERSION #include "management.h" // for mgmt_req_t, send_reply, send_json_1str #include "n2n_define.h" // for N2N_PKT_BUF_SIZE, N2N_EVENT_DEBUG, N2N_EVE... -#include "n2n_typedefs.h" // for n2n_edge_t, peer_info, n2n_edge_conf_t +#include "n2n_typedefs.h" // for n2n_edge_t, n2n_edge_conf_t #include "peer_info.h" // for peer_info, peer_info_t #include "sn_selection.h" // for sn_selection_criterion_str, selection_crit... #include "strbuf.h" // for strbuf_t, STRBUF_INIT diff --git a/src/edge_utils.c b/src/edge_utils.c index 7a46e238..6fb86931 100644 --- a/src/edge_utils.c +++ b/src/edge_utils.c @@ -1,6 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -20,6 +21,7 @@ #include // for errno, EAFNOSUPPORT, EINPROGRESS #include // for fcntl, F_SETFL, O_NONBLOCK +#include // for traceEvent #include #include // for uint8_t, uint16_t, uint32_t, uin... #include // for snprintf, sprintf @@ -32,7 +34,7 @@ #include "auth.h" // for generate_private_key #include "portable_endian.h" // for be16toh, htobe16 #include "header_encryption.h" // for packet_header_encrypt, packet_he... -#include "n2n.h" // for n2n_edge_t, peer_info, n2n_edge_... +#include "n2n.h" // for n2n_edge_t, n2n_edge_... #include "n2n_wire.h" // for encode_mac, fill_sockaddr, decod... #include "network_traffic_filter.h" // for create_network_traffic_filter #include "pearson.h" // for pearson_hash_128, pearson_hash_64 diff --git a/src/header_encryption.c b/src/header_encryption.c index 0cf2e020..52219f0c 100644 --- a/src/header_encryption.c +++ b/src/header_encryption.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,11 +19,12 @@ */ +#include // for traceEvent #include // for uint32_t, uint8_t, uint64_t, uint16_t #include // for calloc #include // for memcpy #include "header_encryption.h" // for packet_header_change_dynamic_key, pac... -#include "n2n.h" // for he_context_t, N2N_COMMUNITY_SIZE, TRA... +#include "n2n.h" // for he_context_t, N2N_COMMUNITY_SIZE... #include "n2n_define.h" // for N2N_COMMUNITY_SIZE #include "n2n_typedefs.h" // for he_context_t, N2N_AUTH_CHALLENGE_SIZE #include "pearson.h" // for pearson_hash_128, pearson_hash_64 diff --git a/src/management.c b/src/management.c index 725c5beb..269fccc9 100644 --- a/src/management.c +++ b/src/management.c @@ -7,13 +7,13 @@ */ +#include // for traceEvent #include // for pearson_hash_64 #include #include // for snprintf, NULL, size_t #include // for strtoul #include // for strtok, strlen, strncpy #include "management.h" -#include "n2n.h" // for TRACE_DEBUG, traceEvent #ifdef _WIN32 #include "win32/defs.h" diff --git a/src/n2n.c b/src/n2n.c index 57e89d87..911a10f4 100644 --- a/src/n2n.c +++ b/src/n2n.c @@ -1,6 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -19,6 +20,7 @@ #include // for errno +#include // for traceEvent #include // for va_end, va_list, va_start #include #include // for free, atoi, calloc, strtol @@ -615,8 +617,8 @@ void print_n2n_version () { printf("Welcome to n3n v.%s\n" "Built on %s\n" - "Copyright (C) 2023 Hamish Coleman\n", - "Copyright 2007-2022 - ntop.org and contributors\n\n", + "Copyright 2007-2022 - ntop.org and contributors\n" + "Copyright (C) 2023 Hamish Coleman\n\n", PACKAGE_VERSION, PACKAGE_BUILDDATE); } diff --git a/src/network_traffic_filter.c b/src/network_traffic_filter.c index 736f236a..d16bbeb2 100644 --- a/src/network_traffic_filter.c +++ b/src/network_traffic_filter.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,6 +19,7 @@ */ +#include // for traceEvent #include // for uint8_t, uint16_t, uint32_t #include // for sprintf #include // for free, malloc, atoi diff --git a/src/peer_info.c b/src/peer_info.c index a60e69a1..fa2c1e89 100644 --- a/src/peer_info.c +++ b/src/peer_info.c @@ -1,11 +1,13 @@ /** * (C) 2007-23 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * */ #include // for time_stamp #include // for TIME_STAMP_FRAME +#include // for traceEvent #include #include "peer_info.h" diff --git a/src/random_numbers.c b/src/random_numbers.c index 5e17be90..ea947e60 100644 --- a/src/random_numbers.c +++ b/src/random_numbers.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,11 +19,11 @@ */ +#include // for traceEvent #include // for errno, EAGAIN #include // for NULL, size_t #include // for clock, time #include // for syscall -#include "n2n.h" // for TRACE_ERROR, traceEvent #include "random_numbers.h" diff --git a/src/sn_management.c b/src/sn_management.c index 26d73b7c..0fac1203 100644 --- a/src/sn_management.c +++ b/src/sn_management.c @@ -25,13 +25,14 @@ #include // for errno +#include // for traceEvent #include #include // for uint8_t, uint32_t #include // for snprintf, size_t, sprintf, NULL #include // for memcmp, memcpy, strerror, strncpy #include // for ssize_t, time_t #include "management.h" // for mgmt_req_t, send_reply, mgmt_handler_t, mgmt... -#include "n2n.h" // for n2n_sn_t, sn_community, peer_info, N2N_SN_PK... +#include "n2n.h" // for n2n_sn_t, sn_community, N2N_SN_PK... #include "n2n_define.h" // for N2N_SN_PKTBUF_SIZE, UNPURGEABLE #include "n2n_typedefs.h" // for n2n_sn_t, sn_community, peer_info, sn_stats_t #include "peer_info.h" // for peer_info, peer_info_t diff --git a/src/sn_selection.c b/src/sn_selection.c index c780f4e9..13b6a36a 100644 --- a/src/sn_selection.c +++ b/src/sn_selection.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,6 +19,7 @@ */ +#include // for traceEvent #include // for UINT64_MAX, uint32_t, int64_t, uint64_t #include // for snprintf, NULL #include // for memcpy, memset diff --git a/src/sn_utils.c b/src/sn_utils.c index c1bfd704..8f3c9f0b 100644 --- a/src/sn_utils.c +++ b/src/sn_utils.c @@ -1,6 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -19,6 +20,7 @@ #include // for errno, EAFNOSUPPORT +#include // for traceEvent #include #include // for uint8_t, uint32_t, uint16_t, uint64_t #include // for sscanf, snprintf, fclose, fgets, fopen @@ -31,7 +33,7 @@ #include "auth.h" // for ascii_to_bin, calculate_dynamic_key #include "config.h" // for PACKAGE_VERSION #include "header_encryption.h" // for packet_header_encrypt, packet_header_... -#include "n2n.h" // for sn_community, n2n_sn_t, peer_info +#include "n2n.h" // for sn_community, n2n_sn_t #include "n2n_regex.h" // for re_matchp, re_compile #include "n2n_wire.h" // for encode_buf, encode_PEER_INFO, encode_... #include "pearson.h" // for pearson_hash_128, pearson_hash_32 diff --git a/src/transform_aes.c b/src/transform_aes.c index 9ba49eaf..ff3274b2 100644 --- a/src/transform_aes.c +++ b/src/transform_aes.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,12 +19,13 @@ */ +#include // for traceEvent #include // for uint8_t #include // for calloc, free #include // for memcpy, size_t, memset, memcmp, strlen #include // for u_char, ssize_t, time_t #include "aes.h" // for AES_BLOCK_SIZE, aes_cbc_decrypt, aes_cbc... -#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR +#include "n2n.h" // for n2n_trans_op_t #include "n2n_wire.h" // for encode_uint64, encode_buf #include "pearson.h" // for pearson_hash_256 #include "random_numbers.h" // for n2n_rand diff --git a/src/transform_cc20.c b/src/transform_cc20.c index 6cc8c8ec..588c0479 100644 --- a/src/transform_cc20.c +++ b/src/transform_cc20.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,12 +19,13 @@ */ +#include // for traceEvent #include // for uint8_t #include // for size_t, calloc, free #include // for memset, strlen #include // for u_char, ssize_t, time_t #include "cc20.h" // for CC20_IV_SIZE, cc20_crypt, cc20_deinit -#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR +#include "n2n.h" // for n2n_trans_op_t #include "n2n_wire.h" // for encode_uint64 #include "pearson.h" // for pearson_hash_256 #include "random_numbers.h" // for n2n_rand diff --git a/src/transform_lzo.c b/src/transform_lzo.c index f588174c..a51cc361 100644 --- a/src/transform_lzo.c +++ b/src/transform_lzo.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,12 +19,13 @@ */ +#include // for traceEvent #include // for uint8_t #include // for size_t, calloc, free, NULL #include // for memset #include // for time_t #include "minilzo.h" // for lzo1x_1_compress, lzo1x_decompress, LZO1X_1_M... -#include "n2n.h" // for n2n_trans_op_t, TRACE_ERROR, traceEvent, N2N_... +#include "n2n.h" // for n2n_trans_op_t, N2N_... /* heap allocation for compression as per lzo example doc */ diff --git a/src/transform_null.c b/src/transform_null.c index 50e06a8d..4e422838 100644 --- a/src/transform_null.c +++ b/src/transform_null.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,10 +19,11 @@ */ +#include // for traceEvent #include // for uint8_t #include // for memcpy, size_t, memset #include // for time_t -#include "n2n.h" // for n2n_trans_op_t, TRACE_DEBUG, traceEvent, N2N_... +#include "n2n.h" // for n2n_trans_op_t, N2N_... static int transop_deinit_null (n2n_trans_op_t *arg ) { diff --git a/src/transform_speck.c b/src/transform_speck.c index 2270958c..5ca082a7 100644 --- a/src/transform_speck.c +++ b/src/transform_speck.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,11 +19,12 @@ */ +#include // for traceEvent #include // for uint8_t #include // for size_t, calloc, free #include // for memset, strlen #include // for u_char, ssize_t, time_t -#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_DEBUG +#include "n2n.h" // for n2n_trans_op_t #include "n2n_wire.h" // for encode_uint64 #include "pearson.h" // for pearson_hash_256 #include "random_numbers.h" // for n2n_rand diff --git a/src/transform_tf.c b/src/transform_tf.c index bae9d4e1..a99d2b70 100644 --- a/src/transform_tf.c +++ b/src/transform_tf.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,11 +19,12 @@ */ +#include // for traceEvent #include // for uint8_t #include // for calloc, free #include // for memcpy, size_t, memset, memcmp, strlen #include // for u_char, ssize_t, time_t -#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR +#include "n2n.h" // for n2n_trans_op_t #include "n2n_wire.h" // for encode_uint64, encode_buf #include "pearson.h" // for pearson_hash_256 #include "random_numbers.h" // for n2n_rand diff --git a/src/tuntap_linux.c b/src/tuntap_linux.c index 9b6d1db3..434166a9 100644 --- a/src/tuntap_linux.c +++ b/src/tuntap_linux.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -27,6 +29,7 @@ #include // for IFF_NO_PI, IFF_TAP, TUNSETIFF #include // for sockaddr_nl, nlmsghdr, NETLINK_... #include // for ifinfomsg, RTMGRP_LINK +#include // for traceEvent #include // for ifreq, IFNAMSIZ, ifr_name, ifr_... #include // for ARPHRD_ETHER #include // for sockaddr_in, IPPROTO_IP, in_addr @@ -36,7 +39,7 @@ #include // for MIN #include // for socket, msghdr, AF_INET, sockaddr #include // for close, getpid, read, write, ssi... -#include "n2n.h" // for tuntap_dev, traceEvent, TRACE_E... +#include "n2n.h" // for tuntap_dev, ... static int setup_ifname (int fd, const char *ifname, const char *ipaddr, diff --git a/tools/n3n-benchmark.c b/tools/n3n-benchmark.c index 8546b562..f1cb231e 100644 --- a/tools/n3n-benchmark.c +++ b/tools/n3n-benchmark.c @@ -1,5 +1,7 @@ /* * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -17,6 +19,7 @@ */ +#include // for traceEvent #include // for uint8_t, uint64_t #include // for printf, fflush, size_t, NULL, stdout #include // for memset, memcpy, memcmp, strncpy diff --git a/tools/n3n-decode.c b/tools/n3n-decode.c index 1eaad8e9..71ebe987 100644 --- a/tools/n3n-decode.c +++ b/tools/n3n-decode.c @@ -1,5 +1,7 @@ /** * (C) 2019-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -21,6 +23,7 @@ #ifdef HAVE_LIBPCAP #include // for errno +#include // for traceEvent #include #include // for signal, SIGINT, SIGTERM #include "n2n.h" diff --git a/tools/n3n-portfwd.c b/tools/n3n-portfwd.c index a5d51dab..234e50ef 100644 --- a/tools/n3n-portfwd.c +++ b/tools/n3n-portfwd.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -18,7 +20,7 @@ #include // for getopt_long -#include // for optarg +#include // for traceEvent #include // for signal, SIGINT, SIGPIPE, SIGTERM, SIG_IGN #include #include // for uint16_t, uint32_t, uint8_t @@ -27,9 +29,9 @@ #include // for strchr, strcmp #include // for timeval #include // for time, time_t -#include // for STDIN_FILENO, _exit +#include // for STDIN_FILENO, _exit, optarg #include "json.h" // for _jsonpair, json_object_t, json_free -#include "n2n.h" // for traceEvent, setTraceLevel, getTraceLevel +#include "n2n.h" // for SOCKET, N2N_EDGE_MGMT_PORT, closesocke... #include "n2n_port_mapping.h" // for n2n_del_port_mapping, n2n_set_port_map... #include "random_numbers.h" // for n2n_rand, n2n_seed, n2n_srand diff --git a/tools/n3n-route.c b/tools/n3n-route.c index 7c916de3..344ca650 100644 --- a/tools/n3n-route.c +++ b/tools/n3n-route.c @@ -1,5 +1,7 @@ /** * (C) 2007-22 - ntop.org and contributors + * Copyright (C) 2023 Hamish Coleman + * SPDX-License-Identifier: GPL-3.0-only * * 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 @@ -19,6 +21,7 @@ #include // for errno #include // for getopt_long, optind, optarg +#include // for traceEvent #include // for signal, SIGINT, SIGPIPE, SIGTERM, SIG_IGN #include #include // for uint8_t, uint16_t, uint32_t diff --git a/tools/tests-compress.c b/tools/tests-compress.c index 2c73691a..854013c2 100644 --- a/tools/tests-compress.c +++ b/tools/tests-compress.c @@ -20,13 +20,14 @@ #include // for assert #include // for PRIx64 +#include // for traceEvent #include // for uint8_t #include // for printf, fprintf, stderr, stdout, NULL #include // for exit #include // for memcmp #include "hexdump.h" // for fhexdump #include "minilzo.h" // for lzo1x_1_compress, lzo1x_decompress, LZO1X_1_ME... -#include "n2n.h" // for N2N_PKT_BUF_SIZE, TRACE_ERROR, traceEvent +#include "n2n.h" // for N2N_PKT_BUF_SIZE /* heap allocation for compression as per lzo example doc */ diff --git a/tools/tests-transform.c b/tools/tests-transform.c index 3f8e2da2..5f32c106 100644 --- a/tools/tests-transform.c +++ b/tools/tests-transform.c @@ -20,6 +20,7 @@ #include // for PRIx64 +#include // for traceEvent #include // for uint8_t #include // for printf, fprintf, size_t, stderr, stdout #include // for exit