Author: toad
Date: 2008-04-19 15:16:00 +0000 (Sat, 19 Apr 2008)
New Revision: 19416

Modified:
   trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
Log:
Record connection type in a variable. Will use soon.

Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-04-19 
15:10:16 UTC (rev 19415)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-04-19 
15:16:00 UTC (rev 19416)
@@ -115,6 +115,7 @@
        private final MyUserAlert symmetricAlert;
        private final MyUserAlert portRestrictedAlert;
        private final MyUserAlert restrictedAlert;
+       private short connectionType;
        private ProxyUserAlert proxyAlert;
        private boolean started;

@@ -647,17 +648,22 @@
                                if(countClosed > 0 && (countOpen + 
countFullCone + countRestricted + countPortRestricted + countSymmetric) == 0) {
                                        proxyAlert.setAlert(noConnectionAlert);
                                        proxyAlert.isValid(true);
+                                       connectionType = DetectedIP.NO_UDP;
                                } else if(countSymmetric > 0 && (countOpen + 
countFullCone + countRestricted + countPortRestricted == 0)) {
                                        proxyAlert.setAlert(symmetricAlert);
                                        proxyAlert.isValid(true);
+                                       connectionType = 
DetectedIP.SYMMETRIC_NAT;
                                } else if(countPortRestricted > 0 && (countOpen 
+ countFullCone + countRestricted == 0)) {
                                        
proxyAlert.setAlert(portRestrictedAlert);
                                        proxyAlert.isValid(true);
+                                       connectionType = 
DetectedIP.PORT_RESTRICTED_NAT;
                                } else if(countRestricted > 0 && (countOpen + 
countFullCone == 0)) {
                                        proxyAlert.setAlert(restrictedAlert);
                                        proxyAlert.isValid(true);
+                                       connectionType = 
DetectedIP.RESTRICTED_CONE_NAT;
                                } else if(countFullCone > 0 && countOpen == 0) {
                                        proxyAlert.isValid(false);
+                                       connectionType = 
DetectedIP.FULL_CONE_NAT;
                                } else if(countOpen > 0) {
                                        proxyAlert.isValid(false);
                                }


Reply via email to