n2n.h (n2n-3.0) | : | n2n.h (n2n-3.1.1) | ||
---|---|---|---|---|
/** | /** | |||
* (C) 2007-21 - ntop.org and contributors | * (C) 2007-22 - ntop.org and contributors | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * 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 | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 3 of the License, or | * the Free Software Foundation; either version 3 of the License, or | |||
* (at your option) any later version. | * (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 33 | skipping to change at line 33 | |||
tunctl -t tun0 | tunctl -t tun0 | |||
tunctl -t tun1 | tunctl -t tun1 | |||
ifconfig tun0 1.2.3.4 up | ifconfig tun0 1.2.3.4 up | |||
ifconfig tun1 1.2.3.5 up | ifconfig tun1 1.2.3.5 up | |||
./edge -d tun0 -l 2000 -r 127.0.0.1:3000 -c hello | ./edge -d tun0 -l 2000 -r 127.0.0.1:3000 -c hello | |||
./edge -d tun1 -l 3000 -r 127.0.0.1:2000 -c hello | ./edge -d tun1 -l 3000 -r 127.0.0.1:2000 -c hello | |||
tunctl -u UID -t tunX | tunctl -u UID -t tunX | |||
*/ | */ | |||
#define SN_MANUAL_MAC /* allows supernode MAC address to be set manually */ | ||||
#define N2N_HAVE_DAEMON /* needs to be defined before it gets undefined */ | #define N2N_HAVE_DAEMON /* needs to be defined before it gets undefined */ | |||
#define N2N_HAVE_TCP /* needs to be defined before it gets undefined */ | #define N2N_HAVE_TCP /* needs to be defined before it gets undefined */ | |||
/* #define N2N_CAN_NAME_IFACE */ | /* #define N2N_CAN_NAME_IFACE */ | |||
/* Moved here to define _CRT_SECURE_NO_WARNINGS before all the including takes p lace */ | /* Moved here to define _CRT_SECURE_NO_WARNINGS before all the including takes p lace */ | |||
#ifdef WIN32 | #ifdef WIN32 | |||
#ifndef CMAKE_BUILD | #ifndef CMAKE_BUILD | |||
#include "config.h" /* Visual C++ */ | #include "config.h" /* Visual C++ */ | |||
#else | #else | |||
skipping to change at line 101 | skipping to change at line 103 | |||
#include <linux/rtnetlink.h> | #include <linux/rtnetlink.h> | |||
#endif /* #ifdef __linux__ */ | #endif /* #ifdef __linux__ */ | |||
#ifdef __FreeBSD__ | #ifdef __FreeBSD__ | |||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | |||
#endif /* #ifdef __FreeBSD__ */ | #endif /* #ifdef __FreeBSD__ */ | |||
#include <syslog.h> | #include <syslog.h> | |||
#include <sys/wait.h> | #include <sys/wait.h> | |||
#ifdef HAVE_LIBZSTD | #ifdef HAVE_ZSTD | |||
#include <zstd.h> | #include <zstd.h> | |||
#endif | #endif | |||
#include <netinet/in.h> | #include <netinet/in.h> | |||
#include <netinet/ip.h> | #include <netinet/ip.h> | |||
#include <netinet/udp.h> | #include <netinet/udp.h> | |||
#include <netinet/tcp.h> | #include <netinet/tcp.h> | |||
#include <arpa/inet.h> | #include <arpa/inet.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/time.h> | #include <sys/time.h> | |||
skipping to change at line 156 | skipping to change at line 158 | |||
#include "portable_endian.h" | #include "portable_endian.h" | |||
#include "aes.h" | #include "aes.h" | |||
#include "cc20.h" | #include "cc20.h" | |||
#include "speck.h" | #include "speck.h" | |||
#include "curve25519.h" | #include "curve25519.h" | |||
#include "n2n_regex.h" | #include "n2n_regex.h" | |||
#include "sn_selection.h" | #include "sn_selection.h" | |||
#include "network_traffic_filter.h" | #include "network_traffic_filter.h" | |||
#include "auth.h" | #include "auth.h" | |||
#if defined(HAVE_MINIUPNP) || defined(HAVE_NATPMP) | ||||
#include "n2n_port_mapping.h" | ||||
#endif // HAVE_MINIUPNP || HAVE_NATPMP | ||||
/* ************************************** */ | /* ************************************** */ | |||
#include "header_encryption.h" | #include "header_encryption.h" | |||
#include "tf.h" | #include "tf.h" | |||
#ifndef TRACE_ERROR | #ifndef TRACE_ERROR | |||
#define TRACE_ERROR 0, __FILE__, __LINE__ | #define TRACE_ERROR 0, __FILE__, __LINE__ | |||
#define TRACE_WARNING 1, __FILE__, __LINE__ | #define TRACE_WARNING 1, __FILE__, __LINE__ | |||
#define TRACE_NORMAL 2, __FILE__, __LINE__ | #define TRACE_NORMAL 2, __FILE__, __LINE__ | |||
#define TRACE_INFO 3, __FILE__, __LINE__ | #define TRACE_INFO 3, __FILE__, __LINE__ | |||
skipping to change at line 177 | skipping to change at line 183 | |||
#endif | #endif | |||
/* ************************************** */ | /* ************************************** */ | |||
/* Transop Init Functions */ | /* Transop Init Functions */ | |||
int n2n_transop_null_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | int n2n_transop_null_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | |||
int n2n_transop_tf_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | int n2n_transop_tf_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | |||
int n2n_transop_aes_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | int n2n_transop_aes_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | |||
int n2n_transop_cc20_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | int n2n_transop_cc20_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | |||
int n2n_transop_speck_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | int n2n_transop_speck_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | |||
int n2n_transop_lzo_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | ||||
#ifdef HAVE_ZSTD | ||||
int n2n_transop_zstd_init (const n2n_edge_conf_t *conf, n2n_trans_op_t *ttt); | ||||
#endif | ||||
/* Log */ | /* Log */ | |||
void setTraceLevel (int level); | void setTraceLevel (int level); | |||
void setUseSyslog (int use_syslog); | void setUseSyslog (int use_syslog); | |||
void setTraceFile (FILE *f); | void setTraceFile (FILE *f); | |||
int getTraceLevel (); | int getTraceLevel (); | |||
void closeTraceFile (); | void closeTraceFile (); | |||
void traceEvent (int eventTraceLevel, char* file, int line, char * format, ...); | void traceEvent (int eventTraceLevel, char* file, int line, char * format, ...); | |||
/* Tuntap API */ | /* Tuntap API */ | |||
skipping to change at line 279 | skipping to change at line 289 | |||
int sn_init_defaults (n2n_sn_t *sss); | int sn_init_defaults (n2n_sn_t *sss); | |||
void sn_init (n2n_sn_t *sss); | void sn_init (n2n_sn_t *sss); | |||
void sn_term (n2n_sn_t *sss); | void sn_term (n2n_sn_t *sss); | |||
int supernode2sock (n2n_sock_t * sn, const n2n_sn_name_t addrIn); | int supernode2sock (n2n_sock_t * sn, const n2n_sn_name_t addrIn); | |||
struct peer_info* add_sn_to_list_by_mac_or_sock (struct peer_info **sn_list, n2n _sock_t *sock, const n2n_mac_t mac, int *skip_add); | struct peer_info* add_sn_to_list_by_mac_or_sock (struct peer_info **sn_list, n2n _sock_t *sock, const n2n_mac_t mac, int *skip_add); | |||
int run_sn_loop (n2n_sn_t *sss); | int run_sn_loop (n2n_sn_t *sss); | |||
int assign_one_ip_subnet (n2n_sn_t *sss, struct sn_community *comm); | int assign_one_ip_subnet (n2n_sn_t *sss, struct sn_community *comm); | |||
const char* compression_str (uint8_t cmpr); | const char* compression_str (uint8_t cmpr); | |||
const char* transop_str (enum n2n_transform tr); | const char* transop_str (enum n2n_transform tr); | |||
void handleMgmtJson (n2n_edge_t *eee, char *udp_buf, const struct sockaddr_in se | void readFromMgmtSocket (n2n_edge_t *eee); | |||
nder_sock); | ||||
void handleMgmtJson_sn (n2n_sn_t *sss, char *udp_buf, const struct sockaddr_in s | void mgmt_event_post (enum n2n_event_topic topic, int data0, void *data1); | |||
ender_sock); | ||||
#endif /* _N2N_H_ */ | #endif /* _N2N_H_ */ | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 15 lines changed or added |