diff options
author | Grant Limberg <glimberg@gmail.com> | 2015-04-23 20:17:29 -0700 |
---|---|---|
committer | Grant Limberg <glimberg@gmail.com> | 2015-04-23 20:17:29 -0700 |
commit | 407e2fc7deb693d37d89adc9292b0bf70c50e85a (patch) | |
tree | 2ca1efafb7a68883b96cada5baa6d77441757166 /java/src | |
parent | 667a103a6a748498b2bb9eb772459d37fdc38308 (diff) | |
download | infinitytier-407e2fc7deb693d37d89adc9292b0bf70c50e85a.tar.gz infinitytier-407e2fc7deb693d37d89adc9292b0bf70c50e85a.zip |
Added ant build script. Requires NDK_BUILD_LOC environment variable pointing to the ndk-build script
fixed compile erros in Node and VirutalNetworkConfig
Signed-off-by: Grant Limberg <glimberg@gmail.com>
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/zerotierone/sdk/Node.java | 16 | ||||
-rw-r--r-- | java/src/com/zerotierone/sdk/VirtualNetworkConfig.java | 71 |
2 files changed, 73 insertions, 14 deletions
diff --git a/java/src/com/zerotierone/sdk/Node.java b/java/src/com/zerotierone/sdk/Node.java index 8225e0f0..bb8bbeee 100644 --- a/java/src/com/zerotierone/sdk/Node.java +++ b/java/src/com/zerotierone/sdk/Node.java @@ -44,7 +44,7 @@ public class Node { * * -1 if the node has already been closed */ - private final long nodeId; + private long nodeId; private final DataStoreGetListener getListener; private final DataStorePutListener putListener; @@ -68,7 +68,7 @@ public class Node { this.configListener = configListener; ResultCode rc = node_init(now); - if(rc.getValue() != ResultCode.RESULT_OK) + if(rc != ResultCode.RESULT_OK) { // TODO: Throw Exception } @@ -97,7 +97,7 @@ public class Node { long[] nextBackgroundTaskDeadline) { return processVirtualNetworkFrame( nodeId, now, nwid, sourceMac, destMac, etherType, vlanId, - frameData, frameLength, nextBackgroundTaskDeadline); + frameData, nextBackgroundTaskDeadline); } public ResultCode processWirePacket( @@ -111,7 +111,7 @@ public class Node { nextBackgroundTaskDeadline); } - public ResultCode processBackgroundTasks(long now, long nextBackgroundTaskDeadline) { + public ResultCode processBackgroundTasks(long now, long[] nextBackgroundTaskDeadline) { return processBackgroundTasks(nodeId, now, nextBackgroundTaskDeadline); } @@ -159,14 +159,14 @@ public class Node { // TODO: ZT1_Node_peers - public VirtualNetworkConfig networkConfig() { - return networkConfig(nodeId); + public VirtualNetworkConfig networkConfig(long nwid) { + return networkConfig(nodeId, nwid); } // TODO: ZT1_Node_networks - public Version version() { - return version(nodeId); + public Version getVersion() { + return version(); } /** diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java b/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java index db52b4cd..8085994b 100644 --- a/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java +++ b/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java @@ -29,7 +29,7 @@ package com.zerotierone.sdk; import java.lang.String; import java.util.ArrayList; -import java.net.InetAddresss; +import java.net.InetAddress; public class VirtualNetworkConfig { public static final int MAX_MULTICAST_SUBSCRIPTIONS = 4096; @@ -41,13 +41,72 @@ public class VirtualNetworkConfig { private VirtualNetworkStatus status; private VirtualNetworkType type; private int mtu; - private int dhcp; - private int bridge; - private int broadcastEnabled; - private int portError; + private boolean dhcp; + private boolean bridge; + private boolean broadcastEnabled; + private boolean portError; private boolean enabled; private long netconfRevision; private int multicastSubscriptionCount; private ArrayList<MulticastGroup> multicastSubscriptions; private ArrayList<InetAddress> assignedAddresses; -}
\ No newline at end of file + + private VirtualNetworkConfig() { + + } + + public final long networkId() { + return nwid; + } + public final long macAddress() { + return mac; + } + + public final String name() { + return name; + } + + public final VirtualNetworkStatus networkStatus() { + return status; + } + + public final VirtualNetworkType networkType() { + return type; + } + + public final int mtu() { + return mtu; + } + + public final boolean isDhcpAvailable() { + return dhcp; + } + + public final boolean isBridgeEnabled() { + return bridge; + } + + public final boolean broadcastEnabled() { + return broadcastEnabled; + } + + public final boolean portError() { + return portError; + } + + public final boolean isEnabled() { + return enabled; + } + + public final long netconfRevision() { + return netconfRevision; + } + + public final ArrayList<MulticastGroup> multicastSubscriptions() { + return multicastSubscriptions; + } + + public final ArrayList<InetAddress> assignedAddresses() { + return assignedAddresses; + } +} |