From d1ed2695378d62145c0820a3d9125526874a8809 Mon Sep 17 00:00:00 2001
From: Grant Limberg
Date: Mon, 27 Apr 2015 17:48:37 -0700
Subject: Switch to InetSockAddress instead of InetAddress so we can send the
port # to java as well
---
java/src/com/zerotierone/sdk/Event.java | 4 ++--
java/src/com/zerotierone/sdk/EventListener.java | 6 +++---
java/src/com/zerotierone/sdk/Node.java | 6 +++---
java/src/com/zerotierone/sdk/PacketSender.java | 6 +++---
java/src/com/zerotierone/sdk/PeerPhysicalPath.java | 6 +++---
java/src/com/zerotierone/sdk/VirtualNetworkConfig.java | 8 ++++----
6 files changed, 18 insertions(+), 18 deletions(-)
(limited to 'java/src')
diff --git a/java/src/com/zerotierone/sdk/Event.java b/java/src/com/zerotierone/sdk/Event.java
index 382fbf48..851080af 100644
--- a/java/src/com/zerotierone/sdk/Event.java
+++ b/java/src/com/zerotierone/sdk/Event.java
@@ -94,14 +94,14 @@ public enum Event {
/**
* A packet failed authentication
*
- * Meta-data: {@link InetAddress} containing origin address of packet
+ * Meta-data: {@link InetSocketAddress} containing origin address of packet
*/
EVENT_AUTHENTICATION_FAILURE,
/**
* A received packet was not valid
*
- * Meta-data: {@link InetAddress} containing origin address of packet
+ * Meta-data: {@link InetSocketAddress} containing origin address of packet
*/
EVENT_INVALID_PACKET,
diff --git a/java/src/com/zerotierone/sdk/EventListener.java b/java/src/com/zerotierone/sdk/EventListener.java
index dedd271a..84b82615 100644
--- a/java/src/com/zerotierone/sdk/EventListener.java
+++ b/java/src/com/zerotierone/sdk/EventListener.java
@@ -27,7 +27,7 @@
package com.zerotierone.sdk;
-import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.lang.String;
/**
@@ -45,9 +45,9 @@ public interface EventListener {
* Callback for network error events: {@link Event.EVENT_AUTHENTICATION_FAILUER}, {link Event.EVENT_INVALID_PACKET}
*
* @param event {@link Event} enum
- * @param source {@link InetAddress} containing the origin address of the packet
+ * @param source {@link InetSocketAddress} containing the origin address of the packet
*/
- public void onNetworkError(Event event, InetAddress source);
+ public void onNetworkError(Event event, InetSocketAddress source);
/**
* Callback when the node detects that it's out of date.
diff --git a/java/src/com/zerotierone/sdk/Node.java b/java/src/com/zerotierone/sdk/Node.java
index 12aecac4..911e83d3 100644
--- a/java/src/com/zerotierone/sdk/Node.java
+++ b/java/src/com/zerotierone/sdk/Node.java
@@ -29,7 +29,7 @@ package com.zerotierone.sdk;
import java.nio.ByteBuffer;
import java.lang.Long;
-import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.ArrayList;
/**
@@ -152,7 +152,7 @@ public class Node {
*/
public ResultCode processWirePacket(
long now,
- InetAddress remoteAddress,
+ InetSocketAddress remoteAddress,
int linkDesperation,
byte[] packetData,
long[] nextBackgroundTaskDeadline) {
@@ -377,7 +377,7 @@ public class Node {
private native ResultCode processWirePacket(
long nodeId,
long now,
- InetAddress remoteAddress,
+ InetSocketAddress remoteAddress,
int linkDesperation,
byte[] packetData,
long[] nextBackgroundTaskDeadline);
diff --git a/java/src/com/zerotierone/sdk/PacketSender.java b/java/src/com/zerotierone/sdk/PacketSender.java
index 0c1cd83e..a4cbb0e5 100644
--- a/java/src/com/zerotierone/sdk/PacketSender.java
+++ b/java/src/com/zerotierone/sdk/PacketSender.java
@@ -26,7 +26,7 @@
*/
package com.zerotierone.sdk;
-import java.net.InetAddress;
+import java.net.InetSocketAddress;
public interface PacketSender {
@@ -37,13 +37,13 @@ public interface PacketSender {
* on failure. Note that success does not (of course) guarantee packet
* delivery. It only means that the packet appears to have been sent.
*
- * @param addr {@link InetAddress} to send to
+ * @param addr {@link InetSocketAddress} to send to
* @param linkDesperation
* @param packetData data to send
* @return 0 on success, any error code on failure.
*/
public int onSendPacketRequested(
- InetAddress addr,
+ InetSocketAddress addr,
int linkDesperation,
byte[] packetData);
}
diff --git a/java/src/com/zerotierone/sdk/PeerPhysicalPath.java b/java/src/com/zerotierone/sdk/PeerPhysicalPath.java
index 17b0ff8b..15f04241 100644
--- a/java/src/com/zerotierone/sdk/PeerPhysicalPath.java
+++ b/java/src/com/zerotierone/sdk/PeerPhysicalPath.java
@@ -27,13 +27,13 @@
package com.zerotierone.sdk;
-import java.net.InetAddress;
+import java.net.InetSocketAddress;
/**
* Physical network path to a peer
*/
public final class PeerPhysicalPath {
- private InetAddress address;
+ private InetSocketAddress address;
private long lastSend;
private long lastReceive;
private boolean fixed;
@@ -45,7 +45,7 @@ public final class PeerPhysicalPath {
/**
* Address of endpoint
*/
- public final InetAddress address() {
+ public final InetSocketAddress address() {
return address;
}
diff --git a/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java b/java/src/com/zerotierone/sdk/VirtualNetworkConfig.java
index 037fd802..10d9f873 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.InetAddress;
+import java.net.InetSocketAddress;
public final class VirtualNetworkConfig {
public static final int MAX_MULTICAST_SUBSCRIPTIONS = 4096;
@@ -48,7 +48,7 @@ public final class VirtualNetworkConfig {
private boolean enabled;
private long netconfRevision;
private ArrayList multicastSubscriptions;
- private ArrayList assignedAddresses;
+ private ArrayList assignedAddresses;
private VirtualNetworkConfig() {
@@ -155,7 +155,7 @@ public final class VirtualNetworkConfig {
}
/**
- * ZeroTier-assigned addresses (in {@link java.net.InetAddress} objects)
+ * ZeroTier-assigned addresses (in {@link java.net.InetSocketAddress} objects)
*
* For IP, the port number of the sockaddr_XX structure contains the number
* of bits in the address netmask. Only the IP address and port are used.
@@ -164,7 +164,7 @@ public final class VirtualNetworkConfig {
* This is only used for ZeroTier-managed address assignments sent by the
* virtual network's configuration master.
*/
- public final ArrayList assignedAddresses() {
+ public final ArrayList assignedAddresses() {
return assignedAddresses;
}
}
--
cgit v1.2.3