Commit Graph

62 Commits

Author SHA1 Message Date
Hamish Coleman
109b6e2fa5 Remove one remaining use of N2N_OSNAME and cleanup 2021-11-02 09:35:03 +00:00
Hamish Coleman
108c9436d5 Add robustness to the version calculations 2021-11-02 09:28:48 +00:00
Hamish Coleman
aafca3813a Use script to calculate the build version 2021-11-01 19:15:23 +00:00
Hamish Coleman
00a2bdc307 Remove all use of N2N_VERSION_SHORT in favor of PACKAGE_VERSION 2021-11-01 19:15:23 +00:00
Hamish Coleman
a9216f1097 Remove GIT_RELEASE variable and use the semantically identical N2N_VERSION instead 2021-11-01 19:15:23 +00:00
Hamish Coleman
430b0cb77d Fix CMakeFile version number embedded NL 2021-11-01 19:15:23 +00:00
Hamish Coleman
ff88803f6d Use one common file for the version number in both build systems 2021-11-01 19:15:23 +00:00
Luca Deri
9f2eb321de
Moved to 3.1 2021-10-27 20:42:25 +02:00
Hamish Coleman
80b33cd1a9
Basic C Code lint checker and shell checker (#859)
* Factor build packages out into a more maintainable list

* Create a location for scripts to live

* Provide a make target to return the source dir as close as reasonable to the original distributed state

* Add a code lint step, checking the coding style

* Change test harness as recommended by shellcheck

* Ensure we actually have the linter tool installed

* Use the correct directory for cmake to run the tests

* Adjust for the older uncrustify in the current github ubuntu-latest

* Make one file pass the linter

* Integrate the lint with the existing test workflow

* Add files with minimal changes needed to the linter

* Add more files with minimal changes needed to the linter

* Dont build binaries if we fail the lint test

* Update the phony targets with the lint steps

* Ensure the flake8 package is installed in the new lint workflow job

* Use the makefile to drive the packages needed to install for linting

* No need to add dependancies on lint, just rely on the workflow status to show failure

* Update the scripts dir README to reflect current assumptions

* Rename and briefly document the indent.sh script

* Fix the ignore to ignore the right Makefile

* Rename the test_harness script to make it clear it is a shell script

* Provide a master lint make target and add a shell script lint tool

* Elminate stray tabs

* Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-24 01:21:18 +05:45
Hamish Coleman
ae502d9181
JSON Reply Management API - feature parity with old management interfaces (#861)
* Ensure that recent code additions pass the linter

* Include some of the more obviously correct lint fixes to edge_utils.c

* Refactor edge JSON api into its own source file

* Use shorter names for static management functions

* Implement a JSON RPC way of managing the verbosity

* Tidy up help display in n2nctl script

* Make note of issue with implementing the stop command

* Implement a JSON RPC call to fetch current community

* Make n2nhttpd time value be more self-contained

* Make n2nhttpd order more closely match the existing management stats output

* Wire up status page to the verbosity setting

* Add JSON versions of the remainder of the edge management stats

* Add new file to cmake

* Properly define management handler

* Only update the last updated timestamp after a successful data fetch

* Function and types definition cleanup

* Force correct type for python scripts mgmt port

* Implement initial JSON API for supernode

* Fix whitespace error

* Use helper function for rendering peers ip4 address

* Proxy the auth requirement back out to the http client, allowing normal http auth to be used

* Ensure that we do not leak the federation community

* Use the same rpc method name and output for both edge and supernode for peers/edges

* Allow n2nctl to show raw data returned without resorting to tricks

* Make n2nctl pretty printer understandable with an empty table

* Use the full name for supernodes RPC call

* Use same RPC method name (but some missing fields) for getting communities from both edge and supernode

* Add *_sup_broadcast stats to edge packet stats output

* Refacter the stats into a packetstats method for supernode RPC

* Even if I am not going to prettyprint the timestamps, at least make all the timestamps on the page the same unit

* Simplify the RPC handlers by flagging some as writable and checking that in the multiplexer

* Remove invalid edges data

* Avoid crash on bad data to verbose RPC

* Avoid showing bad or inconsistant protocol data in communities RPC

* Minor clarification on when --write is handled

* Make linter happy

* Fix changed method name in n2nhttpd

* Move mainloop stop flag into the n2n_edge_t structure, allowing access from management commands

* Implement edge RPC stop command

* Move mainloop stop flag into the n2n_sn_t structure, allowing access from management commands

* Implement supernode RPC stop command

* Allow multiple pages to be served from mini httpd

* Extract common script functions into a separate URL

* Handle an edge case in the python rpc class

With a proper tag-based demultiplexer, this case should be a nop,
but we are single-threaded and rely on the packet ordering in this
library.

* Add n2nhttpd support to query supernode using urls prefixed with /supernode/

* Handle missing values in javascript table print

* Add another less filtering javascript key/value renderer

* Add a supernode.html page to the n2nhttpd

* Address lint issue

* Mention the second html page on the Scripts doc

* Remove purgable column from supernode edges list - it looks like it is rarely going to be set

* Add a simple one-line example command at the top of the API documentation

* Acknowledge that this is not the most efficient protocol, but point out that it was not supposed to be

* Make it clear that the n2nctl script works for both edge and supernode

* Fight with inconsistant github runner results

* Turn off the /right/ coverage generator
2021-10-23 11:05:05 +05:45
Hamish Coleman
b735ad6b9e
added test framework and code coverage reporting (#797)
* Add a simple test framework

* Add a code coverage report example oneliner

* Move the coverage report into a separate directory

* Add a github action to run tests and publish a branch with the coverage report

* Fix: Missing job separator

* Fix: remember to actually run configure

* Fix: Gotta autogen before I configure

* Dont try to upload coverage report unless this is a push

* Clearly show the git ref tested in the coverage report

* Add a test for the various transforms

* Add tests for the elliptic curve and pearson hash

* Ensure we ignore new generated output

* Remove unneeded boilerplate from the compression tests

* Add an example of a test of the encoded wire packets

* Ensure that correctly testable data is output even when zstd is not compiled

* Factor test runner out into its own script and attempt to add it to the cmake file

* Tell cmake about a new object file

* Stop trying to make Cmake work...

* Stop trying to make cmake work, round 2

* In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again

* Try again to plumb the tests into cmake

* Add missing library to our superset install line

* Fix build error when libcap-dev is installed

* Switch to using artifact uploads instead of pages to store/show the coverage report

* Fix artifact upload yaml

* Upload coverage report to codecov

* Fix codecov - clearly it doesnt do a recursive search for coverage files

* Fix codecov - my hopeful use of a list of directories didnt work

* Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output

* Fix codecov - nope, it still doesnt recursively search

* Fix codecov - it really helps if I run the gcov data generator

* Add a simple matrix build

* Fix older ubuntu versions of gcovr that do not support the '--html-title' option

* Ensure we use gcover options that are identical on older ubuntu

* Improve coverage generation and required build packages
2021-09-27 15:26:06 +05:45
Hamish Coleman
35ec7336a6
simplified the makefiles (#795)
* Move the makefiles towards a clearer arrangement

* Break circular make dependancy and start using implicit rules for most compilation

* Fix old cmake to compile again after renames
2021-09-16 18:34:04 +05:45
Logan oos Even
bc62b8be0a
changed default to pthread support again 2021-08-30 15:27:42 +05:45
Logan oos Even
70912300ca
updated CMakeLists.txt
disabled / undeffed global HAVE_PTHREAD due to #758 / #759
2021-08-30 12:46:07 +05:45
Logan oos Even
a1594bc976
Revert "Update CMakeLists.txt (#759)" (#760)
This reverts commit 921eb27482.
2021-08-30 12:43:09 +05:45
skyformat99
921eb27482
Update CMakeLists.txt (#759) 2021-08-30 11:24:10 +05:45
fengdaolong
04f0bd88e6
do not link if libpthread is not found (#757) 2021-08-29 13:27:17 +05:45
Logan oos Even
b0de090de4
Revert "correct wrong pthread lib switch logic (#755)" (#756)
This reverts commit 8e3fa33863.
2021-08-29 12:38:09 +05:45
fengdaolong
8e3fa33863
correct wrong pthread lib switch logic (#755) 2021-08-29 12:32:28 +05:45
fengdaolong
ae041c2133
CMakeLists.txt add link pthread library (#754) 2021-08-29 01:53:44 +05:45
Logan oos Even
7e0cbb10dc
updated CMakeLists.txt (#700) 2021-06-04 03:33:28 +05:45
fengdaolong
3a480a4a21
solved the problem that Windows cannot multicast (#576)
* Solve the problem that Windows cannot multicast.

* Better git judgment logic.
2021-01-12 14:26:40 +05:45
skyformat99
348d2baaf2
Update CMakeLists.txt (#510)
1)  add openssl version check
2) add  build option for  pcap lib : N2N_OPTION_USE_PCAPLIB
3) add build option for  libzstd  : N2N_OPTION_USE_ZSTD
2020-11-19 09:31:49 +01:00
skyformat99
11661a1cbf
Update CMakeLists.txt (#507)
* Update CMakeLists.txt

fix  #490 :
CMakeLists.txt error : made openssl & zstd support optional #490

* Update CMakeLists.txt

update message
2020-11-17 10:39:41 +01:00
joshuafc
b3f564e58c
Traffic Restrictions, Pass Build on CircleCI and local Windows 10 VS2019 (#499)
* Add new file 'network_traffic_filter.c/.h"

* Add feature to drop or accept specific packet transmit over edge network interface by rules.

* fix CMakeLists.txt typo

* Update Rule String Format

* replace -F (filter) with -R (rule) for traffic restrictions.

* Update edge help (-h)  message. Update documents.

* Pass Build on CircleCI and local Windows 10 VS2019

* Fix cmake build failed because of sn_selection

* fix operate void* cause vs2016 build failed

* Fix typo to pass build on windows.

* add inttypes.h for n2n_typedefs.h to pass windows build

* modify headers to pass build on windows.
2020-11-16 21:27:42 +01:00
vtcpip
a45676e131
Fixed edge linking error under mingw (#492) 2020-11-10 16:35:48 +01:00
joshuafc
a840aebb83
Add feature to drop or accept specific packet transmit over edge network interface by rules. (#489)
* Add new file 'network_traffic_filter.c/.h"

* Add feature to drop or accept specific packet transmit over edge network interface by rules.

* fix CMakeLists.txt typo

* Update Rule String Format

* replace -F (filter) with -R (rule) for traffic restrictions.

* Update edge help (-h)  message. Update documents.
2020-11-10 16:35:05 +01:00
fei4xu
a2db28275c
fix yocto cross build error: 'string.h ' not found (#487)
Co-authored-by: uib51588 <fei.4.xu@continental.com>
2020-11-05 18:03:50 +01:00
BetaBeauty
57f742fe42
Extra Device Description in P2P Connection and Register to Super Node (#475)
* add cmake export commands

* add extra edge description (hint) field

* add peer2peer description registry

* fixed bug: peer2peer not pass the dev_desc filed

* update -I option in the helper text

Co-authored-by: Longtao Wang <longtao.wang@cortexlabs.ai>
2020-10-26 21:13:56 +01:00
南浦月
e4637cd48b
fix(cmake): install path of man pages 2020-09-07 14:32:35 +08:00
Logan oos Even
90a071a1d3
Merge branch 'dev' into revCc20 2020-09-01 20:16:32 +05:45
Logan007
e087124dd9 reworked cc20 2020-09-01 16:17:52 +05:45
fengdaolong
f560e8f753 Fix the version number displayed after building by Cmake. 2020-08-29 00:49:54 +08:00
Luca Deri
31a05e18d1
Merge pull request #389 from Logan007/revTf
reworked twofish implementation and replaced it by a faster version
2020-08-28 13:01:19 +02:00
Logan007
d5c1295bec replaced twofish implementation by a faster version 2020-08-26 18:07:05 +05:45
Logan007
6d05d48878 changed aes transform to cipher text stealing mode 2020-08-23 20:02:19 +05:45
Logan007
b5b18443af added regular expression checking 2020-08-04 18:49:12 +05:45
fengdaolong
51c889ddea Fix read tap device failed when OS wake up from sleep.
Adjust the structure of the source file to the header file.
2020-07-06 13:17:01 +08:00
fengdaolong
1ada1dc7ed CMakeLists.txt automatically judges git commands and OpenSSL libraries.
1. Automatically determines whether the git command exists to generate a revision number.
2. When OpenSSL is not found, AES is automatically disabled.
2020-07-02 11:54:22 +08:00
fengdaolong
f5accc8221 Fix cmake compilation errors.
1. CMakeLists.txt added to automatically obtain the revised version number from the git repository.
2. Adjusted some header files to fix Windows platform compilation errors.
3. Eliminate some compilation warnings.
2020-07-01 18:35:22 +08:00
Logan007
43feafa1b6 prepared header encryption 2020-06-17 11:51:05 +05:45
Logan007
67a1cb1792 polished speck 2020-06-17 11:30:48 +05:45
Logan007
9d9695ebdb added XORSHIFT128+ random number generator 2020-06-08 16:10:25 +05:45
emanuele-f
3d9d3a13f7 Windows cmake fix
Fixes #248
2020-05-27 10:54:12 +02:00
emanuele-f
5044fcde26 Add linux capabilities dependency to cmake 2020-05-24 11:36:56 +02:00
Luca Deri
54ad44749b
Merge pull request #223 from cnanakos/osx_catalina_compile_failure
Fix OSX Catalina compilation failure
2020-04-24 00:38:14 +02:00
Chrysostomos Nanakos
e68a344ff8 Fix OSX Catalina compilation failure
Include openssl library path for n2n-benchmark compilation

Fixes https://github.com/ntop/n2n/issues/222

Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
2020-04-10 22:55:32 +03:00
Felix Pojtinger
2058ab93c8 Add more embedding examples and initally decomposed sn_utils 2020-03-16 15:03:03 +01:00
emanuele-f
252ee3e82f Call pcap_set_immediate_mode if available 2019-09-21 17:02:24 +02:00
emanuele-f
9d64ca0088 Fix install targets 2019-09-21 16:26:18 +02:00