Commit Graph

145 Commits

Author SHA1 Message Date
Brenton Bostick
e32fecd16d Thread might actually be detached, so need to handle that 2024-05-21 13:12:22 -04:00
Brenton Bostick
dca77cb0d2 expand GETENV macro that needs to be modified 2024-05-21 13:12:22 -04:00
Brenton Bostick
12cdf39165 actual fix for ANDROID-56: crash inside newNetworkConfig
cast all arguments to varargs functions as good style
2023-03-09 06:51:29 -05:00
Brenton Bostick
19c5343a0a Revert "temp fix for ANDROID-56: crash inside newNetworkConfig from too many args"
This reverts commit dd627cd7f4.
2023-03-09 06:51:29 -05:00
Adam Ierymenko
1c5897895b
1.10.4 merge into main (#1893)
* add note about forceTcpRelay

* Create a sample systemd unit for tcp proxy

* set gitattributes for rust & cargo so hashes dont conflict on Windows

* Revert "set gitattributes for rust & cargo so hashes dont conflict on Windows"

This reverts commit 032dc5c108.

* Turn off autocrlf for rust source

Doesn't appear to play nice well when it comes to git and vendored cargo package hashes

* Fix #1883 (#1886)

Still unknown as to why, but the call to `nc->GetProperties()` can fail
when setting a friendly name on the Windows virtual ethernet adapter.
Ensure that `ncp` is not null before continuing and accessing the device
GUID.

* Don't vendor packages for zeroidc (#1885)

* Added docker environment way to join networks (#1871)

* add StringUtils

* fix headers
use recommended headers and remove unused headers

* move extern "C"
only JNI functions need to be exported

* cleanup

* fix ANDROID-50: RESULT_ERROR_BAD_PARAMETER typo

* fix typo in log message

* fix typos in JNI method signatures

* fix typo

* fix ANDROID-51: fieldName is uninitialized

* fix ANDROID-35: memory leak

* fix missing DeleteLocalRef in loops

* update to use unique error codes

* add GETENV macro

* add LOG_TAG defines

* ANDROID-48: add ZT_jnicache.cpp

* ANDROID-48: use ZT_jnicache.cpp and remove ZT_jnilookup.cpp and ZT_jniarray.cpp

* add Event.fromInt

* add PeerRole.fromInt

* add ResultCode.fromInt

* fix ANDROID-36: issues with ResultCode

* add VirtualNetworkConfigOperation.fromInt

* fix ANDROID-40: VirtualNetworkConfigOperation out-of-sync with ZT_VirtualNetworkConfigOperation enum

* add VirtualNetworkStatus.fromInt

* fix ANDROID-37: VirtualNetworkStatus out-of-sync with ZT_VirtualNetworkStatus enum

* add VirtualNetworkType.fromInt

* make NodeStatus a plain data class

* fix ANDROID-52: synchronization bug with nodeMap

* Node init work: separate Node construction and init

* add Node.toString

* make PeerPhysicalPath a plain data class

* remove unused PeerPhysicalPath.fixed

* add array functions

* make Peer a plain data class

* make Version a plain data class

* fix ANDROID-42: copy/paste error

* fix ANDROID-49: VirtualNetworkConfig.equals is wrong

* reimplement VirtualNetworkConfig.equals

* reimplement VirtualNetworkConfig.compareTo

* add VirtualNetworkConfig.hashCode

* make VirtualNetworkConfig a plain data class

* remove unused VirtualNetworkConfig.enabled

* reimplement VirtualNetworkDNS.equals

* add VirtualNetworkDNS.hashCode

* make VirtualNetworkDNS a plain data class

* reimplement VirtualNetworkRoute.equals

* reimplement VirtualNetworkRoute.compareTo

* reimplement VirtualNetworkRoute.toString

* add VirtualNetworkRoute.hashCode

* make VirtualNetworkRoute a plain data class

* add isSocketAddressEmpty

* add addressPort

* add fromSocketAddressObject

* invert logic in a couple of places and return early

* newInetAddress and newInetSocketAddress work
allow newInetSocketAddress to return NULL if given empty address

* fix ANDROID-38: stack corruption in onSendPacketRequested

* use GETENV macro

* JniRef work
JniRef does not use callbacks struct, so remove
fix NewGlobalRef / DeleteGlobalRef mismatch

* use PRId64 macros

* switch statement work

* comments and logging

* Modifier 'public' is redundant for interface members

* NodeException can be made a checked Exception

* 'NodeException' does not define a 'serialVersionUID' field

* 'finalize()' should not be overridden
this is fine to do because ZeroTierOneService calls close() when it is done

* error handling, error reporting, asserts, logging

* simplify loadLibrary

* rename Node.networks -> Node.networkConfigs

* Windows file permissions fix (#1887)

* Allow macOS interfaces to use multiple IP addresses (#1879)

Co-authored-by: Sean OMeara <someara@users.noreply.github.com>
Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>

* Fix condition where full HELLOs might not be sent when necessary (#1877)

Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>

* 1.10.4 version bumps

* Add security policy to repo (#1889)

* [+] add e2k64 arch (#1890)

* temp fix for ANDROID-56: crash inside newNetworkConfig from too many args

* 1.10.4 release notes

---------

Co-authored-by: travis laduke <travisladuke@gmail.com>
Co-authored-by: Grant Limberg <grant.limberg@zerotier.com>
Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>
Co-authored-by: Leonardo Amaral <leleobhz@users.noreply.github.com>
Co-authored-by: Brenton Bostick <bostick@gmail.com>
Co-authored-by: Sean OMeara <someara@users.noreply.github.com>
Co-authored-by: Joseph Henry <joseph-henry@users.noreply.github.com>
Co-authored-by: Roman Peshkichev <roman.peshkichev@gmail.com>
2023-03-07 16:50:34 -05:00
Brenton Bostick
d31f238be0
fix typos (#1843) 2023-01-11 19:42:30 +01:00
Brenton Bostick
77c7f9133f Migrate from ndk-build to CMake 2022-12-05 10:34:12 -05:00
Brenton Bostick
475281935e Remove unused flags for arm64-v8a
Through using ndk-build, -Wno-unused-command-line-argument is passed in
somewhere in the pipeline and hides this warning.

The warning can be turned on with:
APP_CPPFLAGS := -Wunused-command-line-argument ...

and then when building, you can see:
C/C++: clang++: warning: argument unused during compilation: '-mfloat-abi=softfp' [-Wunused-command-line-argument]
C/C++: clang++: warning: argument unused during compilation: '-mfpu=neon' [-Wunused-command-line-argument]
C/C++: clang++: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]

These are unused because both floating-point and NEON are required in
all standard ARMv8 implementations. [1] [2]

[1] https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON

[2] https://stackoverflow.com/a/29891469
2022-12-05 10:34:12 -05:00
Brenton Bostick
cdf248b1e2 Fix build problem related to unified headers
Since NDKr15 (released 2017), unified headers are used by default [1]

Remove -isystem option that was passing bad values to command-line.

The actual value being passed to command-line was:
```
-isystem DK/sysroot/usr/include/RIPLE
```

because of using $NDK and $TRIPLE instead of $(NDK) and $(TRIPLE)

But regardless, $NDK and $TRIPLE were never actually defined values and were just
place-holders mentioned in [1]

[1] https://android.googlesource.com/platform/ndk/+/ndk-release-r16/docs/UnifiedHeaders.md
2022-12-05 10:34:12 -05:00
Brenton Bostick
9ac2cfe611 Fix warning: suggest braces around initialization of subobject 2022-12-01 08:35:31 -05:00
Brenton Bostick
f74a594e98 fix typos in comments and strings 2022-11-28 09:23:45 -05:00
Grant Limberg
b41e0910b0
Fun times in ~~cleveland~~ NDK-land 2022-11-09 11:11:10 -08:00
Grant Limberg
a8dde7b89b
update JNI to add new status code 2022-03-04 14:28:25 -08:00
Grant Limberg
7a626abf15
remove BondController.cpp from android makefile 2021-10-28 12:37:36 -07:00
Grant Limberg
3da8f5f053
freaking JNI 2020-10-21 16:08:19 -07:00
Grant Limberg
2851a9577c
JNI for dns configuration 2020-10-21 14:18:29 -07:00
Adam Ierymenko
24769219b5 Merge branch 'dev' 2020-10-08 18:08:24 -04:00
Grant Limberg
7d8cfb1fee
more magic incantations to make crypto extensions work on Android/ARM64 2020-09-22 10:28:31 -07:00
Grant Limberg
8131680735
AES-NI enabled for Android ARM64 2020-09-22 08:04:16 -07:00
Grant Limberg
9e6dba9066
Enable AES-NI on Android X86-64
Need to find the magic incantation to enable it on ARM64 still
2020-09-21 18:05:25 -07:00
Grant Limberg
844725237d
Add new ZT_ result codes that were added 2020-05-18 10:31:17 -07:00
Grant Limberg
87c75d033e pt 2 2019-04-22 11:36:14 -07:00
Grant Limberg
71ae678930 Make things compile with Android NDK again 2019-04-22 11:35:35 -07:00
Grant Limberg
8828fc7520 some JNI error checking 2018-02-12 09:29:44 -08:00
Grant Limberg
f049740ae5 silence LOGV and LOGD in release builds for android 2018-02-07 15:53:23 -08:00
Grant Limberg
3d4a1b575e Update Android NDK with uint64_t -> int64_t changes 2017-10-03 11:25:26 -07:00
Grant Limberg
bcf697cc2b Wire up PortMapper in Android
Enables UPnP port mapping for Android client on networks with UPnP routers
2017-07-17 16:16:25 -07:00
Grant Limberg
69ae35494e put the correct file extensions on data written to disk in JNI 2017-07-12 13:36:22 -07:00
Grant Limberg
512c3af4ea fix packet sending functions 2017-07-12 13:12:45 -07:00
Grant Limberg
d8f1c3dff7 Update JNI code to reflect new ZeroTier API 2017-07-12 11:34:53 -07:00
Grant Limberg
952834f7f3 Let Android Studio determine debug/release build 2017-05-23 14:56:29 -07:00
Grant Limberg
5f611dad51 added orbit/deorbit methods to java Node implementation 2017-03-29 13:29:02 -07:00
Grant Limberg
1c5fdb8a0a fix path checker initialization 2017-03-29 13:28:06 -07:00
Grant Limberg
de4b9e9a16 Added path checking interface for Java 2017-03-29 12:52:52 -07:00
Grant Limberg
855361b5b8 fix native end of JNI code for new thread data ptr 2017-03-28 17:49:00 -07:00
Grant Limberg
1520534660 fix some rediculousness in NDK-14
Apparently having -fPIC on the command line multiple times turns it back off
2017-03-09 17:48:40 -08:00
Grant Limberg
06c866ceb4 Android JNI fix 2017-02-23 12:47:07 -08:00
Grant Limberg
9ae49b5b85 Update JNI with new root terminology 2017-02-13 10:51:36 -08:00
Grant Limberg
923d3f1fe8 remove references to deleted source files in Android NDK build files 2017-01-26 15:01:45 -08:00
Grant Limberg
f149dd9401 fix Android NDK build 2017-01-13 11:36:48 -08:00
Grant Limberg
3c5e28a27d use new ZT_Node_Callbacks struct in JNI 2016-11-22 13:03:36 -08:00
Grant Limberg
e1c930f1b7 update JNI wrapper to reflect removal of lastMulticastFrame and lastUnicastFrame from ZT_Peer struct 2016-11-09 16:33:01 -08:00
Grant Limberg
3a3fe272bb add Revocation.cpp to android build 2016-10-13 15:18:07 -07:00
Grant Limberg
8809c6d122 link atomic library. seems to be required in the latest Android NDK 2016-10-13 14:34:54 -07:00
Grant Limberg
40d3993ceb java code still needed to reflect PEER_ROLE_RELAY rename to PEER_ROLE_UPSTREAM 2016-09-21 14:12:20 -07:00
Grant Limberg
0564bb3b35 added missing copyright/license info from ZT_jniutils 2016-09-21 14:09:46 -07:00
Grant Limberg
d87f0293e3 Don't print a few error messages when they don't matter. 2016-09-19 13:40:53 -07:00
Grant Limberg
5fadd8bdd2 ZT_PEER_ROLE_RELAY -> ZT_PEER_ROLE_UPSTREAM in JNI glue 2016-09-19 12:54:19 -07:00
Grant Limberg
dccca7df1a another couple of missing semicolons 2016-09-08 17:45:40 -07:00
Grant Limberg
407ad659ea Reflect changes to strut ZT_PeerPhysicalPath 2016-09-06 17:59:01 -07:00