mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-24 07:06:39 +00:00
Basic cleanups
This commit is contained in:
parent
ead68038a3
commit
0806b881ea
java/src/com/zerotier/sdk
@ -29,14 +29,14 @@ package com.zerotier.sdk;
|
||||
|
||||
/**
|
||||
* Status codes sent to status update callback when things happen
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_Event
|
||||
*/
|
||||
public enum Event {
|
||||
|
||||
/**
|
||||
* Node has been initialized
|
||||
*
|
||||
* <p>
|
||||
* This is the first event generated, and is always sent. It may occur
|
||||
* before Node's constructor returns.
|
||||
*/
|
||||
@ -49,7 +49,7 @@ public enum Event {
|
||||
|
||||
/**
|
||||
* Node is online -- at least one upstream node appears reachable
|
||||
*
|
||||
* <p>
|
||||
* Meta-data: none
|
||||
*/
|
||||
EVENT_ONLINE(2),
|
||||
@ -104,7 +104,7 @@ public enum Event {
|
||||
|
||||
/**
|
||||
* VERB_USER_MESSAGE received
|
||||
*
|
||||
* <p>
|
||||
* These are generated when a VERB_USER_MESSAGE packet is received via
|
||||
* ZeroTier VL1.
|
||||
*/
|
||||
@ -112,7 +112,7 @@ public enum Event {
|
||||
|
||||
/**
|
||||
* Remote trace received
|
||||
*
|
||||
* <p>
|
||||
* These are generated when a VERB_REMOTE_TRACE is received. Note
|
||||
* that any node can fling one of these at us. It is your responsibility
|
||||
* to filter and determine if it's worth paying attention to. If it's
|
||||
|
@ -299,7 +299,7 @@ public class Node {
|
||||
|
||||
/**
|
||||
* Add or update a moon
|
||||
*
|
||||
* <p>
|
||||
* Moons are persisted in the data store in moons.d/, so this can persist
|
||||
* across invocations if the contents of moon.d are scanned and orbit is
|
||||
* called for each on startup.
|
||||
|
@ -31,7 +31,7 @@ import com.zerotier.sdk.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Current node status
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_NodeStatus
|
||||
*/
|
||||
public class NodeStatus {
|
||||
|
@ -11,9 +11,9 @@ public interface PathChecker {
|
||||
|
||||
/**
|
||||
* Callback to check whether a path should be used for ZeroTier traffic
|
||||
*
|
||||
* <p>
|
||||
* This function must return true if the path should be used.
|
||||
*
|
||||
* <p>
|
||||
* If no path check function is specified, ZeroTier will still exclude paths
|
||||
* that overlap with ZeroTier-assigned and managed IP address blocks. But the
|
||||
* use of a path check function is recommended to ensure that recursion does
|
||||
@ -22,7 +22,7 @@ public interface PathChecker {
|
||||
* all configured ZeroTier interfaces and check to ensure that the supplied
|
||||
* addresses will not result in ZeroTier traffic being sent over a ZeroTier
|
||||
* interface (recursion).
|
||||
*
|
||||
* <p>
|
||||
* Obviously this is not required in configurations where this can't happen,
|
||||
* such as network containers or embedded.
|
||||
*
|
||||
@ -35,7 +35,7 @@ public interface PathChecker {
|
||||
|
||||
/**
|
||||
* Function to get physical addresses for ZeroTier peers
|
||||
*
|
||||
* <p>
|
||||
* If provided this function will be occasionally called to get physical
|
||||
* addresses that might be tried to reach a ZeroTier address.
|
||||
*
|
||||
|
@ -33,7 +33,7 @@ import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Peer status result buffer
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_Peer
|
||||
*/
|
||||
public class Peer {
|
||||
|
@ -31,7 +31,7 @@ import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Physical network path to a peer
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_PeerPhysicalPath
|
||||
*/
|
||||
public class PeerPhysicalPath {
|
||||
|
@ -29,7 +29,7 @@ package com.zerotier.sdk;
|
||||
|
||||
/**
|
||||
* What trust hierarchy role does this peer have?
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_PeerRole
|
||||
*/
|
||||
public enum PeerRole {
|
||||
|
@ -38,7 +38,7 @@ import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Virtual network configuration
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkConfig
|
||||
*/
|
||||
public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
|
||||
@ -374,11 +374,11 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
|
||||
|
||||
/**
|
||||
* ZeroTier-assigned addresses (in {@link InetSocketAddress} objects)
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* Other fields like interface number can be ignored.
|
||||
*
|
||||
* <p>
|
||||
* This is only used for ZeroTier-managed address assignments sent by the
|
||||
* virtual network's configuration master.
|
||||
*/
|
||||
|
@ -36,14 +36,14 @@ public interface VirtualNetworkConfigListener {
|
||||
* <p>This can be called at any time to update the configuration of a virtual
|
||||
* network port. The parameter after the network ID specifies whether this
|
||||
* port is being brought up, updated, brought down, or permanently deleted.
|
||||
*
|
||||
* <p>
|
||||
* This in turn should be used by the underlying implementation to create
|
||||
* and configure tap devices at the OS (or virtual network stack) layer.</P>
|
||||
*
|
||||
* This should not call {@link Node#multicastSubscribe(long, long)} or other network-modifying
|
||||
* methods, as this could cause a deadlock in multithreaded or interrupt
|
||||
* driven environments.
|
||||
*
|
||||
* <p>
|
||||
* This must return 0 on success. It can return any OS-dependent error code
|
||||
* on failure, and this results in the network being placed into the
|
||||
* PORT_ERROR state.
|
||||
|
@ -29,7 +29,7 @@ package com.zerotier.sdk;
|
||||
|
||||
/**
|
||||
* Virtual network configuration update type
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkConfigOperation
|
||||
*/
|
||||
public enum VirtualNetworkConfigOperation {
|
||||
|
@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* DNS configuration to be pushed on a virtual network
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkDNS
|
||||
*/
|
||||
public class VirtualNetworkDNS implements Comparable<VirtualNetworkDNS> {
|
||||
@ -45,6 +45,7 @@ public class VirtualNetworkDNS implements Comparable<VirtualNetworkDNS> {
|
||||
return false;
|
||||
}
|
||||
|
||||
//noinspection RedundantIfStatement
|
||||
if (!servers.equals(d.servers)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* A route to be pushed on a virtual network
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkRoute
|
||||
*/
|
||||
public class VirtualNetworkRoute implements Comparable<VirtualNetworkRoute>
|
||||
@ -126,6 +126,7 @@ public class VirtualNetworkRoute implements Comparable<VirtualNetworkRoute>
|
||||
return false;
|
||||
}
|
||||
|
||||
//noinspection RedundantIfStatement
|
||||
if (metric != other.metric) {
|
||||
return false;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ package com.zerotier.sdk;
|
||||
|
||||
/**
|
||||
* Virtual network status codes
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkStatus
|
||||
*/
|
||||
public enum VirtualNetworkStatus {
|
||||
|
@ -29,7 +29,7 @@ package com.zerotier.sdk;
|
||||
|
||||
/**
|
||||
* Virtual network type codes
|
||||
*
|
||||
* <p>
|
||||
* Defined in ZeroTierOne.h as ZT_VirtualNetworkType
|
||||
*/
|
||||
public enum VirtualNetworkType {
|
||||
|
Loading…
Reference in New Issue
Block a user