TVPN/src/main/java/tech/nevets/tvpn/wg/WireGuardJNI.java

30 lines
1008 B
Java

package tech.nevets.tvpn.wg;
public class WireGuardJNI {
// Load the native library
static {
System.loadLibrary("libwireguard_wrapper"); // This will load wireguard_wrapper.dll (or .so on Linux)
}
// Native method declaration
public native int installAdapter();
public native int removeAdapter();
public native int startTunnel(String tunnelName);
public native int stopTunnel(String tunnelName);
public native int createTunnel(String tunnelName);
public native int deleteTunnel(String tunnelName);
public native String getConfig(String tunnelName);
public native int updateConfig(String tunnelName, String newConfig);
public native int addConfig(String tunnelName, String config);
public native String getActiveTunnel();
public native boolean isActive();
public native int initializeWireGuard(String configFilePath);
public native void cleanup();
// Other methods for WireGuard interaction can be added here if needed
}