summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-04-20 18:27:15 -0700
committerGrant Limberg <glimberg@gmail.com>2015-04-20 18:27:15 -0700
commitec3a1c87d199a6896293735de36e6e1e4082fd1f (patch)
tree280245de1e60ca7b7bd1250ce485cc492c0a1069 /java/src
parentf40eb665c51c2577300aca981d9f6d9bb5294de7 (diff)
downloadinfinitytier-ec3a1c87d199a6896293735de36e6e1e4082fd1f.tar.gz
infinitytier-ec3a1c87d199a6896293735de36e6e1e4082fd1f.zip
first revision of the java API for ZeroTier One
Signed-off-by: Grant Limberg <glimberg@gmail.com>
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/zerotierone/sdk/DataStoreGetListener.java38
-rw-r--r--java/src/com/zerotierone/sdk/DataStorePutListener.java37
-rw-r--r--java/src/com/zerotierone/sdk/Event.java38
-rw-r--r--java/src/com/zerotierone/sdk/EventListener.java34
-rw-r--r--java/src/com/zerotierone/sdk/MulticastGroup.java33
-rw-r--r--java/src/com/zerotierone/sdk/Node.java103
-rw-r--r--java/src/com/zerotierone/sdk/NodeStatus.java51
-rw-r--r--java/src/com/zerotierone/sdk/PacketSender.java38
-rw-r--r--java/src/com/zerotierone/sdk/ResultCode.java45
-rw-r--r--java/src/com/zerotierone/sdk/Version.java35
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkConfig.java51
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkConfigListener.java38
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkConfigOperation.java34
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkFrameListener.java40
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkStatus.java36
-rw-r--r--java/src/com/zerotierone/sdk/VirtualNetworkType.java32
16 files changed, 683 insertions, 0 deletions
diff --git a/java/src/com/zerotierone/sdk/DataStoreGetListener.java b/java/src/com/zerotierone/sdk/DataStoreGetListener.java
new file mode 100644
index 00000000..60e1c3e8
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/DataStoreGetListener.java
@@ -0,0 +1,38 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+
+public interface DataStoreGetListener {
+ public int onDataStoreGet(Node node,
+ String name,
+ ByteBuffer buffer,
+ long bufferSize,
+ long index,
+ Long out_objectSize);
+}
diff --git a/java/src/com/zerotierone/sdk/DataStorePutListener.java b/java/src/com/zerotierone/sdk/DataStorePutListener.java
new file mode 100644
index 00000000..4e9404d9
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/DataStorePutListener.java
@@ -0,0 +1,37 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+
+public interface DataStorePutListener {
+ public int onDataStorePut(Node node,
+ String name,
+ ByteBuffer buffer,
+ long bufferSize,
+ boolean secure);
+}
diff --git a/java/src/com/zerotierone/sdk/Event.java b/java/src/com/zerotierone/sdk/Event.java
new file mode 100644
index 00000000..c5558676
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/Event.java
@@ -0,0 +1,38 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+public enum Event {
+ EVENT_UP,
+ EVENT_OFFLINE,
+ EVENT_DOWN,
+ EVENT_FATAL_ERROR_IDENTITY_COLLISION,
+ EVENT_AUTHENTICATION_FAILURE,
+ EVENT_INVALID_PACKET,
+ EVENT_TRACE
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/EventListener.java b/java/src/com/zerotierone/sdk/EventListener.java
new file mode 100644
index 00000000..9e3e4d24
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/EventListener.java
@@ -0,0 +1,34 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+
+public interface EventListener {
+ public void onEvent(Node node,Event event, ByteBuffer buffer);
+}
diff --git a/java/src/com/zerotierone/sdk/MulticastGroup.java b/java/src/com/zerotierone/sdk/MulticastGroup.java
new file mode 100644
index 00000000..c1318d86
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/MulticastGroup.java
@@ -0,0 +1,33 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+
+public class MulticastGroup {
+ private long mac;
+ private long adi;
+}
diff --git a/java/src/com/zerotierone/sdk/Node.java b/java/src/com/zerotierone/sdk/Node.java
new file mode 100644
index 00000000..e3786162
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/Node.java
@@ -0,0 +1,103 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+import java.lang.Long;
+
+public class Node {
+ static {
+ System.loadLibrary("ZeroTierOneJNI");
+ }
+
+ private final DataStoreGetListener getListener;
+ private final DataStorePutListener putListener;
+ private final PacketSender sender;
+ private final VirtualNetworkFrameListener frameListener;
+ private final VirtualNetworkConfigListener configListener;
+
+ public Node(long now,
+ DataStoreGetListener getListener,
+ DataStorePutListener putListener,
+ PacketSender sender,
+ VirtualNetworkFrameListener frameListener,
+ VirtualNetworkConfigListener configListener)
+ {
+ this.getListener = getListener;
+ this.putListener = putListener;
+ this.sender = sender;
+ this.frameListener = frameListener;
+ this.configListener = configListener;
+ }
+
+ public native ResultCode processVirtualNetworkFrame(
+ long now,
+ long nwid,
+ long sourceMac,
+ long destMac,
+ int etherTYpe,
+ int vlanId,
+ ByteBuffer frameData,
+ int frameLength,
+ Long nextBackgroundTaskDeadline);
+
+ public native ResultCode processBackgroundTasks(
+ long now,
+ Long nextBackgroundTaskDeadline);
+
+ public native ResultCode join(long nwid);
+
+ public native ResultCode leave(long nwid);
+
+ public native ResultCode multicastSubscribe(
+ long nwid,
+ long multicastGroup,
+ long multicastAdi);
+
+ public ResultCode multicastSubscribe(
+ long nwid,
+ long multicastGroup) {
+ return multicastSubscribe(nwid, multicastGroup, 0);
+ }
+
+ public native ResultCode multicastUnsubscribe(
+ long nwid,
+ long multicastGroup,
+ long multicastAdi);
+
+ public ResultCode multicastUnsubscribe(
+ long nwid,
+ long multicastGroup) {
+ return multicastUnsubscribe(nwid, multicastGroup, 0);
+ }
+
+ public native long address();
+
+
+
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/NodeStatus.java b/java/src/com/zerotierone/sdk/NodeStatus.java
new file mode 100644
index 00000000..4f584bcb
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/NodeStatus.java
@@ -0,0 +1,51 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+public class NodeStatus {
+ private long address;
+ private String publicIdentity;
+ private String secretIdentity;
+ private int online;
+
+ public long getAddres() {
+ return address;
+ }
+
+ public String getPublicIdentity() {
+ return publicIdentity;
+ }
+
+ public String getSecretIdentity() {
+ return secretIdentity;
+ }
+
+ public boolean isOnline() {
+ return online != 0;
+ }
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/PacketSender.java b/java/src/com/zerotierone/sdk/PacketSender.java
new file mode 100644
index 00000000..0e007ffb
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/PacketSender.java
@@ -0,0 +1,38 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+
+
+public interface PacketSender {
+ public int onSendPacketRequested(Node node,
+ String addr,
+ int linkDesc,
+ ByteBuffer packetData,
+ long dataLength);
+}
diff --git a/java/src/com/zerotierone/sdk/ResultCode.java b/java/src/com/zerotierone/sdk/ResultCode.java
new file mode 100644
index 00000000..7597c0f2
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/ResultCode.java
@@ -0,0 +1,45 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+public enum ResultCode {
+
+ RESULT_OK(0),
+ RESULT_FATAL_ERROR_OUT_OF_MEMORY(1),
+ RESULT_FATAL_ERROR_DATA_STORE_FAILED(2),
+ RESULT_FATAL_ERROR_INTERNAL(3),
+ RESULT_ERROR_NETWORK_NOT_FOUND(1000);
+
+ private final int id;
+ ResultCode(int id) { this.id = id; }
+ public int getValue() { return id; }
+
+ public boolean isFatal(int id) {
+ return (id > 0 && id < 1000);
+ }
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/Version.java b/java/src/com/zerotierone/sdk/Version.java
new file mode 100644
index 00000000..b260c9de
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/Version.java
@@ -0,0 +1,35 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+public class Version {
+ public int major;
+ public int minor;
+ public int revision;
+ public long featureFlags;
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java b/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java
new file mode 100644
index 00000000..3717b334
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java
@@ -0,0 +1,51 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+package com.zerotierone.sdk;
+
+import java.lang.String;
+import java.util.ArrayList;
+
+public class VirtualNetworkConfig {
+ public static final int MAX_MULTICAST_SUBSCRIPTIONS = 4096;
+ private long nwid;
+ private long mac;
+ private String name;
+ private VirtualNetworkStatus status;
+ private VirtualNetworkType type;
+ private int mtu;
+ private int dhcp;
+ private int bridge;
+ private int broadcastEnabled;
+ private int portError;
+ private boolean enabled;
+ private long netconfRevision;
+ private int multicastSubscriptionCount;
+ private ArrayList<MulticastGroup> multicastSubscriptions;
+
+ // TODO: sockaddr_storage
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkConfigListener.java b/java/src/com/zerotierone/sdk/VirtualNetworkConfigListener.java
new file mode 100644
index 00000000..78d11987
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkConfigListener.java
@@ -0,0 +1,38 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+
+
+package com.zerotierone.sdk;
+
+
+public interface VirtualNetworkConfigListener {
+ public void onNetworkConfigurationUpdated(
+ Node node,
+ long someValue,
+ VirtualNetworkConfigOperation op,
+ VirtualNetworkConfig config);
+} \ No newline at end of file
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkConfigOperation.java b/java/src/com/zerotierone/sdk/VirtualNetworkConfigOperation.java
new file mode 100644
index 00000000..2bf6ce09
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkConfigOperation.java
@@ -0,0 +1,34 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+public enum VirtualNetworkConfigOperation {
+ VIRTUAL_NETWORK_CONFIG_OPERATION_UP,
+ VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE,
+ VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN,
+ VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY
+}
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkFrameListener.java b/java/src/com/zerotierone/sdk/VirtualNetworkFrameListener.java
new file mode 100644
index 00000000..fed5d95c
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkFrameListener.java
@@ -0,0 +1,40 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+import java.nio.ByteBuffer;
+
+public interface VirtualNetworkFrameListener {
+ void onVirtualNetworkFrame(Node node,
+ long nwid,
+ long srcMac,
+ long destMac,
+ long etherType,
+ long vlanId,
+ ByteBuffer frameData,
+ long len);
+}
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkStatus.java b/java/src/com/zerotierone/sdk/VirtualNetworkStatus.java
new file mode 100644
index 00000000..1102d2ea
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkStatus.java
@@ -0,0 +1,36 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+public enum VirtualNetworkStatus {
+ NETWORK_STATUS_REQUESTING_CONFIGURATION,
+ NETWORK_STATUS_OK,
+ NETWORK_STATUS_ACCESS_DENIED,
+ NETWORK_STATUS_NOT_FOUND,
+ NETWORK_STATUS_PORT_ERROR,
+ NETWORK_STATUS_CLIENT_TOO_OLD
+}
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkType.java b/java/src/com/zerotierone/sdk/VirtualNetworkType.java
new file mode 100644
index 00000000..b4a8ce2f
--- /dev/null
+++ b/java/src/com/zerotierone/sdk/VirtualNetworkType.java
@@ -0,0 +1,32 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2015 ZeroTier, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * ZeroTier may be used and distributed under the terms of the GPLv3, which
+ * are available at: http://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * If you would like to embed ZeroTier into a commercial application or
+ * redistribute it in a modified binary form, please contact ZeroTier Networks
+ * LLC. Start here: http://www.zerotier.com/
+ */
+package com.zerotierone.sdk;
+
+public enum VirtualNetworkType {
+ NETWORK_TYPE_PRIVATE,
+ NETWORK_TYPE_PUBLIC
+}