Changeset 2c65173


Ignore:
Timestamp:
Nov 12, 2016 3:14:43 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6ed329d
Parents:
6acc23af
Message:

Console: Add IPv6 firewalled setting on /confignet

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java

    r6acc23af r2c65173  
    5353    private String _ipv6Mode;
    5454    private boolean _ipv4Firewalled;
     55    private boolean _ipv6Firewalled;
    5556    private final Map<String, String> changes = new HashMap<String, String>();
    5657    private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice
     
    8889    /** @since 0.9.20 */
    8990    public void setIPv4Firewalled(String moo) { _ipv4Firewalled = true; }
     91
     92    /** @since 0.9.28 */
     93    public void setIPv6Firewalled(String moo) { _ipv6Firewalled = true; }
    9094   
    9195    public void setHostname(String hostname) {
     
    367371            changes.put(TransportUtil.PROP_IPV4_FIREWALLED, "" + _ipv4Firewalled);
    368372
     373            if (Boolean.parseBoolean(_context.getProperty(TransportUtil.PROP_IPV6_FIREWALLED)) !=
     374                _ipv6Firewalled) {
     375                if (_ipv6Firewalled)
     376                    addFormNotice(_t("Disabling inbound IPv6"));
     377                else
     378                    addFormNotice(_t("Enabling inbound IPv6"));
     379                restartRequired = true;
     380            }
     381            changes.put(TransportUtil.PROP_IPV6_FIREWALLED, "" + _ipv6Firewalled);
     382
    369383            if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) !=
    370384                !_udpDisabled) {
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java

    r6acc23af r2c65173  
    9191    }
    9292
     93    /** @since 0.9.28 */
     94    public String getIPv6FirewalledChecked() {
     95        return getChecked(TransportUtil.PROP_IPV6_FIREWALLED);
     96    }
     97
    9398    public String getTcpAutoPortChecked(int mode) {
    9499        String port = _context.getProperty(PROP_I2NP_NTCP_PORT);
  • apps/routerconsole/jsp/confignet.jsp

    r6acc23af r2c65173  
    5757 </p><p>
    5858 <%=intl._t("IPv6 Configuration")%>:<br>
     59    <input type="checkbox" class="optbox" name="IPv6Firewalled" value="true" <jsp:getProperty name="nethelper" property="IPv6FirewalledChecked" /> >
     60    <%=intl._t("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%><br>
    5961    <input type="radio" class="optbox" name="ipv6" value="false" <%=nethelper.getIPv6Checked("false") %> >
    6062    <%=intl._t("Disable IPv6")%><br>
  • router/java/src/net/i2p/router/transport/TransportUtil.java

    r6acc23af r2c65173  
    2626    public static final String SSU_IPV6_CONFIG = "i2np.udp.ipv6";
    2727    public static final String PROP_IPV4_FIREWALLED = "i2np.ipv4.firewalled";
     28    /** @since 0.9.28 */
     29    public static final String PROP_IPV6_FIREWALLED = "i2np.ipv6.firewalled";
    2830
    2931    public enum IPv6Config {
     
    100102     *
    101103     *  @param transportStyle ignored
    102      *  @since 0.9.27
     104     *  @since 0.9.27, implemented in 0.9.28
    103105     */
    104106    public static boolean isIPv6Firewalled(RouterContext ctx, String transportStyle) {
    105         // TODO
    106         //return ctx.getBooleanProperty(PROP_IPV6_FIREWALLED);
    107         return false;
     107        return ctx.getBooleanProperty(PROP_IPV6_FIREWALLED);
    108108    }
    109109
Note: See TracChangeset for help on using the changeset viewer.