When building on win32 systems, simply add the win32 specific functions
to the libn2n.a, which simplifies the commands needed.
By moving the win32 source code into the src directory, the source code
is better consolidated.
As suggested in a PR from @Legend-Master (this change is basically
unrelated to the main point of his PR, so extracted here)
Windows is a confusing and disappointing development environment. They
completely replaced all the definitions in winsock.h with exact
equivalents in winsock2.h (except for a small number of deprecated
functions).
However they didnt make them mutually exclusive - so if you include
both, you get errors. They also automatically include winsock.h from
windows.h, so you must remember to include winsock2.h first. They also
didnt just remove winsock.h and replace it with the new contents.
(Probably in the name of "compatibility", whilst swearing that the new
winsock is the same as the old one - because if you cannot believe two
inconsistent things simultaneously, you shouldnt be a windows
programmer)
All these things are totally nuts. Thanks, windows dev environment,
for not noticing that this is nuts
There is still cleanup work to be done in the headers, but this
concludes the major include-what-you-use refactoring. No functional
change is intended or expected and all tests are passing.
It is now a lot easier to see what is used from each header and work on
possible refactoring in the future.
The include-what-you-use tool is awkward to use with the current state
of the build system - and will always be difficult to use in a
multi-platform safe way. However, I hope to provide a non manual
process for running with the tool in the future.
* support linux l2 bridge
* unified timeout name
* typo
* minor code style adaptions
* feature define
* feature define
* feature define
* feature define
* added hint to bridging to help output
* added hint to bridging
* drafted bridging documentation
* added bridging hint
---------
Co-authored-by: Logan oos Even <46396513+Logan007@users.noreply.github.com>
It looks like the github windows build environment is not correctly
inheriting environment variables. Which is strange, as that has not
been changed with the recent updates. Include the vars directly as a
workaround (and plan to refactor later)
It is difficult to maintain one build system, let alone two - especially
if one build system is known to be better maintained and the other build
system continues to be used - with bug and feature requests raised
against it.
The maintainers are aware that there are people using the CMake system,
but believe that the extra maintainability of only having one build
system, combined with the knowledge that the current CI system
demonstrates that all supported architectures are working with the
Makefiles make the use of these Makefiles a more sustainable direction.
* added Windows support to n2n-route tool
* fixed includes
* more include fixes
* one more include addition
* more compile fixes
* wish I had a working Windows VM
* fixed some more Windows compile errors
* considered Windows-specific lib linkage
* promised to never code OS specific tools again
* removed invisible invalid characters
* where to get if_idx from
* retrieving interface index for route
* bracket...
* one more bracket...
* added optional gateway parameter to user-defined routes
* clarification
* clarification
* Windows needs special network init
* adapted waiting-for-key
* 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
* 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
* Refactor traceEvent to allow variable log levels
* Refactor sendto failed for less repetition
* Refactor sendto_fd to make control flow clearer, also reduce repetition
* Tie size to the actual object not its class
* Show destination that had issues when sendto_fd fails
* Fix MSVC compile - it doesnt support the same variadic macros as gcc
* 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