-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
179 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2021 NetFoundry. All rights reserved. | ||
*/ | ||
|
||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
plugins { | ||
alias(libs.plugins.android.app) apply(false) | ||
alias(libs.plugins.android.lib) apply(false) | ||
alias(libs.plugins.kotlin.android) apply(false) | ||
} | ||
group = "org.openziti" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* | ||
* Copyright (c) 2024 NetFoundry. All rights reserved. | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
|
||
project( | ||
ziti-native-deps | ||
DESCRIPTION "OpenZiti tunneler SDK" | ||
HOMEPAGE_URL "https://github.com/openziti/ziti-tunneler-sdk-c" | ||
LANGUAGES C CXX | ||
) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <jni.h> | ||
#include <string> | ||
|
||
#include <tlsuv/tlsuv.h> | ||
#include <ziti/ziti.h> | ||
#include <ziti/ziti_tunnel.h> | ||
|
||
static jstring JNICALL tlsuvVersion(JNIEnv *env, jobject /* this */); | ||
static jstring JNICALL zitiSdkVersion(JNIEnv *env, jobject self); | ||
static jstring JNICALL zitiTunnelVersion(JNIEnv *env, jobject self); | ||
|
||
extern "C" | ||
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | ||
JNIEnv* env; | ||
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { | ||
return JNI_ERR; | ||
} | ||
|
||
// Find your class. JNI_OnLoad is called from the correct class loader context for this to work. | ||
jclass c = env->FindClass("org/openziti/tunnel/Tunnel"); | ||
if (c == nullptr) return JNI_ERR; | ||
|
||
// Register your class' native methods. | ||
static const JNINativeMethod methods[] = { | ||
{"tlsuvVersion", "()Ljava/lang/String;", reinterpret_cast<void*>(tlsuvVersion)}, | ||
{"zitiSdkVersion", "()Ljava/lang/String;", (void*)(zitiSdkVersion)}, | ||
{"zitiTunnelVersion", "()Ljava/lang/String;", (void*)(zitiTunnelVersion)}, | ||
}; | ||
int rc = env->RegisterNatives(c, methods, sizeof(methods)/sizeof(JNINativeMethod)); | ||
if (rc != JNI_OK) return rc; | ||
|
||
return JNI_VERSION_1_6; | ||
} | ||
|
||
jstring JNICALL tlsuvVersion(JNIEnv *env, jobject) { | ||
return env->NewStringUTF(tlsuv_version()); | ||
} | ||
|
||
jstring JNICALL zitiSdkVersion(JNIEnv *env, jobject) { | ||
return env->NewStringUTF(ziti_get_version()->version); | ||
} | ||
|
||
jstring JNICALL zitiTunnelVersion(JNIEnv *env, jobject) { | ||
return env->NewStringUTF(ziti_tunneler_version()); | ||
} | ||
|
||
|
6 changes: 4 additions & 2 deletions
6
...ain/java/org/openziti/tunnel/NativeLib.kt → ...c/main/java/org/openziti/tunnel/Tunnel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.