Changeset f2f5df0
- Timestamp:
- May 19, 2019 11:42:26 AM (22 months ago)
- Branches:
- master
- Children:
- 1ffc006
- Parents:
- 10354df
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java
r10354df rf2f5df0 65 65 public static final String PROP_FREQUENCY = "router.sybilFrequency"; 66 66 public static final String PROP_THRESHOLD = "router.sybilThreshold"; 67 public static final String PROP_BLOCK = "router.sybil Block.enable";68 public static final String PROP_NONFF = "router.sybil IncludeAll";69 public static final String PROP_BLOCKTIME = "router.sybilBlock .period";67 public static final String PROP_BLOCK = "router.sybilEnableBlocking"; 68 public static final String PROP_NONFF = "router.sybilAnalyzeAll"; 69 public static final String PROP_BLOCKTIME = "router.sybilBlockPeriod"; 70 70 private static final long MIN_FREQUENCY = 60*60*1000L; 71 71 private static final long MIN_UPTIME = 75*60*1000L; … … 268 268 } 269 269 270 /** 271 * All the routers, not including us 272 * @since 0.9.41 273 */ 274 public List<RouterInfo> getAllRouters(Hash us) { 275 Set<RouterInfo> set = _context.netDb().getRouters(); 276 List<RouterInfo> ris = new ArrayList<RouterInfo>(set.size()); 277 for (RouterInfo ri : set) { 278 if (!ri.getIdentity().getHash().equals(us)) 279 ris.add(ri); 280 } 281 return ris; 282 } 283 270 284 public double getAvgMinDist(List<RouterInfo> ris) { 271 285 double tot = 0; … … 296 310 List<RouterInfo> ris; 297 311 if (includeAll) { 298 Set<RouterInfo> set = _context.netDb().getRouters(); 299 ris = new ArrayList<RouterInfo>(set.size()); 300 for (RouterInfo ri : set) { 301 if (!ri.getIdentity().getHash().equals(us)) 302 ris.add(ri); 303 } 312 ris = getAllRouters(us); 304 313 } else { 305 314 ris = getFloodfills(us); -
apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java
r10354df rf2f5df0 136 136 List<RouterInfo> ris = null; 137 137 if (mode != 0 && mode != 12 && mode != 13 && mode != 14 && mode != 16) { 138 ris = analysis.getFloodfills(us); 138 if (mode >= 2 && mode <= 6) { 139 // review all routers for family and IP analysis 140 ris = analysis.getAllRouters(us); 141 } else { 142 ris = analysis.getFloodfills(us); 143 } 139 144 if (ris.isEmpty()) { 140 out.write("<h3 class=\"sybils\">No known floodfills</h3>");145 out.write("<h3 class=\"sybils\">No known routers</h3>"); 141 146 return; 142 147 } … … 566 571 private void renderIPGroupsUs(Writer out, StringBuilder buf, List<RouterInfo> ri32, 567 572 List<RouterInfo> ri24, List<RouterInfo> ri16) throws IOException { 568 buf.append("<h3 id=\"ourIP\" class=\"sybils\"> Floodfills close to Our IP</h3>");573 buf.append("<h3 id=\"ourIP\" class=\"sybils\">Routers close to Our IP</h3>"); 569 574 boolean found = false; 570 575 for (RouterInfo info : ri32) { … … 598 603 */ 599 604 private void renderIPGroups32(Writer out, StringBuilder buf, Map<Integer, List<RouterInfo>> map) throws IOException { 600 buf.append("<h3 id=\"sameIP\" class=\"sybils\"> Floodfills with the Same IP</h3>");605 buf.append("<h3 id=\"sameIP\" class=\"sybils\">Routers with the Same IP</h3>"); 601 606 List<Integer> foo = new ArrayList<Integer>(map.keySet()); 602 607 Collections.sort(foo, new FooComparator(map)); … … 611 616 int i3 = i & 0xff; 612 617 String sip = i0 + "." + i1 + '.' + i2 + '.' + i3; 613 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" floodfills with IP <a href=\"/netdb?ip=")618 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" routers with IP <a href=\"/netdb?ip=") 614 619 .append(sip).append("&sybil\">").append(sip) 615 620 .append("</a>:</b></p>"); … … 628 633 */ 629 634 private void renderIPGroups24(Writer out, StringBuilder buf, Map<Integer, List<RouterInfo>> map) throws IOException { 630 buf.append("<h3 id=\"same24\" class=\"sybils\"> Floodfills in the Same /24 (2 minimum)</h3>");635 buf.append("<h3 id=\"same24\" class=\"sybils\">Routers in the Same /24 (2 minimum)</h3>"); 631 636 List<Integer> foo = new ArrayList<Integer>(map.keySet()); 632 637 Collections.sort(foo, new FooComparator(map)); … … 640 645 int i2 = i & 0xff; 641 646 String sip = i0 + "." + i1 + '.' + i2 + ".0/24"; 642 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" floodfills with IP <a href=\"/netdb?ip=")647 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" routers with IP <a href=\"/netdb?ip=") 643 648 .append(sip).append("&sybil\">").append(sip) 644 649 .append("</a>:</b></p>"); … … 657 662 */ 658 663 private void renderIPGroups16(Writer out, StringBuilder buf, Map<Integer, List<RouterInfo>> map) throws IOException { 659 buf.append("<h3 id=\"same16\" class=\"sybils\"> Floodfills in the Same /16 (4 minimum)</h3>");664 buf.append("<h3 id=\"same16\" class=\"sybils\">Routers in the Same /16 (4 minimum)</h3>"); 660 665 List<Integer> foo = new ArrayList<Integer>(map.keySet()); 661 666 Collections.sort(foo, new FooComparator(map)); … … 669 674 String sip = i0 + "." + i1 + ".0.0/16"; 670 675 if (buf != null) { 671 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" floodfills with IP <a href=\"/netdb?ip=")676 buf.append("<p class=\"sybil_info\"><b>").append(count).append(" routers with IP <a href=\"/netdb?ip=") 672 677 .append(sip).append("&sybil\">").append(sip) 673 678 .append("</a></b></p>"); … … 687 692 */ 688 693 private void renderIPGroupsFamily(Writer out, StringBuilder buf, Map<String, List<RouterInfo>> map) throws IOException { 689 buf.append("<h3 id=\"samefamily\" class=\"sybils\"> Floodfills in the same Family</h3><div class=\"sybil_container\">");694 buf.append("<h3 id=\"samefamily\" class=\"sybils\">Routers in the same Family</h3><div class=\"sybil_container\">"); 690 695 List<String> foo = new ArrayList<String>(map.keySet()); 691 696 Collections.sort(foo, new FoofComparator(map)); … … 698 703 String ss = DataHelper.escapeHTML(s); 699 704 if (count > 1) { 700 buf.append("<p class=\"family\"><b>").append(count).append(" floodfills in family: <a href=\"/netdb?fam=")705 buf.append("<p class=\"family\"><b>").append(count).append(" routers in family: <a href=\"/netdb?fam=") 701 706 .append(ss).append("&sybil\">").append(ss).append("</a></b></p>"); 702 707 found = true; … … 829 834 if (kr != null) { 830 835 buf.append("<p><b>Routers:</b> ").append(DataHelper.stripHTML(kr)).append("</p>"); 831 } else {832 buf.append("<p class=\"sybil_filler\"><b>Routers:</b> ").append(_t("n/a")).append("</p>");836 //} else { 837 // buf.append("<p class=\"sybil_filler\"><b>Routers:</b> ").append(_t("n/a")).append("</p>"); 833 838 } 834 839 String kls = info.getOption("netdb.knownLeaseSets"); 835 840 if (kls != null) { 836 841 buf.append("<p class=\"sybilinfo_leasesets\"><b>").append(_t("LeaseSets")).append(":</b> ").append(DataHelper.stripHTML(kls)).append("</p>\n"); 837 } else {838 buf.append("<p class=\"sybilinfo_leasesets filler\"><b>").append(_t("LeaseSets")).append(":</b> ").append(_t("n/a")).append("</p>");842 //} else { 843 // buf.append("<p class=\"sybilinfo_leasesets filler\"><b>").append(_t("LeaseSets")).append(":</b> ").append(_t("n/a")).append("</p>"); 839 844 } 840 845 String fam = info.getOption("family"); … … 873 878 long age = Math.max(now - heard, 1); 874 879 buf.append("<p><b>").append(_t("Last Good Lookup")).append(":</b> ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("</p>"); 875 } else {876 buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Good Lookup")).append(":</b> ").append(_t("n/a")).append("</p>");880 //} else { 881 // buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Good Lookup")).append(":</b> ").append(_t("n/a")).append("</p>"); 877 882 } 878 883 heard = dbh.getLastLookupFailed(); … … 880 885 long age = Math.max(now - heard, 1); 881 886 buf.append("<p><b>").append(_t("Last Bad Lookup")).append(":</b> ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("</p>"); 882 } else {883 buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Bad Lookup")).append(":</b> ").append(_t("n/a")).append("</p>");887 //} else { 888 // buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Bad Lookup")).append(":</b> ").append(_t("n/a")).append("</p>"); 884 889 } 885 890 heard = dbh.getLastStoreSuccessful(); … … 887 892 long age = Math.max(now - heard, 1); 888 893 buf.append("<p><b>").append(_t("Last Good Store")).append(":</b> ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("</p>"); 889 } else {890 buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Good Store")).append(":</b> ").append(_t("n/a")).append("</p>");894 //} else { 895 // buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Good Store")).append(":</b> ").append(_t("n/a")).append("</p>"); 891 896 } 892 897 heard = dbh.getLastStoreFailed(); … … 894 899 long age = Math.max(now - heard, 1); 895 900 buf.append("<p><b>").append(_t("Last Bad Store")).append(":</b> ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("</p>"); 896 } else {897 buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Bad Store")).append(":</b> ").append(_t("n/a")).append("</p>");901 //} else { 902 // buf.append("<p class=\"sybil_filler\"><b>").append(_t("Last Bad Store")).append(":</b> ").append(_t("n/a")).append("</p>"); 898 903 } 899 904 } -
history.txt
r10354df rf2f5df0 1 2019-05-19 zzz 2 * Sybil: Run IP and family tests on all routers 3 4 2019-05-18 zzz 5 * Javadoc: fixes from FreeBSD ports 6 * Sybil: 7 - Option to run on non-floodfills too 8 - Show routers in analysis even if no RI available 9 - Date format and reason text fixes 10 - Add link to banlist 11 12 2019-05-15 zzz 13 * EepGet: Don't continue when requested a partial but didn't 14 get it, and the output is to a stream 15 * Streaming: Fix NPE in debug logging (ticket #2504) 16 17 2019-05-14 zzz 18 * Util: Don't set restrictive permissions on exported certs 19 1 20 2019-05-13 zzz 2 * Console: Hide transport table unless advanced 21 * Console: 22 - Hide transport table unless advanced 23 - Prevent editing a client while it's starting 3 24 * Sybil: Add support for auto-blocking 4 25 * Tunnels: Fix connection checker for NTCP2 -
router/java/src/net/i2p/router/RouterVersion.java
r10354df rf2f5df0 19 19 public final static String ID = "Monotone"; 20 20 public final static String VERSION = CoreVersion.VERSION; 21 public final static long BUILD = 3;21 public final static long BUILD = 4; 22 22 23 23 /** for example "-test" */
Note: See TracChangeset
for help on using the changeset viewer.