I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 8418bda5 authored by zzz's avatar zzz
Browse files

Console: Add netdb search options for v1 or v2 only transports

parent 75492514
No related branches found
No related tags found
No related merge requests found
......@@ -408,8 +408,12 @@ public class NetDbHelper extends FormHandler {
_out.write("</select></td><td></td></tr>\n" +
"<tr><td>Transport:</td><td><select name=\"tr\"><option value=\"\" selected=\"selected\">" +
"<option value=\"NTCP\">NTCP</option>\n" +
"<option value=\"NTCP_1\">NTCP (v1 only)</option>\n" +
"<option value=\"NTCP_2\">NTCP (v2 supported)</option>\n" +
"<option value=\"NTCP2\">NTCP2</option>\n" +
"<option value=\"SSU\">SSU</option>\n" +
"<option value=\"SSU_1\">SSU (v1 only)</option>\n" +
"<option value=\"SSU_2\">SSU (v2 supported)</option>\n" +
"<option value=\"SSU2\">SSU2</option>\n" +
"</select></td><td></td></tr>\n" +
"<tr><td>Transport Capabilities:</td><td><input type=\"text\" name=\"ssucaps\"></td><td></td></tr>\n" +
......
......@@ -225,7 +225,6 @@ class NetDbRenderer {
(country != null && country.equals(_context.commSystem().getCountry(key))) ||
// 'O' will catch PO and XO also
(caps != null && hasCap(ri, caps)) ||
(tr != null && ri.getTargetAddress(tr) != null) ||
(type != null && type == ri.getIdentity().getSigType()) ||
(etype != null && etype == ri.getIdentity().getEncType())) {
if (skipped < toSkip) {
......@@ -240,6 +239,38 @@ class NetDbRenderer {
if (sybil != null)
sybils.add(key);
notFound = false;
} else if (tr != null) {
boolean found;
if (tr.equals("NTCP_1")) {
RouterAddress ra = ri.getTargetAddress("NTCP");
found = ra != null && ra.getOption("v") == null;
} else if (tr.equals("NTCP_2")) {
RouterAddress ra = ri.getTargetAddress("NTCP");
found = ra != null && ra.getOption("v") != null;
} else if (tr.equals("SSU_1")) {
RouterAddress ra = ri.getTargetAddress("SSU");
found = ra != null && ra.getOption("v") == null;
} else if (tr.equals("SSU_2")) {
RouterAddress ra = ri.getTargetAddress("SSU");
found = ra != null && ra.getOption("v") != null;
} else {
RouterAddress ra = ri.getTargetAddress(tr);
found = ra != null;
}
if (!found)
continue;
if (skipped < toSkip) {
skipped++;
continue;
}
if (written++ >= pageSize) {
morePages = true;
break;
}
renderRouterInfo(buf, ri, false, true);
if (sybil != null)
sybils.add(key);
notFound = false;
} else if (family != null) {
String rifam = ri.getOption("family");
if (rifam != null && rifam.toLowerCase(Locale.US).contains(family)) {
......@@ -421,7 +452,7 @@ class NetDbRenderer {
if (ssucaps != null)
buf.append("Caps ").append(ssucaps).append(' ');
if (tr != null)
buf.append("Transport ").append(tr).append(' ');
buf.append(_t("Transport")).append(' ').append(tr).append(' ');
buf.append(_t("not found in network database"));
buf.append("</div>");
} else if (page > 0 || morePages) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment