forked from I2P_Developers/i2p.i2p
CSF: New enums for SNAT/OK and SNAT/UNKNOWN
This commit is contained in:
@@ -162,6 +162,7 @@ public class SummaryHelper extends HelperBase {
|
|||||||
case IPV4_UNKNOWN_IPV6_OK:
|
case IPV4_UNKNOWN_IPV6_OK:
|
||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
RouterAddress ra = routerInfo.getTargetAddress("NTCP");
|
RouterAddress ra = routerInfo.getTargetAddress("NTCP");
|
||||||
if (ra == null)
|
if (ra == null)
|
||||||
return _(status.toStatusString());
|
return _(status.toStatusString());
|
||||||
@@ -173,6 +174,7 @@ public class SummaryHelper extends HelperBase {
|
|||||||
return _(status.toStatusString());
|
return _(status.toStatusString());
|
||||||
return _("ERR-Private TCP Address");
|
return _("ERR-Private TCP Address");
|
||||||
|
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
case DIFFERENT:
|
case DIFFERENT:
|
||||||
return _("ERR-SymmetricNAT");
|
return _("ERR-SymmetricNAT");
|
||||||
|
|
||||||
|
@@ -212,12 +212,28 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
*/
|
*/
|
||||||
public static final short STATUS_IPV4_DISABLED_IPV6_OK = 5;
|
public static final short STATUS_IPV4_DISABLED_IPV6_OK = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We are behind a symmetric NAT which will make our 'from' address look
|
||||||
|
* differently when we talk to multiple people
|
||||||
|
* We can receive unsolicited connections on IPv6.
|
||||||
|
* @since 0.9.20
|
||||||
|
*/
|
||||||
|
public static final short STATUS_IPV4_SNAT_IPV6_OK = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We are behind a symmetric NAT which will make our 'from' address look
|
* We are behind a symmetric NAT which will make our 'from' address look
|
||||||
* differently when we talk to multiple people
|
* differently when we talk to multiple people
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_DIFFERENT = 6;
|
public static final short STATUS_DIFFERENT = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We are behind a symmetric NAT which will make our 'from' address look
|
||||||
|
* differently when we talk to multiple people
|
||||||
|
* We might be able to receive unsolicited connections on IPv6.
|
||||||
|
* @since 0.9.20
|
||||||
|
*/
|
||||||
|
public static final short STATUS_IPV4_SNAT_IPV6_UNKNOWN = 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have an IPv6 transport enabled and a public IPv6 address.
|
* We have an IPv6 transport enabled and a public IPv6 address.
|
||||||
@@ -225,14 +241,14 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
* We might be able to receive unsolicited connections on IPv6.
|
* We might be able to receive unsolicited connections on IPv6.
|
||||||
* @since 0.9.20
|
* @since 0.9.20
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN = 8;
|
public static final short STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We are able to talk to peers that we initiate communication with, but
|
* We are able to talk to peers that we initiate communication with, but
|
||||||
* cannot receive unsolicited connections, i.e. Firewalled,
|
* cannot receive unsolicited connections, i.e. Firewalled,
|
||||||
* on all enabled transports.
|
* on all enabled transports.
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_REJECT_UNSOLICITED = 7;
|
public static final short STATUS_REJECT_UNSOLICITED = 9;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have an IPv6 transport enabled and a public IPv6 address.
|
* We have an IPv6 transport enabled and a public IPv6 address.
|
||||||
@@ -240,7 +256,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
* We cannot receive unsolicited connections on IPv6.
|
* We cannot receive unsolicited connections on IPv6.
|
||||||
* @since 0.9.20
|
* @since 0.9.20
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED = 9;
|
public static final short STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED = 11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have an IPv6 transport enabled and a public IPv6 address.
|
* We have an IPv6 transport enabled and a public IPv6 address.
|
||||||
@@ -248,7 +264,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
* We might be able to receive unsolicited connections on IPv6.
|
* We might be able to receive unsolicited connections on IPv6.
|
||||||
* @since 0.9.20
|
* @since 0.9.20
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_IPV4_DISABLED_IPV6_UNKNOWN = 11;
|
public static final short STATUS_IPV4_DISABLED_IPV6_UNKNOWN = 13;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have an IPv6 transport enabled and a public IPv6 address.
|
* We have an IPv6 transport enabled and a public IPv6 address.
|
||||||
@@ -256,23 +272,23 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
* We can receive unsolicited connections on IPv6.
|
* We can receive unsolicited connections on IPv6.
|
||||||
* @since 0.9.20
|
* @since 0.9.20
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_IPV4_DISABLED_IPV6_FIREWALLED = 10;
|
public static final short STATUS_IPV4_DISABLED_IPV6_FIREWALLED = 12;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have no network interface at all enabled transports
|
* We have no network interface at all enabled transports
|
||||||
* @since 0.9.4
|
* @since 0.9.4
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_DISCONNECTED = 12;
|
public static final short STATUS_DISCONNECTED = 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Our detection system is broken (SSU bind port failed)
|
* Our detection system is broken (SSU bind port failed)
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_HOSED = 13;
|
public static final short STATUS_HOSED = 15;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Our reachability is unknown on all
|
* Our reachability is unknown on all
|
||||||
*/
|
*/
|
||||||
public static final short STATUS_UNKNOWN = 14;
|
public static final short STATUS_UNKNOWN = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since the codes may change.
|
* Since the codes may change.
|
||||||
@@ -286,8 +302,10 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
IPV4_UNKNOWN_IPV6_OK(STATUS_IPV4_UNKNOWN_IPV6_OK, _x("IPv4: Testing; IPv6: OK")),
|
IPV4_UNKNOWN_IPV6_OK(STATUS_IPV4_UNKNOWN_IPV6_OK, _x("IPv4: Testing; IPv6: OK")),
|
||||||
IPV4_FIREWALLED_IPV6_OK(STATUS_IPV4_FIREWALLED_IPV6_OK, _x("IPv4: Firewalled; IPv6: OK")),
|
IPV4_FIREWALLED_IPV6_OK(STATUS_IPV4_FIREWALLED_IPV6_OK, _x("IPv4: Firewalled; IPv6: OK")),
|
||||||
IPV4_DISABLED_IPV6_OK(STATUS_IPV4_DISABLED_IPV6_OK, _x("IPv4: Disabled; IPv6: OK")),
|
IPV4_DISABLED_IPV6_OK(STATUS_IPV4_DISABLED_IPV6_OK, _x("IPv4: Disabled; IPv6: OK")),
|
||||||
/** IPv4 symmetric NAT, IPv6 any state */
|
IPV4_SNAT_IPV6_OK(STATUS_IPV4_SNAT_IPV6_OK, _x("IPv4: Symmetric NAT; IPv6: OK")),
|
||||||
|
/** IPv4 symmetric NAT, IPv6 firewalled or disabled or no address */
|
||||||
DIFFERENT(STATUS_DIFFERENT, _x("Symmetric NAT")),
|
DIFFERENT(STATUS_DIFFERENT, _x("Symmetric NAT")),
|
||||||
|
IPV4_SNAT_IPV6_UNKNOWN(STATUS_IPV4_SNAT_IPV6_UNKNOWN, _x("IPv4: Symmetric NAT; IPv6: Testing")),
|
||||||
IPV4_FIREWALLED_IPV6_UNKNOWN(STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN, _x("IPv4: Firewalled; IPv6: Testing")),
|
IPV4_FIREWALLED_IPV6_UNKNOWN(STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN, _x("IPv4: Firewalled; IPv6: Testing")),
|
||||||
/** IPv4 firewalled, IPv6 firewalled or disabled or no address */
|
/** IPv4 firewalled, IPv6 firewalled or disabled or no address */
|
||||||
REJECT_UNSOLICITED(STATUS_REJECT_UNSOLICITED, _x("Firewalled")),
|
REJECT_UNSOLICITED(STATUS_REJECT_UNSOLICITED, _x("Firewalled")),
|
||||||
@@ -327,6 +345,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case OK:
|
case OK:
|
||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
case IPV4_OK_IPV6_FIREWALLED:
|
case IPV4_OK_IPV6_FIREWALLED:
|
||||||
@@ -350,6 +369,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_OK_IPV6_UNKNOWN:
|
case IPV4_OK_IPV6_UNKNOWN:
|
||||||
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
return newStatus;
|
return newStatus;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -365,7 +385,8 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
|
|
||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
case DIFFERENT: // TODO
|
case DIFFERENT:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
return oldStatus;
|
return oldStatus;
|
||||||
|
|
||||||
case REJECT_UNSOLICITED:
|
case REJECT_UNSOLICITED:
|
||||||
@@ -389,6 +410,9 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
return IPV4_DISABLED_IPV6_OK;
|
return IPV4_DISABLED_IPV6_OK;
|
||||||
|
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
|
return IPV4_SNAT_IPV6_OK;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return newStatus;
|
return newStatus;
|
||||||
}
|
}
|
||||||
@@ -399,6 +423,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case OK:
|
case OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
return IPV4_FIREWALLED_IPV6_OK;
|
return IPV4_FIREWALLED_IPV6_OK;
|
||||||
|
|
||||||
case IPV4_OK_IPV6_FIREWALLED:
|
case IPV4_OK_IPV6_FIREWALLED:
|
||||||
@@ -420,6 +445,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_OK_IPV6_UNKNOWN:
|
case IPV4_OK_IPV6_UNKNOWN:
|
||||||
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
return newStatus;
|
return newStatus;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -443,7 +469,8 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
return IPV4_DISABLED_IPV6_FIREWALLED;
|
return IPV4_DISABLED_IPV6_FIREWALLED;
|
||||||
|
|
||||||
case DIFFERENT: // TODO
|
case DIFFERENT:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
return oldStatus;
|
return oldStatus;
|
||||||
|
|
||||||
// cases where we already knew the IPv6 state only
|
// cases where we already knew the IPv6 state only
|
||||||
@@ -461,6 +488,9 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
return IPV4_DISABLED_IPV6_FIREWALLED;
|
return IPV4_DISABLED_IPV6_FIREWALLED;
|
||||||
|
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
|
return DIFFERENT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return newStatus;
|
return newStatus;
|
||||||
}
|
}
|
||||||
@@ -471,6 +501,7 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case OK:
|
case OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
return IPV4_DISABLED_IPV6_OK;
|
return IPV4_DISABLED_IPV6_OK;
|
||||||
|
|
||||||
case IPV4_OK_IPV6_FIREWALLED:
|
case IPV4_OK_IPV6_FIREWALLED:
|
||||||
@@ -492,6 +523,42 @@ public abstract class CommSystemFacade implements Service {
|
|||||||
case IPV4_OK_IPV6_UNKNOWN:
|
case IPV4_OK_IPV6_UNKNOWN:
|
||||||
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
|
return newStatus;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return newStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
|
switch (oldStatus) {
|
||||||
|
// cases where we already knew both states
|
||||||
|
case OK:
|
||||||
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
|
return IPV4_SNAT_IPV6_OK;
|
||||||
|
|
||||||
|
case IPV4_OK_IPV6_FIREWALLED:
|
||||||
|
case IPV4_DISABLED_IPV6_FIREWALLED:
|
||||||
|
case REJECT_UNSOLICITED:
|
||||||
|
return DIFFERENT;
|
||||||
|
|
||||||
|
case DIFFERENT:
|
||||||
|
return newStatus;
|
||||||
|
|
||||||
|
// cases where we already knew the IPv6 state only
|
||||||
|
case IPV4_UNKNOWN_IPV6_OK:
|
||||||
|
return IPV4_SNAT_IPV6_OK;
|
||||||
|
|
||||||
|
case IPV4_UNKNOWN_IPV6_FIREWALLED:
|
||||||
|
return DIFFERENT;
|
||||||
|
|
||||||
|
// cases where we already knew the IPv4 state only
|
||||||
|
case IPV4_OK_IPV6_UNKNOWN:
|
||||||
|
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
return newStatus;
|
return newStatus;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@@ -928,6 +928,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
case IPV4_FIREWALLED_IPV6_OK:
|
case IPV4_FIREWALLED_IPV6_OK:
|
||||||
case IPV4_DISABLED_IPV6_OK:
|
case IPV4_DISABLED_IPV6_OK:
|
||||||
case IPV4_UNKNOWN_IPV6_OK:
|
case IPV4_UNKNOWN_IPV6_OK:
|
||||||
|
case IPV4_SNAT_IPV6_OK:
|
||||||
ri.addCapability(CAPABILITY_REACHABLE);
|
ri.addCapability(CAPABILITY_REACHABLE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -943,6 +944,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
case IPV4_UNKNOWN_IPV6_FIREWALLED:
|
case IPV4_UNKNOWN_IPV6_FIREWALLED:
|
||||||
case IPV4_DISABLED_IPV6_UNKNOWN:
|
case IPV4_DISABLED_IPV6_UNKNOWN:
|
||||||
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
case IPV4_FIREWALLED_IPV6_UNKNOWN:
|
||||||
|
case IPV4_SNAT_IPV6_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
// no explicit capability
|
// no explicit capability
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user