Changeset 412fcfb for apps


Ignore:
Timestamp:
Jul 19, 2018 2:15:43 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c35d158
Parents:
80973ca
Message:

Console: Add netdb search by transport

Location:
apps/routerconsole
Files:
3 edited

Legend:

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

    r80973ca r412fcfb  
    22
    33import java.io.IOException;
     4import java.util.Locale;
     5
    46import net.i2p.crypto.SigType;
    57import net.i2p.data.DataHelper;
     
    1012    private String _version;
    1113    private String _country;
    12     private String _family, _caps, _ip, _sybil, _mtu, _ssucaps, _ipv6;
     14    private String _family, _caps, _ip, _sybil, _mtu, _ssucaps, _ipv6, _transport;
    1315    private int _full, _port, _cost;
    1416    private boolean _lease;
     
    122124    }
    123125
     126    /** @since 0.9.36 */
     127    public void setTransport(String f) {
     128        if (f != null && f.length() > 0)
     129            _transport = DataHelper.stripHTML(f).toUpperCase(Locale.US);
     130    }
     131
    124132    /** @since 0.9.28 */
    125133    public void setCost(String f) {
     
    158166                _family != null || _caps != null || _ip != null || _sybil != null ||
    159167                _port != 0 || _type != null || _mtu != null || _ipv6 != null ||
    160                 _ssucaps != null || _cost != 0)
     168                _ssucaps != null || _transport != null || _cost != 0)
    161169                renderer.renderRouterInfoHTML(_out, _routerPrefix, _version, _country,
    162170                                              _family, _caps, _ip, _sybil, _port, _type,
    163                                               _mtu, _ipv6, _ssucaps, _cost);
     171                                              _mtu, _ipv6, _ssucaps, _transport, _cost);
    164172            else if (_lease)
    165173                renderer.renderLeaseSetHTML(_out, _debug);
     
    245253        _out.write("<form action=\"/netdb\" method=\"GET\">\n" +
    246254                   "<table id=\"netdblookup\"><tr><th colspan=\"3\">Network Database Search</th></tr>\n" +
    247                    "<tr><td colspan=\"3\" class=\"subheading\"><b>Select one search field <i>only</i>:</b></td></tr>\n" +
     255                   "<tr><td colspan=\"3\" class=\"subheading\"><b>Enter one search field <i>only</i>:</b></td></tr>\n" +
    248256                   "<tr><td>Capabilities:</td><td><input type=\"text\" name=\"caps\"></td><td>e.g. f or XOfR</td></tr>\n" +
    249257                   "<tr><td>Cost:</td><td><input type=\"text\" name=\"cost\"></td><td></td></tr>\n" +
     
    257265                   "<tr><td>Signature Type:</td><td><input type=\"text\" name=\"type\"></td><td></td></tr>\n" +
    258266                   "<tr><td>SSU Capabilities:</td><td><input type=\"text\" name=\"ssucaps\"></td><td></td></tr>\n" +
     267                   "<tr><td>Transport:</td><td><input type=\"text\" name=\"tr\"></td><td></td></tr>\n" +
    259268                   "<tr><td>Router Version:</td><td><input type=\"text\" name=\"v\"></td><td></td></tr>\n" +
    260269                   "<tr><td colspan=\"3\" class=\"subheading\"><b>Add Sybil analysis (must pick one above):</b></td></tr>\n" +
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/NetDbRenderer.java

    r80973ca r412fcfb  
    9595                                     String country, String family, String caps,
    9696                                     String ip, String sybil, int port, SigType type,
    97                                      String mtu, String ipv6, String ssucaps, int cost) throws IOException {
     97                                     String mtu, String ipv6, String ssucaps,
     98                                     String tr, int cost) throws IOException {
    9899        StringBuilder buf = new StringBuilder(4*1024);
    99100        List<Hash> sybils = sybil != null ? new ArrayList<Hash>(128) : null;
     
    125126                    (family != null && family.equals(ri.getOption("family"))) ||
    126127                    (caps != null && ri.getCapabilities().contains(caps)) ||
     128                    (tr != null && ri.getTargetAddress(tr) != null) ||
    127129                    (type != null && type == ri.getIdentity().getSigType())) {
    128130                    renderRouterInfo(buf, ri, false, true);
     
    705707        for (RouterAddress addr : info.getAddresses()) {
    706708            String style = addr.getTransportStyle();
    707             if (style.equals("NTCP")) {
     709            if (style.equals("NTCP") || style.equals("NTCP2")) {
    708710                rv |= NTCP;
    709711            } else if (style.equals("SSU")) {
  • apps/routerconsole/jsp/netdb.jsp

    r80973ca r412fcfb  
    3636 <jsp:setProperty name="netdbHelper" property="mtu" value="<%=request.getParameter(\"mtu\")%>" />
    3737 <jsp:setProperty name="netdbHelper" property="ssucaps" value="<%=request.getParameter(\"ssucaps\")%>" />
     38 <jsp:setProperty name="netdbHelper" property="transport" value="<%=request.getParameter(\"tr\")%>" />
    3839 <jsp:getProperty name="netdbHelper" property="netDbSummary" />
    3940</div></body></html>
Note: See TracChangeset for help on using the changeset viewer.