Commit Graph

85 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
be0af135bc update JNI code for 1.1.6 2016-07-07 20:07:07 -07:00
Grant Limberg
3993dfa2a5 Fix JNI for API changes in 1.1.4 2016-01-22 18:06:58 -08:00
Grant Limberg
0508a41afd added ttl parameter to WirePacketSendFunction 2015-11-14 17:40:17 -08:00
Grant Limberg
eadeac0a42 logging of events 2015-11-03 19:14:11 -08:00
Grant Limberg
b7df177f33 updates for origin/edge 2015-11-02 19:18:55 -08:00
Grant Limberg
75a191a856 don't create an InetSocketAddress on local address if it's equal to ZT_SOCKADDR_NULL 2015-09-26 14:10:45 -07:00
Grant Limberg
7c3be2b5c1 fix function signature in lookup for onSendPacketRequested function 2015-09-26 14:10:16 -07:00
Grant Limberg
e8cdff3eaf Merge branch 'adamierymenko-dev' into android-jni-dev
also update for changed function calls that now accept a local address

# Conflicts:
#	include/ZeroTierOne.h
#	java/CMakeLists.txt
#	java/jni/Android.mk
#	java/jni/ZT1_jnicache.cpp
#	java/jni/ZT1_jnilookup.h
#	java/jni/ZT1_jniutils.cpp
#	java/jni/com_zerotierone_sdk_Node.cpp
2015-09-26 13:47:55 -07:00
Adam Ierymenko
f69454ec98 (1) Make ZT_ naming convention consistent (get rid of ZT1_), (2) Make local interface a full sockaddr_storage instead of an int identifier, which turns out to be better for multi-homing and other uses. 2015-09-24 16:21:36 -07:00
Grant Limberg
0b7cd2f40a change some build settings. add a lock 2015-07-01 20:26:14 -07:00
Grant Limberg
f803dd5ff4 ... 2015-07-01 18:13:39 -07:00
Grant Limberg
aee8e95d49 logging 2015-06-30 19:21:46 -07:00
Grant Limberg
472206dfb2 Rename JniCache to JniLookup
Removed caching capabilities as the cached methods, fields, and objects appears to be broken on Android
2015-06-10 20:16:13 -07:00
Grant Limberg
7e84f5a7db killing whitespace 2015-06-09 23:24:54 -07:00
Grant Limberg
4dc0ff8f13 Replace calls to Get<Type>ArrayElements with GetPrimitiveArrayCritical.
This puts code accessing the data in a critical section so that the GC cannot run while JNI has access to the array.  This helps with stability somewhat, but I'm still getting some crashes in the GC
2015-06-09 23:12:44 -07:00
Grant Limberg
ced040c503 Logging and adding .equals() methods to MulticastGroup and VirtualNetworkCofnig 2015-06-09 19:38:05 -07:00
Grant Limberg
b84dba3ecb more logging 2015-06-03 21:29:07 -07:00
Grant Limberg
fb0bf52b1b Fixed sending a port number of 0 to ZT1.
Fixed VirtualNetworkConfigFunction (creating array to send to Java)
Fixed the creating InetAddress instead of InetSocketAddress in virtual network config callback
2015-06-01 20:03:28 -07:00
Grant Limberg
5015c0ae78 more logging 2015-05-28 21:03:37 -07:00
Grant Limberg
b6196a53de Fix DataStoreGetFunction. 2015-05-28 20:37:16 -07:00
Grant Limberg
58ca657da6 Use object arrays rather than ArrayList. JNI side 2015-05-28 20:36:54 -07:00
Grant Limberg
4c680e3126 LOTS more error checking and logging.
Running into a wall attempting to add items to an ArrayList from the JNI side
2015-05-27 20:42:54 -07:00
Grant Limberg
09631ad382 fix datastore get call in JNI
Just delete the local reference rather than do an array delete.  Array delete was causing a crash on loading network config files.  Deleting the local ref works fine, though, as it still lets the JVM garbage collecter know that the native code is done with the array
2015-05-26 21:32:56 -07:00
Grant Limberg
2d67196667 added the android verbose log level and moved most jni debug messages to verbose 2015-05-26 21:31:34 -07:00
Grant Limberg
9755dad7ff add a missing break from a switch 2015-05-26 21:30:33 -07:00
Grant Limberg
1e043a3f66 Remove link desperation from java API 2015-05-21 19:34:19 -07:00
Grant Limberg
742c59a7c7 Refactor package name from com.zerotierone.sdk to com.zerotier.sdk 2015-05-02 16:54:00 -07:00
Grant Limberg
818339f966 replace old direct calls to FindClass, GetMethodID, etc with calls that use the cache 2015-05-02 12:05:40 -07:00
Grant Limberg
079d248eab added a JniCache objectet for caching jclass, jmethodID, and jfieldID objects 2015-05-02 12:05:02 -07:00
Grant Limberg
9464504e4a DataStoreGet and Put and EventListener appear to work 2015-04-29 21:20:50 -07:00
Grant Limberg
7e0cc28a89 Fixes for bugs pointed out by updating warnings 2015-04-29 19:29:35 -07:00
Grant Limberg
5983b4367b jclass pointers aren't as cacheable as originally thought.
There is a way to do it.  We can try it later if we determine it's needed for performance reasons.  Otherwise, don't use static to cache them
2015-04-27 18:38:13 -07:00