Commit Graph

28 Commits

Author SHA1 Message Date
Logan oos Even
053ab381b3
fixed endianess issue in federated sn socket forwarding (#1030) 2022-06-28 16:53:12 +02:00
Logan oos Even
439dfc6886
generalized sockaddr usage in edge (#1026) 2022-06-26 17:17:22 +02:00
Logan oos Even
ffb4e31b8a
encapsulated several fillings of n2n_sock_t in single function (#1025)
* encapsulated several fillings of n2n_sock_t in single function

* Windows specifics...

* stuck to the project's style code
2022-06-26 00:07:29 +02:00
Logan oos Even
e686b9592c
(C) update (#965) 2022-03-12 10:22:42 +01:00
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
7fa0cc1e0a
added preferred socket handling (-e) (#765) 2021-09-09 14:07:29 +05:45
Logan oos Even
7eeca3d78f
cleaned up mac type usage (#583) 2021-01-13 14:50:26 +05:45
Francesco Carli
54f6da4cf4
Change space indention (#557)
* change space indention

* change space indention
2020-12-24 14:56:29 +01:00
Francesco Carli
24b2f2762f
readability code clean-up (#544) 2020-12-19 12:28:39 +01:00
Francesco Carli
3bd4635f04
Protection mechanism against duplicated MACs (#509)
* Prevent duplicated MACs

* Prevent duplicated MACs

* Fix compile errors

* Fix compile errors

* Implement auth scheme

* Fix compile errors

* Add auth_edge

* Add auth_edge

* Implement REGISTER_SUPER forwarding

* Add argument to update_edge

* Add auth field to supernode struct

* Add REGISTER_SUPER_NAK handling

* Fix issues

* Code clean-up

* Move auth token initialization
2020-11-19 09:31:24 +01:00
Luca Deri
176e17dedf Moved typedef to n2n_typedefs.h from n2n_wire.h 2020-11-13 10:56:18 +01:00
Logan oos Even
1574f1e1c6
added payload struct to carry supernode data (#501)
* added payload struct to carry supernode data

* added payload struct to carry supernode data

* added payload struct to carry supernode data

Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
2020-11-13 10:55:00 +01:00
lucaderi
72d5243650 Include rework to avoid circular dependencies, single place for typedefs and compilation on all platforms that don't like type redefinition 2020-11-13 09:28:52 +01:00
Francesco Carli
8915609f1a
Implement a load-based supernode selection strategy on edges (#493)
* Implement load-based selection strategy

* Update n2n_wire.h

* Update edge_utils.c

* Update n2n.c

* Update sn_utils.c

* Update edge_utils.c
2020-11-11 09:27:39 +01:00
Francesco Carli
e65fd984d7
Packet forwarding between supernodes (#486)
* Packet forwarding between supernodes

* Update wire.c
2020-11-10 16:34:49 +01:00
Francesco Carli
dcbc39c0fb
Update REGISTER_SUPER_ACK handling on edge (#478) 2020-10-27 17:02:35 +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
Francesco Carli
ed25ff8d01
Fixes minor issues introduced by #460 (#461) 2020-10-11 21:54:06 +02:00
Francesco Carli
c9eedd68f0
Initialize the federation of supernodes (#460)
* Add supernode2sock() and add_sn_to_federation_by_mac_or_sock()

* Update sn_utils.c

* Update sn.c and sn_utils.c

* Update REG_SUPER_ACK payload

* Update add_sn_to_federation_by_mac_or_sock()
2020-10-11 11:44:40 +02:00
francesco_carli
d9e2a0091a
Handle REGISTER_SUPER from other supernodes (#443)
* Handle REGISTER_SUPER from other supernodes

* Update wire.c
2020-09-29 10:50:09 +02:00
Logan007
671a00aba7 fixed sse version 2020-09-02 17:41:37 +05:45
Luca Deri
25620fcbc7 Compilation fixes 2020-08-28 13:00:45 +02:00
Luca Deri
9038e7dbe6
Merge pull request #380 from Logan007/revAes
changed aes transform to cipher text stealing mode
2020-08-28 12:56:17 +02:00
Logan007
6d05d48878 changed aes transform to cipher text stealing mode 2020-08-23 20:02:19 +05:45
fengdaolong
6bdfdf6be4 Enhanced edge management console function.
1. Edge can view the IP address and socket information of the connected tap adapter through the management console (127.0.0.1:5644);
2. Repair two memory leaks;
3. Fix several code errors and redundant logic;
2020-08-16 22:34:41 +08:00
Logan007
9c10116d51 split PACKET's transform field to give way for seperate compression field 2020-08-15 22:48:57 +05:45
fengdaolong
92dfa67e22 Added DHCP function embedded in sn.
1. Automatically assign IP addresses to the edge through the DHCP function that comes with sn, the default IP address pool is 172.17.12.0/24.
2. The -d parameter is added to sn, and the IP address pool of the embedded DHCP can be customized.
3. Now edge does not need to add -a and -s parameters to automatically obtain the IP address.
4. The IP automatically obtained by the cross-community edge can be the same, because the communities are isolated from each other and do not interfere with each other.
5. On the management side of sn (127.0.0.1:5645), you can now view the IP address of the tutap adapter of each edge.
6. Fix many bugs that have a certain chance of causing memory leaks.
7. Note: This version is not fully compatible with the previous version.
2020-08-08 22:40:45 +08:00
Luca Deri
3eb82b2a32 Code reorganization 2020-06-21 22:26:27 +02:00