Commit Graph

536 Commits

Author SHA1 Message Date
Hamish Coleman
017f1cf60e Address lint issues 2022-02-05 20:06:31 +00:00
Hamish Coleman
860b27d97c Add event publishing for adding and removing P2P peers 2022-02-05 20:06:31 +00:00
Hamish Coleman
a40ed15d93 Add pubsub system to edge, with one example TEST channel 2022-02-05 20:06:31 +00:00
Hamish Coleman
509a8bcd14 Add a buffer object with a known size field to replace multiple hardcoded N2N_PKT_BUF_SIZE 2022-02-05 20:06:31 +00:00
Hamish Coleman
598ce63981 Use getnameinfo to show the subscribed socket details 2022-02-05 20:06:31 +00:00
Hamish Coleman
9c77d0becd Address warning 2022-02-05 20:06:31 +00:00
Hamish Coleman
58fedeed95 Add a helper for simple 1 arg json replies 2022-02-05 20:06:31 +00:00
Hamish Coleman
64e5329bca Refactor command handler lookup into a macro for reuse in the topic lookup 2022-02-05 20:06:31 +00:00
Hamish Coleman
e2a33b7571 Implement initial help command for subscription topics 2022-02-05 20:06:31 +00:00
Hamish Coleman
3fd1dc5fa8 keep private enum definition local to the management code 2022-02-05 20:06:31 +00:00
Hamish Coleman
e3899d1b76 Give a magic number a better name 2022-02-05 20:06:31 +00:00
Hamish Coleman
06b8f1a08f Refactor management command list to allow it to be declared const with no warnings 2022-02-05 20:06:31 +00:00
Hamish Coleman
3e2c2d63bc Add basic structures to be used for pubsub 2022-02-05 20:06:31 +00:00
Hamish Coleman
40773b4e4d Ensure we have a local copy of the tag in our request structure - which will be useful for the event framework 2022-02-05 20:06:31 +00:00
Hamish Coleman
35c83a0825 Simplify edge mgmt handling by building a request structure and using it for replies 2022-02-05 20:06:31 +00:00
Hamish Coleman
6e4cf85915 As we are in our own namespace, we can ditch the n2n_ prefix to some definitions 2022-02-05 20:06:31 +00:00
Hamish Coleman
ace3dbc44f Move all supernode management handling into one source file 2022-02-05 20:06:31 +00:00
Hamish Coleman
a8e2704b41 Move all management packet handling for edge into the one source file 2022-02-05 20:06:31 +00:00
Hamish Coleman
3713d357c8 Document the tricky code - TODO, make it less tricky 2022-02-05 20:06:31 +00:00
Hamish Coleman
954547a9c1 Remove the only obstacle that stopped running the supernode as a normal user 2022-02-05 20:06:31 +00:00
Hamish Coleman
4f568b03c1
Autoconf simplification (#927)
* Convert zstd feature to default disable

* All autoconf test use one standard template

To simplify the testing, cross-compilation and repeatable build process,
no configure options are automatically probed for - they all default to
off and are all using the same template.

The --with-x options should be deprecated and replaced with --enable-x
because there is no syntax checking for --with options in autoconf.

There are still some differences between the config options, but this
should provide a starting point.

* Remove unused code from the autoconf

* Remove warnings from default build

* Avoid calling port mapping functions if none are enabled

* Start with all builds in neutral config

* Add more missing code guards

* Adjust code guard location to placate cmake
2022-01-10 19:58:15 +00:00
Hamish Coleman
da9ba27b0a
Minor build document improvments (#926)
* Improve some build documentation

* Address build failure
2022-01-09 18:07:29 +00:00
fengdaolong
2378ea0be2
simplified the path in the log (#910) 2021-12-24 20:56:35 +01: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
c5f9e8198b
had the edge output supernode version to log on incoming PONG (#894) 2021-11-07 16:53:01 +05:45
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
Logan oos Even
81bd79a82a
assured correct supernode MAC address properties (#888) 2021-11-02 00:01:44 +05:45
Logan oos Even
e0a9bb95fc
differentiated between 'active' and 'standby' in sn-selection-by-mac mode (#887) 2021-11-01 23:31:03 +05:45
Logan oos Even
f4e7e513a8
added MAC address based supernode selection (#885) 2021-11-01 16:35:05 +05:45
Logan oos Even
ecff46a043
applied tiny optimization to PACKET's code path (#882) 2021-10-31 22:38:56 +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
7b7449c813
Minor JSON field name fixes and additions (#865)
* Change JSON supernodes field to match the struct member name

* Add some missing fields to the edge json output.
2021-10-24 04:05:36 +05:45
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
e6fcf1c55b
Cleanup and Documentation for JSON management API (#856)
* Reimplement JSON mgmt with clear separation of read/write actions

* Reduce boilerplate by using a table driven command definition for json mgmt commands

* Port tools to use new json api

* Add a basic authentication for json mgmt commands

* If a auth key is given, it must match

* Add auth key to management scripts

* Add a flag bitfield to clearly turn the tag param into a options list

* Allow simple pass-through of any command from n2nctl

* Convert the n2nctl to use an object oriented interface

* Handle sigpipe in the n2nhttpd - this happens if the remote client disconnects unexpectely

* Remove some repetition from the server

* Use the correct options to allow reuseaddr

* Dont generate a scary message on ctrl-c

* Convert n2nhttpd to use object based RPC

* Use the same longopt for both tools

* Pass any extra args through to the RPC

* Add some documentation for the scripts in the repository

* Spelling fix

* Add documentation for the JSON reply mangement API
2021-10-18 02:01:42 +05:45
Hamish Coleman
bb3de5698c
added JSON interfaces to edge management port and scripts to further process output (#854)
* Add management commands to show data in JSON format

* Add a script to query the JSON management interface

* Suprisingly, the github runner does not have flake8 installed

* Add n2nctl debugging output to show the raw data received from the JSON

* Ensure well known tag wrap-around semantics

* Try to ensure we check every edge case in the protocol handling - only valid packets are allowed

* Add a very simple http to management port gateway

* Fix the lint issue
2021-10-16 00:11:39 +05:45
Logan oos Even
50d4273272
disabled federation name output at supernode's management port (#845) 2021-10-07 13:56:03 +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
db5adc2038
fine-tuned REGISTER cookie handling (#837) 2021-10-03 18:19:29 +05:45
Logan oos Even
bc65a7f59e
added forwarded REGISTER cookie type (#836) 2021-10-03 05:24:33 +05:45
Logan oos Even
ebb357245a
added a flag field to QUERY_PEER (#835) 2021-10-02 23:17:45 +05:45
Logan oos Even
560b16f28f
compile fix (#833) 2021-09-30 12:21:26 +05:45
Logan oos Even
4137441b5e
fine-tuned log levels (#827) 2021-09-29 13:38:55 +05:45
Luca Deri
00159d0d01 Compilation fix 2021-09-27 16:38:13 +02:00
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
Logan oos Even
0d39f50051
created space for more REGISTER type cookies 2021-09-27 02:41:14 +05:45
Logan oos Even
40f1894956
hid community name at management port if header encryption enabled (#822) 2021-09-26 05:01:53 +05:45
Logan oos Even
cc2b0b6b6b
added support for N2N_FEDERATION environment variable (#820) 2021-09-26 04:32:12 +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
Logan oos Even
f093996535
moved up 'send_unregister_super()' to happen before 'WaitForSingleObject()' (Windows TAP thread's end) 2021-09-23 15:54:55 +05:45
lucktu
c4d56574ef
polished edge's management port output (#805) 2021-09-20 18:01:07 +05:45
Luca Deri
d4e0f5a445 Warnign fixes 2021-09-18 09:39:57 +02:00
Logan oos Even
37c556b57b
modified edge's management port output (#801) 2021-09-18 01:04:24 +05:45
skyformat99
a87a124316
Update supernode.c (#800)
fix #799
2021-09-17 15:22:26 +02:00
Logan oos Even
dd41689bb9
added supernode version and uptime information to edge management port output (#796) 2021-09-17 02:34:09 +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
593387fe30
compile fix (#794) 2021-09-16 15:07:33 +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
05f40c64db
relocated 'detect_local_ip_address()' (#792) 2021-09-16 14:15:21 +05:45
Logan oos Even
9c22d28562
relocated 'detect_local_ip_address()' (#791) 2021-09-16 12:20:35 +05:45
Hamish Coleman
6b353141b4
addressed warnings (#790) 2021-09-15 22:08:45 +05:45
Logan oos Even
72d703c449
disabled edge's multicast peer detection if used with '-e' (#783) 2021-09-13 21:03:35 +05:45
Logan oos Even
8eb13165d4
added another type cast to socket handling 2021-09-13 15:07:34 +05:45
Logan oos Even
46205c6cff
added type cast to socket handling 2021-09-13 14:40:28 +05:45
Logan oos Even
c5970986f5
replaced 'close()' with 'closesocket()' 2021-09-13 13:39:15 +05:45
Logan oos Even
b3bf36f867
separated 'detect_local_ip_address()' function (#781) 2021-09-13 11:33:27 +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
04d91f84d8
fixed optional SKIP_MULTICAST_PEERS_DISCOVERY macro (#770) 2021-09-08 00:56:05 +05:45
Logan oos Even
236b9bf4c7
fixed missing gratuitous arp (#769) 2021-09-07 01:36:51 +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
c5eb756840
de-nested one if block 2021-08-30 16:03:11 +05:45
skyformat99
586beee871
fixed segmentation fault #758 (#762) 2021-08-30 14:35:14 +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
Hamish Coleman
ecedcdcb58
Major documentation improvements (#752) 2021-08-19 20:02:53 +05:45
Logan oos Even
e09f3a4875
added federation support to user/password auth scheme (#741) 2021-07-31 22:17:07 +05:45
skyformat99
6f63f401fe
updated for compilation with VS2015 (#739) 2021-07-26 12:53:05 +05:45
Logan oos Even
c35129b8e2
added 'reload_communities' command to supernode management port (#740) 2021-07-24 03:46:50 +05:45
Logan oos Even
c394726928
narrowed sn's edge-last-seen update mechanism (#734)
* fortified user/pw auth scheme

* narrowed sn's edge-last-seen update mechanism
2021-07-22 14:51:09 +05:45
Logan oos Even
84d0991977
fortified user/pw auth scheme (#731) 2021-07-21 02:52:38 +05:45
Logan oos Even
1f51aa1d5c
conditionally downgraded one ERROR msg to DEBUG msg (#725) 2021-07-14 18:37:22 +05:45
small_5
037914daf0
fixed segfault (#722) 2021-07-11 21:43:58 +05:45
Logan oos Even
b648872c1f
modified route setup (#717) 2021-07-11 00:22:58 +05:45
Logan oos Even
39aa50b4cd
added manual MAC/IP address spoofing protection override at supernode (-M) (#716) 2021-06-21 17:03:07 +05:45
Logan oos Even
54f39e9eb0
fixed supernode's detetcion of orderly remote tcp connection closure (#713) 2021-06-17 22:16:45 +05:45
Logan oos Even
701befe6df
fixed superfluous message (#708) 2021-06-07 22:59:22 +05:45
Logan oos Even
aac58a88ec
fixed supernode's federation behavior (auth error) (#707) 2021-06-07 20:54:22 +05:45
Logan oos Even
2e1991ecf3
added compiler check for special intrinsic (#706) 2021-06-07 18:18:45 +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
1a523f5e1a
fixed supernode segmentation fault (#697) 2021-05-24 00:20:52 +05:45
Logan oos Even
667b7df083
added memrnd() (#685) 2021-04-19 00:47:37 +05:45
randomize00
cfa92d28d8
add callback function for hin2n to protect socket (#684) 2021-04-14 11:31:50 +05:45
randomize00
e2c687558f
fix potential memory leak (#682)
authored-by: randomize00 <randomize00@users.noreply.github.com>
2021-04-07 14:31:40 +05:45
Logan oos Even
12e81c6be3
typo
'0' is legit load or ping
2021-04-06 11:45:40 +05:45
Luca Deri
aa18bd3036 Warning fixes 2021-04-05 19:34:54 +02:00
Sven Roederer
23c18e349f
drop non portable SOL_TCP / fix MacOS v2 (#680)
* Revert "Fix compilation on MacOS"

in order to another solution

* src: use IPPROTO_TCP in place of SOL_TCP

* use the more specific IPPROTO_TCP type for setsockopt
* fixes build on MacOS

src/edge_utils.c:891:31: error: use of undeclared identifier 'SOL_TCP'; did you mean 'FPP_TCP'?
        setsockopt(eee->sock, SOL_TCP, TCP_NODELAY, &value, sizeof(value));

src/edge_utils.c:894:31: error: use of undeclared identifier 'SOL_TCP'
        setsockopt(eee->sock, SOL_TCP, TCP_CORK, &value, sizeof(value));
                              ^
src/edge_utils.c:894:40: error: use of undeclared identifier 'TCP_CORK'
        setsockopt(eee->sock, SOL_TCP, TCP_CORK, &value, sizeof(value));

* include/n2n.h: drop redefiniton of SOL_TCP for WIN32, as we don't use it anywhere now

* src: only use TCP_CORK on LINUX

* it's LINUX only and fails on Win32 and MacOS (man 7 tcp)
2021-04-05 19:30:53 +02:00
Alfredo Cardigliano
53e930db10 Fix compilation on MacOS 2021-03-29 09:28:13 +02:00
Logan oos Even
dcd3801df5
honed tcp implementation (#676) 2021-03-28 00:04:55 +05:45
Logan oos Even
a23b459738
fixed memory issue (#675) 2021-03-26 21:13:20 +05:45
Logan oos Even
7c3951a10f
revised tcp implementation (#674) 2021-03-26 20:45:31 +05:45
Logan oos Even
b949b23e2a
narrowed multicast determination (#669) 2021-03-18 19:23:42 +05:45
Logan oos Even
edc6f53ca0
prevented transmission of QUERY_PEER on multicast MAC addresses (#668) 2021-03-18 18:14:01 +05:45
Logan oos Even
048fd3e128
fixed another memory issue (#667) 2021-03-18 17:01:12 +05:45
Logan oos Even
1c1a9f5058
fixed small memory issue (#666) 2021-03-18 16:03: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
aa1f4311f9
adapted packet format (#662)
* adapted packet format
2021-03-16 17:24:59 +05:45
Logan oos Even
23a9c871f8
increased resilience to supernode failure (#660) 2021-03-09 04:46:42 +05:45
Logan oos Even
1bcc64ccb3
fixed unrelated error message (#653) 2021-03-04 16:17:48 +05:45
Logan oos Even
20133f599c
improved socket handling (#650) 2021-03-01 14:13:14 +05:45
Logan oos Even
d8ae2e89ca
fixed edge stall (#649) 2021-03-01 00:12:04 +05:45
Logan oos Even
db4b927b8e
fixed multicast decode error message (#648) 2021-02-27 21:29:25 +05:45
Logan oos Even
64b8136301
fixed compile warnings (#647) 2021-02-27 20:38:18 +05:45
Logan oos Even
e47b492c4d
fixed compile warning (#646) 2021-02-27 18:03:04 +05:45
Logan oos Even
c8fabbdfe0
added more targeted routing for packet forwarding in federation (#643) 2021-02-23 18:51:14 +05:45
Logan oos Even
a482fe112d
added TCP support (#627)
(disabled on Windows)
2021-02-22 22:37:47 +05:45
vtcpip
b42c111527
fix windows compile (#636) 2021-02-10 15:16:16 +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
408f24d778
corrected supernode help text (#633) 2021-02-08 17:04:57 +05:45
Logan oos Even
cef5561c5a
switched to 2021 (#632) 2021-02-08 16:11:06 +05:45
Logan oos Even
aaca1424fd
added AVX-512 support to SPECK cipher (#630) 2021-02-08 15:27:29 +05:45
Logan oos Even
12e55935c2
adjusted supernode management port output (#628) 2021-02-07 19:00:58 +05:45
Logan oos Even
fb827a843b
reworked edge management port output (#623) 2021-02-06 18:24:08 +05:45
Logan oos Even
08a4e332c8
generalized auth scheme handling (#624) 2021-02-03 20:52:41 +05:45
Logan oos Even
b3a4eac4d7
enabled windows random numbers for seed (#622) 2021-02-02 18:43:30 +05:45
Logan oos Even
89052c24d5
clarified debug message on unknown ether type (#620) 2021-02-02 16:58:01 +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
Logan oos Even
c2741ace2d
guarded free() on supernode exit (#615) 2021-01-31 21:12:30 +05:45
Logan oos Even
ba9a32fb30
fixed minor timing issues (#616) 2021-01-31 21:12:08 +05:45
anzz1
9cac336488
added network interface metric option for windows (#606) 2021-01-30 18:00:01 +05:45
Logan oos Even
6c8e1b6f60
fixed edge segfault (#613) 2021-01-30 17:35:12 +05:45
Logan oos Even
7a4623a61d
fixed time stamp issue (#612) 2021-01-30 17:34:52 +05:45
randomize00
5aac8813e6
safer checking for REGISTER_SUPER_ACK and UNREGISTER_SUPER (#611) 2021-01-29 18:48:26 +05:45
Logan oos Even
c696f59e07
ensured correct community file loading (sn) (#609) 2021-01-29 14:52:11 +05:45