Changeset eb8178ea for apps


Ignore:
Timestamp:
Dec 17, 2018 11:46:14 AM (19 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
35a771c7
Parents:
3867beb1
Message:

Sybil: Linkify IP reasons
Adjust IP points

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java

    r3867beb1 reb8178ea  
    6868    private static final double POINTS32 = 5.0;
    6969    // multiplied by size - 1, will also get POINTS16 added
    70     private static final double POINTS24 = 5.0;
     70    private static final double POINTS24 = 4.0;
    7171    // multiplied by size - 1
    7272    private static final double POINTS16 = 0.25;
    7373    private static final double POINTS_US32 = 25.0;
    74     private static final double POINTS_US24 = 25.0;
     74    private static final double POINTS_US24 = 20.0;
    7575    private static final double POINTS_US16 = 10.0;
    7676    private static final double POINTS_FAMILY = -10.0;
     
    422422                return;
    423423        }
     424        String reason32 = "Same IP as <a href=\"/netdb?ip=" +
     425                          ourIP[0] + '.' + ourIP[1] + '.' + ourIP[2] + '.' + ourIP[3] + "&amp;sybil\">us</a>";
     426        String reason24 = "Same /24 IP as <a href=\"/netdb?ip=" +
     427                          ourIP[0] + '.' + ourIP[1] + '.' + ourIP[2] + ".0/24&amp;sybil\">us</a>";
     428        String reason16 = "Same /16 IP as <a href=\"/netdb?ip=" +
     429                          ourIP[0] + '.' + ourIP[1] + ".0.0/16&amp;sybil\">us</a>";
    424430        for (RouterInfo info : ris) {
    425431            byte[] ip = getIP(info);
     
    429435                if (ip[2] == ourIP[2]) {
    430436                    if (ip[3] == ourIP[3]) {
    431                         addPoints(points, info.getHash(), POINTS_US32, "Same IP as us");
     437                        addPoints(points, info.getHash(), POINTS_US32, reason32);
    432438                        ri32.add(info);
    433439                    } else {
    434                         addPoints(points, info.getHash(), POINTS_US24, "Same /24 as us");
     440                        addPoints(points, info.getHash(), POINTS_US24, reason24);
    435441                        ri24.add(info);
    436442                    }
    437443                } else {
    438                     addPoints(points, info.getHash(), POINTS_US16, "Same /16 as us");
     444                    addPoints(points, info.getHash(), POINTS_US16, reason16);
    439445                    ri16.add(info);
    440446                }
     
    470476            int i2 = (i >> 8) & 0xff;
    471477            int i3 = i & 0xff;
    472             String reason = "Same IP with " + (count - 1) + " other" + (( count > 2) ? "s" : "");
     478            String reason = "Same IP with <a href=\"/netdb?ip=" +
     479                            i0 + '.' + i1 + '.' + i2 + '.' + i3 + "&amp;sybil\">" +
     480                            (count - 1) + " other" + (( count > 2) ? "s" : "") + "</a>";
    473481            for (RouterInfo info : ris) {
    474482                byte[] ip = getIP(info);
     
    516524            int i1 = (i >> 8) & 0xff;
    517525            int i2 = i & 0xff;
    518             String reason = "Same /24 IP with " + (count - 1) + " other" + (( count > 2) ? "s" : "");
     526            String reason = "Same /24 IP with <a href=\"/netdb?ip=" +
     527                            i0 + '.' + i1 + '.' + i2 + ".0/24&amp;sybil\">" +
     528                            (count - 1) + " other" + (( count > 2) ? "s" : "") + "</a>";
    519529            for (RouterInfo info : ris) {
    520530                byte[] ip = getIP(info);
     
    559569            int i0 = i >> 8;
    560570            int i1 = i & 0xff;
    561             String reason = "Same /16 IP with " + (count - 1) + " other" + (( count > 2) ? "s" : "");
     571            String reason = "Same /16 IP with <a href=\"/netdb?ip=" +
     572                            i0 + '.' + i1 + ".0.0/16&amp;sybil\">" +
     573                            (count - 1) + " other" + (( count > 2) ? "s" : "") + "</a>";
    562574            for (RouterInfo info : ris) {
    563575                byte[] ip = getIP(info);
Note: See TracChangeset for help on using the changeset viewer.