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