Commit Graph

75 Commits

Author SHA1 Message Date
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
da9ba27b0a
Minor build document improvments (#926)
* Improve some build documentation

* Address build failure
2022-01-09 18:07:29 +00:00
Logan oos Even
e6e8cb038a
added port forwarding (upnp and natpmp) (#905)
* UPnP port redirection is supported.

* compile fixes

* compile fix

* optimize reconnection code

* prepared upnp threadification to counter main loop stall at supernode change

* NAT-PMP port forwarding support, temporarily merge codes to resolve conflicts.

* make compile fix

* prepared threadification in more detail

* adopted threadification to new file setup

* cleaned up

* renamed functions and data structures

* fixes

* differentiated between miniupnp and natpmp and added corresponding lib support to makefile

* name

* commented unused header includes

* comments

* license

* fixes

* fixes

* fixes

* NAT-PMP is already available.

* added CLI parameter to disable port forwarding if required

* preliminary made use of multithreading

* adjusted log level

* added man page documentation

* def'ed conf

* made pmpnat adjustments

Co-authored-by: fengdaolong <fengdaolong@gmail.com>
2021-12-23 12:27:55 +01:00
Logan oos Even
f4e7e513a8
added MAC address based supernode selection (#885) 2021-11-01 16:35:05 +05:45
Logan oos Even
3b187b4ac8
updated JSON API password handling '--management-password <pw>' (#869) 2021-10-24 15:22:36 +05:45
Logan oos Even
c61b62ab1b
choose supernode selection strategy at run-time '--select-rtt' (#864) 2021-10-24 12:53:25 +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
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
Logan oos Even
56a81f02b8
fixes (#819) 2021-09-26 00:17:47 +05:45
Logan oos Even
dfe15ad95d
added support for N2N_PASSWORD environment variable (#818) 2021-09-25 16:01:11 +05:45
Hacker
09fdfb0424
added support for COMMUNITY_NAME environment variable (#814)
Co-authored-by: codeneno <qsmy_qin@163.com>
Co-authored-by: Logan oos Even <Logan.00sEven@gmail.com>
2021-09-25 15:15:16 +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
7f1fe9a499
allowed edge to optionally auto-detetct local IP address ('-e auto') for advertising as preferred (#776) 2021-09-12 00:22:05 +05:45
Logan oos Even
defad50f87
removed '-p' cli option requirement for (#775) 2021-09-11 20:54:09 +05:45
Logan oos Even
52efc6ffad
compilation fix 2021-09-09 14:10:01 +05:45
Logan oos Even
7fa0cc1e0a
added preferred socket handling (-e) (#765) 2021-09-09 14:07:29 +05:45
Logan oos Even
05e6579038
merged edge's '-b' into '-p' command line option (#772) 2021-09-09 12:44:23 +05:45
Logan oos Even
b6e865aac7
trimmed open_socket() down by one parameter (#768) 2021-09-06 17:03:15 +05:45
Logan oos Even
e13c9a01a5
rearranged thread-related code (#761) 2021-08-30 14:23:31 +05:45
Logan oos Even
f6eb1377ec
reviewed log messages (#744) 2021-08-29 15:10:23 +05:45
Logan oos Even
c21accc2a1
enabled edge to bind to a specified IP address (-b) (#753) 2021-08-28 03:08:23 +05:45
Logan oos Even
b648872c1f
modified route setup (#717) 2021-07-11 00:22:58 +05:45
Logan oos Even
1586ae62a7
made n2n react more swiftly to (D)DNS changes (#705) 2021-06-07 17:57:49 +05:45
Logan oos Even
75ab1fc5aa
made internal changes to cli parameter processing (#702) 2021-06-05 18:56:47 +05:45
Logan oos Even
3c6ab56d3f
allowed (temporarily) initially non-resolving supernode names (#701) 2021-06-05 17:54:32 +05:45
Logan oos Even
c55e3e3246
multithreaded supernode name resolution (#645) 2021-06-04 03:52:12 +05:45
Logan oos Even
a28327a0af
added user-password edge authentication (#673) 2021-06-04 03:11:22 +05:45
Logan oos Even
969b667aae
deprecated solitary options -A, -S, -z (#665) 2021-03-18 10:45:52 +05:45
Logan oos Even
f41babcf4d
fixed compile warnings (#664) 2021-03-17 12:38:00 +05:45
Logan oos Even
0287837241
skewed supernode selection for the benefit of current supernode in no-pong case (#663) 2021-03-16 23:24:39 +05:45
Logan oos Even
64b8136301
fixed compile warnings (#647) 2021-02-27 20:38:18 +05:45
Logan oos Even
a482fe112d
added TCP support (#627)
(disabled on Windows)
2021-02-22 22:37:47 +05:45
Logan oos Even
c73e59341d
made gratuitous arp being sent at the right time (#635) 2021-02-08 20:55:11 +05:45
Logan oos Even
54ba76e3bc
clarified error message (#634) 2021-02-08 17:24:03 +05:45
Logan oos Even
09e8d5e730
limited number of concurrently pinged supernodes (#619) 2021-02-01 18:31:36 +05:45
Logan oos Even
916c423ffe
fixed metric parameter passing to wintap.c (#618)
* fixed metric parameter passing to wintap.c

* fixed metric sub/interface command to set metric
2021-02-01 16:19:19 +05:45
anzz1
9cac336488
added network interface metric option for windows (#606) 2021-01-30 18:00:01 +05:45
Logan oos Even
f352c99255
reworked edge help text (#604) 2021-01-28 00:07:28 +05:45
Logan oos Even
2fbbafc88d
fixed conf file parsing
allowing space character inside parameter option, .e.g. `-d Windows TAP` (between "Windows" and "TAP").
2021-01-26 15:58:05 +05:45
Logan oos Even
c0c472b4aa
revised bootstrap (#599) 2021-01-25 16:54:38 +05:45
Logan oos Even
773123f7a9
removed duplicate field for supernode socket from edge (#587) 2021-01-16 17:13:52 +05:45
Logan oos Even
0e29d695ee
quick-fixed auto ip (#586) 2021-01-16 05:39:20 +05:45
Logan oos Even
18107bcb7c
fixed conf file option parsing 2021-01-16 04:00:05 +05:45
Logan oos Even
4e2548a98c
simplified conf file parsing (#582) 2021-01-13 00:45:48 +05:45
Logan oos Even
c99f610f73
fix AES default (#575)
* fix AES default

* fix AES default
2021-01-08 01:01:53 +05:45
Francesco Carli
244b1bef95
Change space indention (#556)
* readability code clean-up

* readability code clean-up

* change space indention

* change space indention

* Update sn_utils.c
2021-01-07 11:14:25 +01:00
Francesco Carli
e71de330e5
readability code clean-up (#542) 2020-12-19 12:28:06 +01:00
fengdaolong
d7654397a8
Fix the problem of running edge, IP or domain name resolution failure under Windows system. (#527) 2020-12-08 15:46:40 +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