forked from I2P_Developers/i2p.i2p
Console: Add IPv6 firewalled setting on /confignet
This commit is contained in:
@ -52,6 +52,7 @@ public class ConfigNetHandler extends FormHandler {
|
|||||||
private boolean _udpDisabled;
|
private boolean _udpDisabled;
|
||||||
private String _ipv6Mode;
|
private String _ipv6Mode;
|
||||||
private boolean _ipv4Firewalled;
|
private boolean _ipv4Firewalled;
|
||||||
|
private boolean _ipv6Firewalled;
|
||||||
private final Map<String, String> changes = new HashMap<String, String>();
|
private final Map<String, String> changes = new HashMap<String, String>();
|
||||||
private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice
|
private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice
|
||||||
|
|
||||||
@ -88,6 +89,9 @@ public class ConfigNetHandler extends FormHandler {
|
|||||||
/** @since 0.9.20 */
|
/** @since 0.9.20 */
|
||||||
public void setIPv4Firewalled(String moo) { _ipv4Firewalled = true; }
|
public void setIPv4Firewalled(String moo) { _ipv4Firewalled = true; }
|
||||||
|
|
||||||
|
/** @since 0.9.28 */
|
||||||
|
public void setIPv6Firewalled(String moo) { _ipv6Firewalled = true; }
|
||||||
|
|
||||||
public void setHostname(String hostname) {
|
public void setHostname(String hostname) {
|
||||||
_hostname = (hostname != null ? hostname.trim() : null);
|
_hostname = (hostname != null ? hostname.trim() : null);
|
||||||
}
|
}
|
||||||
@ -366,6 +370,16 @@ public class ConfigNetHandler extends FormHandler {
|
|||||||
}
|
}
|
||||||
changes.put(TransportUtil.PROP_IPV4_FIREWALLED, "" + _ipv4Firewalled);
|
changes.put(TransportUtil.PROP_IPV4_FIREWALLED, "" + _ipv4Firewalled);
|
||||||
|
|
||||||
|
if (Boolean.parseBoolean(_context.getProperty(TransportUtil.PROP_IPV6_FIREWALLED)) !=
|
||||||
|
_ipv6Firewalled) {
|
||||||
|
if (_ipv6Firewalled)
|
||||||
|
addFormNotice(_t("Disabling inbound IPv6"));
|
||||||
|
else
|
||||||
|
addFormNotice(_t("Enabling inbound IPv6"));
|
||||||
|
restartRequired = true;
|
||||||
|
}
|
||||||
|
changes.put(TransportUtil.PROP_IPV6_FIREWALLED, "" + _ipv6Firewalled);
|
||||||
|
|
||||||
if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) !=
|
if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) !=
|
||||||
!_udpDisabled) {
|
!_udpDisabled) {
|
||||||
if (_udpDisabled)
|
if (_udpDisabled)
|
||||||
|
@ -90,6 +90,11 @@ public class ConfigNetHelper extends HelperBase {
|
|||||||
return getChecked(TransportUtil.PROP_IPV4_FIREWALLED);
|
return getChecked(TransportUtil.PROP_IPV4_FIREWALLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.28 */
|
||||||
|
public String getIPv6FirewalledChecked() {
|
||||||
|
return getChecked(TransportUtil.PROP_IPV6_FIREWALLED);
|
||||||
|
}
|
||||||
|
|
||||||
public String getTcpAutoPortChecked(int mode) {
|
public String getTcpAutoPortChecked(int mode) {
|
||||||
String port = _context.getProperty(PROP_I2NP_NTCP_PORT);
|
String port = _context.getProperty(PROP_I2NP_NTCP_PORT);
|
||||||
boolean specified = port != null && port.length() > 0;
|
boolean specified = port != null && port.length() > 0;
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
<%=intl._t("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%>
|
<%=intl._t("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%>
|
||||||
</p><p>
|
</p><p>
|
||||||
<%=intl._t("IPv6 Configuration")%>:<br>
|
<%=intl._t("IPv6 Configuration")%>:<br>
|
||||||
|
<input type="checkbox" class="optbox" name="IPv6Firewalled" value="true" <jsp:getProperty name="nethelper" property="IPv6FirewalledChecked" /> >
|
||||||
|
<%=intl._t("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%><br>
|
||||||
<input type="radio" class="optbox" name="ipv6" value="false" <%=nethelper.getIPv6Checked("false") %> >
|
<input type="radio" class="optbox" name="ipv6" value="false" <%=nethelper.getIPv6Checked("false") %> >
|
||||||
<%=intl._t("Disable IPv6")%><br>
|
<%=intl._t("Disable IPv6")%><br>
|
||||||
<input type="radio" class="optbox" name="ipv6" value="enable" <%=nethelper.getIPv6Checked("enable") %> >
|
<input type="radio" class="optbox" name="ipv6" value="enable" <%=nethelper.getIPv6Checked("enable") %> >
|
||||||
|
@ -25,6 +25,8 @@ public abstract class TransportUtil {
|
|||||||
public static final String NTCP_IPV6_CONFIG = "i2np.ntcp.ipv6";
|
public static final String NTCP_IPV6_CONFIG = "i2np.ntcp.ipv6";
|
||||||
public static final String SSU_IPV6_CONFIG = "i2np.udp.ipv6";
|
public static final String SSU_IPV6_CONFIG = "i2np.udp.ipv6";
|
||||||
public static final String PROP_IPV4_FIREWALLED = "i2np.ipv4.firewalled";
|
public static final String PROP_IPV4_FIREWALLED = "i2np.ipv4.firewalled";
|
||||||
|
/** @since 0.9.28 */
|
||||||
|
public static final String PROP_IPV6_FIREWALLED = "i2np.ipv6.firewalled";
|
||||||
|
|
||||||
public enum IPv6Config {
|
public enum IPv6Config {
|
||||||
/** IPv6 disabled */
|
/** IPv6 disabled */
|
||||||
@ -99,12 +101,10 @@ public abstract class TransportUtil {
|
|||||||
* This returns true if the force-firewalled setting is configured, false otherwise.
|
* This returns true if the force-firewalled setting is configured, false otherwise.
|
||||||
*
|
*
|
||||||
* @param transportStyle ignored
|
* @param transportStyle ignored
|
||||||
* @since 0.9.27
|
* @since 0.9.27, implemented in 0.9.28
|
||||||
*/
|
*/
|
||||||
public static boolean isIPv6Firewalled(RouterContext ctx, String transportStyle) {
|
public static boolean isIPv6Firewalled(RouterContext ctx, String transportStyle) {
|
||||||
// TODO
|
return ctx.getBooleanProperty(PROP_IPV6_FIREWALLED);
|
||||||
//return ctx.getBooleanProperty(PROP_IPV6_FIREWALLED);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user