Commit Graph

42 Commits

Author SHA1 Message Date
Logan oos Even
51a3a71f95
introduced n2n-portfwd tool (#1008)
* moved dev to version 3.1.1

* introduced n2n-portfwd tool

* moved port-forwarding source to tool

* adjusted tiny things, seemingly works with ./configure's  --enable-miniupnp  and  --enable-natpmp

* adjusted for Windows

* wished for better typing skills

* applied some finishing touch

* typo
2022-06-05 18:05:40 +02:00
Logan oos Even
99b6b6b66d
added n2n-route tool (#982)
* moved dev to version 3.1.1

* laid ground for n2n-route tool

* adapted code style

* overhauled n2n-route's tool program logic and removed route code from edge

* added missing initialization of federation's purgeable field

* lifted un/purgeable confusion

* added warning about removed -n cli option

* realized that Windows does not offer inet_aton()

* removed -n option documentation from edge's man page

* slightly simplified n2n-route program logic

* applied more logic changes to n2n-route tool

* added 'info' read command to edge's management port

* corrected indention

* added Linux route control to n2n-route tool

* temporarily restricted n2n-route tool to Linux only

* We must be over the routing!

* pulled default gateway change detection into main loop to cover mobile use, and added devstr_t type

* corrected use of new UNPURGEABLE - so far gone unnoticed

* addresses possiible address issue

* i broke it

* reverted bad ideas

* added command line options, help text, and prevented vpn gateway being used for supernode/peer traffic routes

* added option to manually provide default gateway, also verbosity options

* getting there

* added option to limit networks to be routed (-n), adapted documentation

* fine-tuned minor things
2022-05-24 20:38:51 +02:00
Logan oos Even
73d0d76f29
changed benchmark to MTU sized packets (#966) 2022-03-12 20:56:56 +01:00
Logan oos Even
e686b9592c
(C) update (#965) 2022-03-12 10:22:42 +01:00
Logan oos Even
f59c6900a1
moved compression code into transforms (#961) 2022-02-21 10:09:06 +01:00
Hamish Coleman
e4e2aba420
Increase code Coverage (#897)
* Make it clear which hash we are testing

* Coverage for all pearson hash variants

* Initial coverage for auth.c

* Add some more auth.c coverage

* Ensure new bins are added to both build systems

* Ensure new source files are fully linted
2021-11-10 06:02:05 +00: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
Logan oos Even
5f3c27e3a6
compile fix (#846) 2021-10-07 14:05:29 +05:45
Hamish Coleman
2e57663cde
increased test coverage (#844)
* Start adding helper functions to the wire tests

* Add tests for two more wire functions

* Update test expects with new test data

* Use the normal mac address format, like a boss
2021-10-07 13:22:00 +05:45
Hamish Coleman
4438f1aa2a
added mingw test platform (#829)
* Provide a minimal reimplementation of our autoconf, to try windows builds

* Try building with windows

* Fix thinko in spelling

* Ensure shell script runs inside a shell

* Add a hack to aid include discovery

* Just keep adding tech debt...

* Assume that we will have slashes in some of the replacement strings and avoid that char with sed

* Restore one slash

* Hack around the tools makefile interdependancy bug

* A correct cflags include hack for each compile dir

* Ensure we link against winsock (note, even though this says 32bit, it should link the 64bit library ... I think)

* Bad link ordering if we dont use LDLIBS

* Remove unused make variable

* Remove makefile duplication using inheritance (this does mean you can no longer cd tools; make, but must do make tools)

* Add missing library for win32

* Show OS variable

* Make hack autoconf more robust for tests on non gitlab runners

* Remove no longer used substitutions from hack autoconf

* Add missing include path to tools under win32

* Build the win32 subdir when the compiler is Msys

* The different subdirs have different dependancies

* Ensure we can find the include files

* Fix library link ordering

* Ensure the tools dir can find the special win32 lib

* Deal with the differing basic type sizes on both linux/64bit and windows/64bit

* Document the steps to mimic the github windows/mingw build locally - to allow for simpler debugging

* Ensure branch name in instructions matches my test branch name

* Clarify the shell needed to build with mingw

* Since the makefile depends on knowing the OS, raise a fatal error if we cannot determine this

* Handling different compile environments is hard.

- Linux: sane and reasonable results for both uname -s (=Linux) and
  uname -o (=GNU/Linux)
- Windows/Mingw: insane results for uname -s
  (=MSYS_NT-$MAJOR.$MINOR-$BUILDNR) but sane results for uname -o (Msys)
- Macos: sane results for uname -s (=Darwin) but does not support
  uname -o at all

* Revamp the way that Mingw is detected

* Avoid attempting to generate gcovr report when running under windows

* Whoops, isolate the right step

* Fix spelling mistake

* win32/Makefile: Remove unused setting and add comment

* ensure that all win32 includes use the same expected path

* Allow simpler cross compilation by letting configure pass the CC and AR environment through

* Avoid multiple '_CRT_SECURE_NO_WARNINGS redefined' warnings

* Convert to a consolidated CONFIG_TARGET variable to select any different compile options

* Use the more generic printf defines to avoid warnings on mingw

* Update mingw build docs

* English better for reader happy make

* Address a number of mingw compiler warnings

* Fix Visual C compile

* Be sure to document some of the hacky nature of the mingw build
2021-10-06 00:52:15 +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
Hamish Coleman
370ea9bd37
addressed all but one of the remaining compile warnings (#793)
* Fix the mismatched char, uint8_t warnings

* Ensure we leave room for zero termination and then ensure the string is terminated

* GCC has a warning if it thinks your could overflow your snprintf buffer, but dont check for said overflow
2021-09-16 14:45:46 +05:45
Logan oos Even
a28327a0af
added user-password edge authentication (#673) 2021-06-04 03:11:22 +05:45
Luca Deri
85894715bd Added build target for Ubiquity EdgeRouter X 2021-02-16 11:31:23 +00:00
Logan oos Even
cef5561c5a
switched to 2021 (#632) 2021-02-08 16:11:06 +05:45
Logan oos Even
9ee62d7415
rebased time stamp format: header encryption (#579)
* rebased time stamp format (header encryption)

* rearranged time stamp fields
2021-01-12 14:28:21 +05:45
Logan oos Even
fb989236f5
refrained from calling gettimeofday() too often during benchmark (#484)
* refrained from calling gettimeofday too often during benchmark

* refrained from calling gettimeofday too often during benchmark
2020-11-09 16:06:19 +01:00
Luca Deri
3095c816e2 Warnign fixes 2020-10-20 17:17:17 +02:00
Logan oos Even
b858ffeb06
added pure decryption speed output (#470)
Co-authored-by: Logan007 <you@example.com>
2020-10-19 09:45:20 +02:00
Logan oos Even
2f220fd924
added (de-)compression to benchmark tool (#446)
* moved calls to decode functions into the decryption block

* adjusted output

* added (de)compression to benchmark

* added pearson hashing to benchmark

Co-authored-by: Logan007 <you@example.com>
2020-10-03 17:15:12 +02:00
maruncz
a02c1ae1ea fix benchmark output formatting 2020-09-13 10:01:27 +02:00
Logan007
0267f1db7f reworked cc20 2020-09-01 22:55:53 +05:45
Logan007
87ee4d6fa7 reworked cc20 2020-09-01 22:50:52 +05:45
Logan oos Even
90a071a1d3
Merge branch 'dev' into revCc20 2020-09-01 20:16:32 +05:45
Logan007
8757312d41 reworked cc20 2020-09-01 20:09:29 +05:45
Logan007
c9412a290b made aes always available 2020-08-31 02:24:23 +05:45
Logan007
d5c1295bec replaced twofish implementation by a faster version 2020-08-26 18:07:05 +05:45
Logan007
252ce9779a moved windows-gettimeofday() from benchmark.c to n2n.c 2020-07-21 19:11:31 +05:45
Luca Deri
0bf7ae0a01 Minor code claanup 2020-06-21 22:33:28 +02:00
Luca Deri
3eb82b2a32 Code reorganization 2020-06-21 22:26:27 +02:00
lucaderi
cd62591ade CentOS6 fixes 2020-06-08 00:01:28 +02:00
Luca Deri
bd49b4e3a3 Compilation fixes 2020-06-07 13:51:48 +02:00
Luca Deri
3b0903785e
Merge branch 'dev' into speck 2020-06-07 10:10:20 +02:00
Logan007
9509634ca5 added SSE - Part II 2020-06-03 22:10:49 +05:45
Logan007
0477e476e8 added Speck 2020-05-28 03:17:21 +05:45
Logan007
9e5934acc8 added ChaCha20 (cc20) 2020-04-26 15:46:41 +02:00
Luca Deri
97c8948113 MacOS fixes 2020-04-24 00:36:32 +02:00
Luca Deri
2636c65999 Waarning fix 2020-04-23 23:55:16 +02: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
emanuele-f
60a4ba90ce Add tools subdirectory 2019-09-21 16:13:52 +02:00