mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-22 16:09:18 -04:00
Bugfixes and testing of ConnectionLogic.
* Added Proxy UdpStack Restrictions for use with testing script. * Added ConnectionLogic (ConnectStateBox) to each Peer. * Wired in Connection Logic... Ask it what type of connection to make, feedback on errors. * Moved ConnectionRequest Stop/Restart to Actions (Mutex Deadlock Bug). * Added Display of ConnectionLogic to GUI. * Expect there will be other bugs, etc but hard to find at the moment. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-peernet@4379 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bcac21e580
commit
7d653d0aa4
@ -1,500 +1,500 @@
|
||||
71.64.109.64 54232
|
||||
216.108.187.36 22975
|
||||
140.122.103.182 13143
|
||||
88.186.107.212 8660
|
||||
84.3.163.246 44384
|
||||
92.37.54.96 11558
|
||||
94.21.92.231 38888
|
||||
78.8.66.173 25367
|
||||
83.230.136.117 13910
|
||||
66.229.58.188 43794
|
||||
46.211.230.178 15475
|
||||
213.113.105.94 38453
|
||||
92.81.13.245 39663
|
||||
88.125.45.122 30097
|
||||
92.133.95.85 52910
|
||||
85.210.38.111 15658
|
||||
114.17.132.233 19663
|
||||
88.104.22.104 27257
|
||||
109.9.10.137 18441
|
||||
217.27.42.102 63452
|
||||
92.44.86.3 16896
|
||||
84.228.48.61 10335
|
||||
81.232.49.39 16471
|
||||
188.18.63.93 23310
|
||||
173.186.45.157 37950
|
||||
76.200.122.172 55578
|
||||
94.213.103.5 37531
|
||||
92.142.169.56 13452
|
||||
80.202.97.14 64178
|
||||
85.66.15.212 40149
|
||||
79.83.138.75 43384
|
||||
76.20.98.207 37009
|
||||
78.144.232.59 57786
|
||||
86.30.240.5 55315
|
||||
85.210.38.111 15685
|
||||
189.155.48.178 14898
|
||||
74.13.82.14 23671
|
||||
89.217.155.87 51413
|
||||
83.240.122.86 20710
|
||||
117.195.46.183 50932
|
||||
193.231.163.24 20385
|
||||
112.140.12.221 10677
|
||||
189.235.140.51 27844
|
||||
121.169.204.131 23467
|
||||
92.81.221.104 51868
|
||||
89.211.184.120 38643
|
||||
62.201.84.120 36698
|
||||
175.110.122.13 16029
|
||||
84.43.183.51 27571
|
||||
85.210.38.111 15692
|
||||
85.210.38.111 15666
|
||||
131.123.1.227 55013
|
||||
78.72.37.248 58953
|
||||
85.210.38.111 15638
|
||||
85.210.38.111 15667
|
||||
85.210.38.111 15620
|
||||
95.211.8.11 1140
|
||||
88.178.72.2 7812
|
||||
85.210.38.111 15728
|
||||
189.129.2.99 23463
|
||||
85.210.38.111 15674
|
||||
76.107.46.7 16170
|
||||
85.210.38.111 15808
|
||||
211.217.145.63 58587
|
||||
110.55.23.91 20417
|
||||
2.82.216.224 28160
|
||||
85.210.38.111 15612
|
||||
85.210.38.111 15774
|
||||
85.210.38.111 15681
|
||||
85.210.38.111 15593
|
||||
85.210.38.111 15631
|
||||
78.58.1.213 39032
|
||||
93.96.27.58 58144
|
||||
85.210.38.111 15682
|
||||
85.210.38.111 15590
|
||||
85.210.38.111 15603
|
||||
85.21.159.120 33978
|
||||
85.210.38.111 15632
|
||||
85.210.38.111 15597
|
||||
85.210.38.111 15644
|
||||
76.105.119.12 51907
|
||||
61.36.189.19 28156
|
||||
82.44.220.175 17627
|
||||
71.235.255.153 42753
|
||||
173.180.193.221 45097
|
||||
118.175.28.40 62040
|
||||
62.68.146.175 35691
|
||||
91.179.145.10 33893
|
||||
109.70.52.238 44500
|
||||
81.9.142.95 18940
|
||||
80.95.21.118 42418
|
||||
142.68.150.203 25265
|
||||
109.124.82.91 16013
|
||||
142.68.95.81 19369
|
||||
108.28.196.97 29891
|
||||
123.178.142.202 17496
|
||||
78.100.236.49 40809
|
||||
89.134.230.77 62153
|
||||
95.34.58.144 48642
|
||||
99.241.83.62 1723
|
||||
31.47.172.92 1044
|
||||
67.188.133.52 41610
|
||||
144.85.175.55 51319
|
||||
79.105.169.154 22075
|
||||
186.206.12.33 8291
|
||||
85.235.253.178 15010
|
||||
88.149.180.60 51414
|
||||
78.112.75.247 16969
|
||||
83.128.120.21 51431
|
||||
79.135.216.60 51652
|
||||
164.8.221.24 31547
|
||||
188.95.214.180 25538
|
||||
95.30.219.148 46630
|
||||
50.90.175.187 60001
|
||||
24.3.223.212 43041
|
||||
68.93.74.85 25378
|
||||
76.174.241.230 59344
|
||||
125.59.156.33 32401
|
||||
124.244.217.44 50221
|
||||
187.0.225.7 60317
|
||||
86.28.116.226 2668
|
||||
130.243.191.202 24410
|
||||
93.103.72.182 49529
|
||||
77.80.249.28 32894
|
||||
109.207.196.189 14146
|
||||
90.149.130.169 39191
|
||||
107.10.32.153 6881
|
||||
71.203.222.193 11243
|
||||
79.131.185.51 28886
|
||||
174.42.210.123 35053
|
||||
120.51.210.154 443
|
||||
213.107.66.202 41381
|
||||
62.165.228.234 24958
|
||||
217.197.6.47 30000
|
||||
93.152.129.100 26707
|
||||
86.106.214.64 35691
|
||||
77.78.172.9 23574
|
||||
85.15.70.92 53210
|
||||
78.139.231.192 50734
|
||||
93.132.90.224 5188
|
||||
174.1.101.83 9406
|
||||
187.127.72.162 21380
|
||||
1.175.139.234 27959
|
||||
200.86.205.61 34635
|
||||
91.116.191.138 4662
|
||||
221.24.70.141 61625
|
||||
84.40.83.186 1660
|
||||
217.211.244.154 24932
|
||||
94.101.207.170 62580
|
||||
178.222.42.90 29384
|
||||
78.229.223.205 36531
|
||||
69.59.103.85 22750
|
||||
77.232.20.26 43250
|
||||
190.44.21.47 17082
|
||||
65.94.96.85 48004
|
||||
27.32.111.217 40217
|
||||
79.113.248.160 59750
|
||||
77.41.71.131 43240
|
||||
79.164.138.217 20214
|
||||
84.0.14.117 34245
|
||||
46.9.235.202 6881
|
||||
178.235.29.152 41661
|
||||
134.106.236.63 7584
|
||||
188.26.171.65 37450
|
||||
213.245.73.220 15641
|
||||
90.191.77.198 44825
|
||||
69.122.99.119 54701
|
||||
98.64.93.81 46213
|
||||
111.250.168.97 22261
|
||||
109.251.146.80 51027
|
||||
76.216.226.150 34974
|
||||
184.166.168.30 35691
|
||||
67.162.186.239 28803
|
||||
189.1.29.210 65123
|
||||
124.8.223.131 16880
|
||||
61.18.255.9 50239
|
||||
114.45.68.143 8856
|
||||
85.210.38.111 15779
|
||||
93.183.216.171 16220
|
||||
82.226.181.145 43643
|
||||
99.99.189.213 10061
|
||||
119.74.167.148 20643
|
||||
88.189.63.143 20348
|
||||
77.28.179.245 48808
|
||||
88.187.80.252 49180
|
||||
99.66.229.86 30732
|
||||
186.136.77.234 14974
|
||||
60.48.219.49 16407
|
||||
93.12.199.146 50797
|
||||
119.15.212.95 9787
|
||||
123.2.57.90 18763
|
||||
24.1.118.110 27704
|
||||
77.241.136.193 48402
|
||||
81.228.144.87 48865
|
||||
24.79.172.54 20661
|
||||
201.95.29.34 20932
|
||||
60.51.122.36 16881
|
||||
87.250.168.72 26497
|
||||
81.4.163.154 48066
|
||||
85.210.38.111 15613
|
||||
122.118.26.19 24793
|
||||
85.210.38.111 15780
|
||||
124.191.35.38 50369
|
||||
85.210.38.111 15781
|
||||
92.82.7.149 10012
|
||||
71.134.235.168 61174
|
||||
78.111.155.17 52231
|
||||
46.118.187.55 6881
|
||||
213.198.217.131 25239
|
||||
63.231.105.59 54299
|
||||
222.114.167.31 53805
|
||||
180.227.14.115 50954
|
||||
83.99.188.48 21652
|
||||
41.104.111.91 53365
|
||||
178.122.180.142 11282
|
||||
177.16.42.113 18622
|
||||
86.121.69.59 21067
|
||||
148.247.198.46 24217
|
||||
85.102.228.132 24513
|
||||
112.166.47.94 14355
|
||||
112.119.176.192 9409
|
||||
109.74.32.64 16881
|
||||
46.147.202.153 35691
|
||||
95.42.221.75 45296
|
||||
86.11.249.138 31097
|
||||
195.26.74.158 16881
|
||||
125.38.181.106 3840
|
||||
77.223.238.155 63653
|
||||
46.0.136.44 35191
|
||||
89.204.107.115 25932
|
||||
202.63.102.162 22775
|
||||
60.7.42.143 3283
|
||||
77.92.195.183 35095
|
||||
90.198.23.14 14394
|
||||
111.216.5.71 37940
|
||||
41.104.51.189 22531
|
||||
118.161.129.127 12299
|
||||
114.41.1.125 23820
|
||||
91.67.135.122 59365
|
||||
189.214.120.143 5890
|
||||
189.115.23.131 10005
|
||||
140.116.247.137 8080
|
||||
77.37.213.182 46296
|
||||
76.69.130.253 44260
|
||||
109.10.159.15 21
|
||||
190.78.80.17 22103
|
||||
119.237.65.197 2623
|
||||
178.128.0.81 32789
|
||||
91.202.57.117 53318
|
||||
95.49.18.161 25449
|
||||
79.168.246.214 24615
|
||||
74.107.113.205 10008
|
||||
188.2.156.178 9673
|
||||
41.207.162.253 21343
|
||||
77.239.83.245 22374
|
||||
94.253.177.12 40292
|
||||
178.66.183.42 45633
|
||||
77.85.179.196 12274
|
||||
77.35.26.108 49354
|
||||
1.177.237.5 58311
|
||||
79.134.14.178 35691
|
||||
138.217.123.182 51477
|
||||
75.27.34.243 39235
|
||||
110.169.243.238 23128
|
||||
187.37.194.5 21382
|
||||
68.106.247.212 6881
|
||||
68.112.241.213 34387
|
||||
89.134.55.244 15058
|
||||
61.84.117.252 60963
|
||||
2.220.162.111 53282
|
||||
79.119.248.198 22358
|
||||
84.10.90.86 19104
|
||||
94.65.87.146 59481
|
||||
122.159.12.92 16001
|
||||
213.21.41.24 40562
|
||||
109.173.96.112 35100
|
||||
94.172.217.223 17964
|
||||
61.228.60.110 14299
|
||||
122.117.34.73 16868
|
||||
95.58.178.137 28454
|
||||
217.65.215.64 7578
|
||||
114.47.133.205 18087
|
||||
195.132.125.205 58609
|
||||
94.78.166.25 64097
|
||||
89.74.188.242 48998
|
||||
219.70.23.192 16001
|
||||
118.167.129.245 15340
|
||||
97.126.250.159 58823
|
||||
122.198.0.39 32333
|
||||
187.113.129.127 28340
|
||||
78.96.19.208 40067
|
||||
110.36.106.100 56733
|
||||
79.114.113.155 48213
|
||||
81.183.235.110 59308
|
||||
115.252.166.81 28799
|
||||
109.184.246.99 41159
|
||||
80.185.100.186 36300
|
||||
83.134.13.178 24260
|
||||
92.136.70.158 7812
|
||||
86.74.144.157 18016
|
||||
93.89.219.27 35691
|
||||
213.64.147.104 25713
|
||||
82.247.62.105 14631
|
||||
84.25.136.120 39508
|
||||
85.96.200.210 17602
|
||||
77.253.191.143 23598
|
||||
83.49.171.94 60137
|
||||
76.20.152.219 35615
|
||||
217.211.28.69 64842
|
||||
201.170.142.19 19842
|
||||
68.47.208.139 11645
|
||||
67.159.140.209 52925
|
||||
201.80.100.150 31959
|
||||
68.40.183.50 29568
|
||||
113.20.214.117 6881
|
||||
85.246.169.20 61458
|
||||
221.10.120.47 1510
|
||||
71.62.179.244 35234
|
||||
119.10.187.164 41857
|
||||
98.211.84.52 55645
|
||||
84.72.241.228 6882
|
||||
69.236.64.157 11003
|
||||
188.36.221.211 40954
|
||||
90.219.70.211 34003
|
||||
79.130.124.217 10009
|
||||
68.84.225.205 18566
|
||||
77.108.237.142 11525
|
||||
194.176.179.137 22588
|
||||
205.200.19.34 62304
|
||||
178.254.217.169 17854
|
||||
2.95.84.209 35691
|
||||
46.109.72.108 52451
|
||||
78.106.47.104 27165
|
||||
76.90.82.217 46536
|
||||
65.48.198.101 21735
|
||||
85.27.14.200 8655
|
||||
78.113.59.177 19374
|
||||
112.165.44.251 26681
|
||||
72.184.55.157 17056
|
||||
87.231.122.198 34748
|
||||
119.247.113.233 6881
|
||||
187.55.80.160 18535
|
||||
211.63.211.73 14721
|
||||
220.83.152.209 11101
|
||||
183.1.203.151 48821
|
||||
78.80.103.216 12502
|
||||
78.90.3.147 20991
|
||||
81.156.27.108 10601
|
||||
79.117.118.224 27130
|
||||
78.83.142.145 37085
|
||||
108.6.187.147 53470
|
||||
84.209.97.115 12028
|
||||
83.83.233.105 6881
|
||||
80.9.165.141 8724
|
||||
74.194.170.32 11903
|
||||
91.135.83.20 27710
|
||||
70.79.250.0 6881
|
||||
96.49.121.156 10500
|
||||
174.58.73.68 47154
|
||||
88.170.61.126 7465
|
||||
83.114.40.86 12181
|
||||
99.40.158.73 64657
|
||||
121.135.163.124 18453
|
||||
218.201.132.179 12276
|
||||
86.5.105.58 32357
|
||||
61.250.204.138 43188
|
||||
77.198.80.163 46737
|
||||
89.178.249.72 5342
|
||||
173.66.220.53 26410
|
||||
68.48.57.16 41404
|
||||
66.215.78.66 26076
|
||||
92.115.174.101 5210
|
||||
173.74.176.86 58836
|
||||
74.160.0.60 24216
|
||||
93.75.28.168 6881
|
||||
109.86.244.128 22601
|
||||
71.57.140.163 38370
|
||||
99.225.74.134 25391
|
||||
178.48.128.162 65500
|
||||
213.226.141.44 17349
|
||||
182.171.147.127 52617
|
||||
188.83.226.64 23544
|
||||
187.65.86.54 26781
|
||||
99.229.201.27 22234
|
||||
178.148.65.137 63218
|
||||
114.47.71.8 52227
|
||||
83.251.38.233 51057
|
||||
182.52.79.237 21483
|
||||
186.18.217.18 10184
|
||||
186.207.6.40 47694
|
||||
77.253.224.104 40000
|
||||
188.36.240.71 15000
|
||||
188.26.52.12 54236
|
||||
94.158.118.218 56928
|
||||
109.99.143.25 63839
|
||||
174.126.88.166 62042
|
||||
174.117.18.121 29165
|
||||
76.18.99.213 43018
|
||||
83.194.33.215 25368
|
||||
86.164.140.196 54803
|
||||
205.250.15.162 25183
|
||||
94.174.75.115 9090
|
||||
64.231.100.55 39169
|
||||
189.106.33.97 27118
|
||||
24.93.27.23 26814
|
||||
86.89.210.214 27419
|
||||
188.27.120.42 26668
|
||||
83.167.27.91 60000
|
||||
67.193.129.117 40817
|
||||
178.118.87.191 27161
|
||||
90.190.222.230 48093
|
||||
88.114.90.129 18810
|
||||
85.232.137.70 15896
|
||||
88.119.225.69 27171
|
||||
76.25.35.43 54187
|
||||
99.181.196.79 34736
|
||||
2.225.87.185 28025
|
||||
91.191.254.190 3811
|
||||
173.75.30.89 21636
|
||||
85.254.185.36 52764
|
||||
182.52.79.237 21533
|
||||
59.134.84.225 14942
|
||||
83.252.188.244 54259
|
||||
86.205.169.47 39127
|
||||
98.249.233.45 45985
|
||||
74.100.179.184 49471
|
||||
173.168.202.85 61631
|
||||
89.32.51.54 45606
|
||||
89.86.231.225 51246
|
||||
109.150.148.177 40217
|
||||
85.24.194.204 42261
|
||||
95.84.245.149 6881
|
||||
76.20.34.156 56008
|
||||
183.83.240.100 43891
|
||||
82.238.219.224 33675
|
||||
213.60.180.217 51389
|
||||
119.173.75.141 44996
|
||||
122.135.151.209 24958
|
||||
117.205.57.31 17600
|
||||
93.183.223.132 40277
|
||||
89.83.42.213 55000
|
||||
217.131.145.77 48065
|
||||
78.57.146.231 9089
|
||||
24.25.140.197 6881
|
||||
82.192.94.231 59802
|
||||
174.115.134.229 49120
|
||||
78.70.48.141 63284
|
||||
212.187.57.167 22519
|
||||
71.150.249.60 6881
|
||||
70.246.129.88 29149
|
||||
75.140.78.2 25574
|
||||
186.215.32.126 28335
|
||||
98.233.112.222 37573
|
||||
207.118.107.217 52500
|
||||
183.83.54.62 56577
|
||||
46.118.12.201 64484
|
||||
184.53.75.136 4326
|
||||
66.91.102.103 5000
|
||||
123.205.2.171 20267
|
||||
27.33.151.108 55898
|
||||
122.117.141.232 13178
|
||||
96.51.213.146 43105
|
||||
83.193.167.63 7812
|
||||
174.95.47.107 52029
|
||||
82.224.29.176 6881
|
||||
78.47.253.244 55702
|
||||
93.79.37.75 64689
|
||||
95.169.46.114 8073
|
||||
92.37.35.190 23943
|
||||
46.5.108.156 56098
|
||||
86.111.64.126 20454
|
||||
79.164.174.152 42455
|
||||
88.127.124.1 9528
|
||||
173.193.51.4 15005
|
||||
96.19.179.165 57725
|
||||
90.23.154.90 33686
|
||||
24.12.58.44 54819
|
||||
82.228.100.170 15735
|
||||
99.68.127.236 33246
|
||||
76.200.225.244 51413
|
||||
190.47.19.233 6881
|
||||
99.237.90.129 25474
|
||||
59.104.173.154 8002
|
||||
219.126.192.37 16672
|
||||
78.136.101.45 23309
|
||||
173.192.207.62 59239
|
||||
109.121.211.97 41343
|
||||
46.161.169.83 51075
|
||||
88.201.184.128 57471
|
||||
77.93.17.23 61412
|
||||
186.6.131.219 37853
|
||||
78.128.88.249 12189
|
||||
75.84.168.217 28946
|
||||
76.126.150.143 57044
|
||||
67.193.181.102 50079
|
||||
107.5.208.239 22652
|
||||
85.230.113.107 57665
|
||||
96.251.130.4 52217
|
||||
96.51.57.107 22440
|
||||
201.252.212.200 13719
|
||||
108.42.6.68 50879
|
||||
85.170.55.159 15641
|
||||
92.11.179.213 26942
|
||||
212.224.185.6 51173
|
||||
65.92.143.23 19394
|
||||
24.64.255.14 41791
|
||||
85.187.122.154 27656
|
||||
220.215.124.77 61112
|
||||
75.118.119.105 30247
|
||||
178.125.234.142 35691
|
||||
124.244.43.30 38258
|
||||
193.106.201.235 45086
|
||||
93.73.36.206 16492
|
||||
111.240.51.86 9344
|
||||
94.168.80.79 37652
|
||||
186.220.230.90 14825
|
||||
77.21.86.170 9464
|
||||
84.208.60.162 37692
|
||||
92.50.80.105 49232
|
||||
200.206.196.18 38972
|
||||
80.57.236.73 44357
|
||||
85.210.38.111 15790
|
||||
151.83.37.110 58558
|
||||
85.210.38.111 15610
|
||||
77.34.110.130 13687
|
||||
85.210.38.111 15794
|
||||
85.210.38.111 15669
|
||||
65.34.76.217 62453
|
||||
213.150.55.196 15030
|
||||
84.29.225.174 6881
|
||||
94.196.193.82 39512
|
||||
60.8.87.30 12543
|
||||
85.210.38.111 15615
|
||||
46.164.30.196 19818
|
||||
46.183.2.146 37299
|
||||
79.92.2.217 43791
|
||||
85.210.38.111 15617
|
||||
213.60.50.230 39805
|
||||
83.239.183.218 46153
|
||||
121.7.22.119 36748
|
||||
176.14.115.172 52218
|
||||
173.61.88.200 59733
|
||||
70.31.157.90 16667
|
||||
85.210.38.111 15751
|
||||
84.228.209.103 56467
|
||||
124.244.43.30 48033
|
||||
188.4.223.46 56420
|
||||
173.66.20.234 6881
|
||||
81.236.195.180 18203
|
||||
151.27.33.148 10016
|
||||
24.64.255.14 42832
|
||||
85.210.38.111 15594
|
||||
85.210.38.111 15706
|
||||
85.210.38.111 15784
|
||||
70.140.96.89 39408
|
||||
85.210.38.111 15626
|
||||
78.101.171.111 32349
|
||||
81.152.33.128 60371
|
||||
79.119.95.94 46983
|
||||
84.41.72.126 49059
|
||||
200.96.131.61 11189
|
||||
91.217.91.11 39192
|
||||
157.157.203.120 60474
|
||||
96.48.200.166 29285
|
||||
2.102.201.65 56665
|
||||
125.26.253.83 32071
|
||||
111.192.15.183 16001
|
||||
74.56.99.15 30046
|
||||
85.210.38.111 15694
|
||||
213.111.220.24 60004
|
||||
78.244.100.110 51623
|
||||
85.235.24.51 51413
|
||||
85.210.38.111 15599
|
||||
86.95.163.76 52413
|
||||
76.226.84.74 26334
|
||||
85.210.38.111 15625
|
||||
119.155.117.63 51550
|
||||
85.210.38.111 15662
|
||||
195.34.242.110 35352
|
||||
194.112.217.73 11279
|
||||
142.161.198.77 44740
|
||||
89.240.201.241 10371
|
||||
82.232.0.124 9156
|
||||
80.234.99.71 21756
|
||||
112.225.28.127 16001
|
||||
85.210.38.111 15697
|
||||
75.138.42.54 6881
|
||||
71.136.39.215 1171
|
||||
85.210.38.111 15585
|
||||
85.210.38.111 15704
|
||||
58.115.83.248 15959
|
||||
90.142.190.91 49688
|
||||
85.210.38.111 15665
|
||||
85.210.38.111 15712
|
||||
85.210.38.111 15715
|
||||
85.210.38.111 15641
|
||||
187.149.168.72 25300
|
||||
1.160.232.123 18254
|
||||
85.210.38.111 15623
|
||||
85.210.38.111 15647
|
||||
216.110.99.160 16749
|
||||
85.210.38.111 15679
|
||||
99.116.4.75 35916
|
||||
122.19.243.220 48788
|
||||
122.133.5.65 47338
|
||||
218.166.126.94 17175
|
||||
61.178.17.210 15152
|
||||
77.242.145.133 51413
|
||||
82.254.41.81 57189
|
||||
173.217.246.214 13494
|
||||
46.118.224.174 63196
|
||||
80.186.135.251 37585
|
||||
85.210.38.111 15713
|
||||
109.94.66.154 62185
|
||||
188.2.33.6 47050
|
||||
89.89.18.218 13783
|
||||
68.193.187.110 39233
|
||||
151.15.11.42 35363
|
||||
220.241.211.145 33830
|
||||
84.209.76.94 39078
|
||||
68.174.120.114 50424
|
||||
85.210.38.111 15608
|
||||
85.210.38.111 15643
|
||||
142.167.140.26 45059
|
||||
85.210.38.111 15671
|
||||
85.210.38.111 15708
|
||||
89.77.18.144 57420
|
||||
78.159.38.59 41621
|
||||
87.56.51.50 39107
|
||||
2.50.21.232 53135
|
||||
85.210.38.111 15604
|
||||
151.20.181.199 39886
|
||||
85.210.38.111 15711
|
||||
182.64.118.74 11244
|
||||
85.210.38.111 15607
|
||||
213.16.121.172 7380
|
||||
90.216.117.77 26903
|
||||
77.206.26.166 49807
|
||||
124.169.135.216 20627
|
||||
85.210.38.111 15652
|
||||
85.210.38.111 15621
|
||||
123.238.65.20 60431
|
||||
85.210.38.111 15655
|
||||
134.106.236.73 32092
|
||||
85.210.38.111 15660
|
||||
67.45.198.80 10275
|
||||
85.210.38.111 15677
|
||||
85.210.38.111 15605
|
||||
85.210.38.111 15614
|
||||
78.96.192.198 20544
|
||||
178.122.91.204 50491
|
||||
82.244.203.153 21428
|
||||
95.166.77.224 51413
|
||||
79.111.48.157 42921
|
||||
109.63.170.93 51767
|
||||
124.180.53.163 24425
|
||||
85.210.38.111 15709
|
||||
88.162.79.68 12574
|
||||
188.226.4.247 61384
|
||||
96.3.14.184 14029
|
||||
66.177.245.122 10328
|
||||
125.178.8.35 51413
|
||||
85.210.38.111 15691
|
||||
178.203.129.209 47916
|
||||
121.16.195.218 33700
|
||||
96.254.114.126 26982
|
||||
70.65.69.190 61162
|
||||
189.26.147.115 23755
|
||||
113.53.178.125 11685
|
||||
98.14.74.49 50918
|
||||
87.126.123.205 55118
|
||||
77.77.59.2 7868
|
||||
24.162.155.137 23221
|
||||
69.111.152.82 58513
|
||||
93.106.57.71 17012
|
||||
126.10.205.181 26408
|
||||
91.66.51.19 4636
|
||||
95.211.8.11 19632
|
||||
77.23.38.175 36008
|
||||
62.147.204.92 7812
|
||||
202.161.27.236 29020
|
||||
91.66.51.19 33548
|
||||
178.203.144.149 18216
|
||||
85.210.38.111 15645
|
||||
77.120.20.53 19094
|
||||
88.170.1.199 60144
|
||||
69.125.102.230 64736
|
||||
85.210.38.111 15701
|
||||
142.177.163.124 24663
|
||||
212.15.159.70 52349
|
||||
77.70.96.130 14146
|
||||
221.190.131.95 46545
|
||||
182.64.117.176 19106
|
||||
81.53.57.54 27721
|
||||
93.21.120.104 50100
|
||||
87.229.13.157 51888
|
||||
174.5.200.186 22115
|
||||
201.210.6.209 15475
|
||||
85.210.38.111 15722
|
||||
77.37.236.54 6881
|
||||
79.114.69.125 12563
|
||||
201.43.14.4 17607
|
||||
220.145.224.43 51188
|
||||
201.15.217.137 38971
|
||||
221.202.84.134 8793
|
||||
85.210.38.111 15723
|
||||
201.78.165.4 58026
|
||||
86.150.142.72 49740
|
||||
46.47.102.170 6881
|
||||
219.79.181.184 35997
|
||||
85.210.38.111 15664
|
||||
89.181.200.105 21518
|
||||
67.160.20.111 46292
|
||||
187.39.23.126 22015
|
||||
95.165.134.29 55258
|
||||
85.247.202.169 32566
|
||||
75.25.147.26 51413
|
||||
85.210.38.111 15737
|
||||
89.157.128.104 33931
|
||||
94.41.220.97 61538
|
||||
50.22.214.88 15003
|
||||
188.95.111.46 41736
|
||||
2.226.2.251 46917
|
||||
85.241.42.187 45224
|
||||
91.154.8.204 44742
|
||||
77.35.141.3 33457
|
||||
85.210.38.111 15690
|
||||
86.135.109.40 17662
|
||||
88.189.82.239 5666
|
||||
85.210.38.111 15739
|
||||
217.24.244.196 46851
|
||||
94.27.71.210 38180
|
||||
88.148.38.107 23695
|
||||
114.32.10.189 6882
|
||||
190.177.150.208 61830
|
||||
85.210.38.111 15627
|
||||
85.210.38.111 15640
|
||||
59.113.155.14 21775
|
||||
88.161.167.243 18722
|
||||
76.122.32.160 13272
|
||||
85.210.38.111 15648
|
||||
85.210.38.111 15747
|
||||
85.210.38.111 15606
|
||||
92.154.124.137 47816
|
||||
213.22.190.219 59746
|
||||
67.167.245.246 63188
|
||||
24.7.144.73 29585
|
||||
178.46.48.131 22442
|
||||
218.67.244.18 18119
|
||||
189.61.101.171 44535
|
||||
85.210.38.111 15591
|
||||
83.20.118.241 14433
|
||||
77.100.181.253 53042
|
||||
85.210.38.111 15668
|
||||
95.78.238.94 54157
|
||||
201.75.12.64 8599
|
||||
86.6.193.240 59203
|
||||
85.210.38.111 15628
|
||||
95.211.8.11 25896
|
||||
134.106.236.73 32092
|
||||
93.12.186.53 7448
|
||||
81.250.94.233 2050
|
||||
80.101.24.220 17413
|
||||
88.187.80.252 49180
|
||||
67.188.133.52 32812
|
||||
76.187.211.94 59425
|
||||
92.142.53.56 13452
|
||||
95.90.231.148 35420
|
||||
95.166.163.71 34214
|
||||
174.101.19.253 45308
|
||||
46.107.251.60 13555
|
||||
46.29.212.182 55891
|
||||
71.196.190.111 48809
|
||||
115.39.225.24 22322
|
||||
71.56.254.96 28491
|
||||
94.230.142.72 15967
|
||||
75.11.13.125 16441
|
||||
122.167.115.90 55535
|
||||
82.44.220.175 17627
|
||||
123.211.204.154 28794
|
||||
69.171.117.124 35159
|
||||
92.47.114.215 17884
|
||||
84.102.235.80 49202
|
||||
92.47.119.126 21412
|
||||
82.66.205.209 1234
|
||||
84.249.91.123 22749
|
||||
95.15.208.86 11044
|
||||
95.154.160.150 27297
|
||||
86.82.231.195 61883
|
||||
94.178.44.126 10003
|
||||
65.96.149.154 11664
|
||||
67.10.217.54 45866
|
||||
178.200.226.89 32663
|
||||
89.106.255.92 59854
|
||||
95.24.170.75 51522
|
||||
98.222.92.217 40230
|
||||
64.121.243.186 15725
|
||||
24.2.58.9 37625
|
||||
190.227.59.100 25027
|
||||
122.254.44.150 11407
|
||||
77.93.28.4 11766
|
||||
79.171.123.69 58597
|
||||
85.138.169.3 30736
|
||||
92.249.205.73 54856
|
||||
89.46.85.200 13665
|
||||
209.65.245.209 37629
|
||||
69.196.151.162 60772
|
||||
84.236.177.181 32282
|
||||
123.181.65.251 1968
|
||||
183.179.96.113 59339
|
||||
203.128.187.92 42623
|
||||
82.244.203.153 21428
|
||||
46.159.108.52 19701
|
||||
190.193.154.92 11887
|
||||
188.27.67.230 59898
|
||||
188.231.163.149 47983
|
||||
109.165.92.50 59138
|
||||
46.174.67.120 35691
|
||||
207.210.43.57 61500
|
||||
88.187.80.252 44960
|
||||
95.37.29.85 55097
|
||||
178.120.81.243 24063
|
||||
98.248.25.39 39785
|
||||
123.237.140.57 54196
|
||||
124.90.137.52 16001
|
||||
111.254.147.171 16001
|
||||
90.23.195.31 5980
|
||||
70.66.65.50 52566
|
||||
82.215.61.66 45682
|
||||
188.226.28.16 52000
|
||||
178.195.201.176 7000
|
||||
91.122.50.122 29587
|
||||
74.210.123.183 26345
|
||||
24.153.96.153 17046
|
||||
187.18.167.29 1044
|
||||
75.43.221.95 39921
|
||||
64.201.210.205 12541
|
||||
95.42.249.191 13514
|
||||
50.92.206.8 36417
|
||||
88.186.107.212 8660
|
||||
88.114.248.67 7812
|
||||
62.12.83.169 37939
|
||||
113.91.35.176 13229
|
||||
109.86.119.179 35691
|
||||
178.151.34.147 43642
|
||||
94.27.68.96 35691
|
||||
178.158.148.92 26932
|
||||
46.147.197.80 56635
|
||||
81.166.8.202 6881
|
||||
89.133.66.114 25105
|
||||
124.148.189.47 7812
|
||||
109.170.138.52 12664
|
||||
84.113.58.225 30340
|
||||
98.24.243.109 63114
|
||||
83.195.34.142 23055
|
||||
95.57.183.124 18885
|
||||
85.173.144.240 56863
|
||||
50.93.19.240 49803
|
||||
108.75.231.43 26311
|
||||
79.119.107.63 5230
|
||||
67.175.164.17 49477
|
||||
222.167.155.39 1057
|
||||
114.43.116.225 37574
|
||||
111.250.14.113 10672
|
||||
60.246.160.237 7977
|
||||
109.160.147.92 16111
|
||||
86.183.38.209 33638
|
||||
218.234.115.47 33590
|
||||
61.230.176.48 51306
|
||||
62.163.46.157 62081
|
||||
89.33.63.117 49900
|
||||
82.230.76.28 32690
|
||||
92.115.255.44 27696
|
||||
84.245.215.222 54456
|
||||
46.191.158.146 35153
|
||||
99.61.70.245 49153
|
||||
68.81.62.224 26822
|
||||
99.113.69.9 51413
|
||||
79.100.67.166 47232
|
||||
75.180.60.206 23301
|
||||
178.89.150.162 10006
|
||||
94.140.84.173 56697
|
||||
112.200.184.193 38708
|
||||
27.54.26.236 27729
|
||||
178.93.76.45 48098
|
||||
88.198.183.157 32257
|
||||
80.149.19.153 32528
|
||||
85.210.38.111 15639
|
||||
85.210.38.111 15622
|
||||
92.52.37.169 24456
|
||||
140.184.38.236 26038
|
||||
76.22.208.42 48036
|
||||
198.53.231.242 41343
|
||||
190.105.1.61 31276
|
||||
85.210.38.111 15609
|
||||
85.210.38.111 15589
|
||||
85.210.38.111 15611
|
||||
216.249.207.179 49264
|
||||
85.210.38.111 15600
|
||||
91.205.174.9 64081
|
||||
85.210.38.111 15676
|
||||
85.27.92.249 6881
|
||||
89.235.211.154 54082
|
||||
95.79.114.90 54480
|
||||
94.98.237.189 22423
|
||||
174.50.75.23 40107
|
||||
50.8.231.183 6895
|
||||
199.15.222.2 41932
|
||||
85.210.38.111 15654
|
||||
85.210.38.111 15727
|
||||
123.89.205.188 27728
|
||||
85.210.38.111 15587
|
||||
85.210.38.111 15661
|
||||
85.210.38.111 15672
|
||||
193.251.90.143 64101
|
||||
94.19.219.159 62495
|
||||
85.210.38.111 15588
|
||||
76.227.0.63 31540
|
||||
85.210.38.111 15680
|
||||
85.210.38.111 15598
|
||||
85.210.38.111 15642
|
||||
85.210.38.111 15683
|
||||
174.116.40.53 18169
|
||||
85.210.38.111 15673
|
||||
85.210.38.111 15601
|
||||
85.210.38.111 15616
|
||||
85.210.38.111 15596
|
||||
46.188.4.2 32546
|
||||
85.210.38.111 15633
|
||||
85.210.38.111 15663
|
||||
85.210.38.111 15761
|
||||
85.210.38.111 15651
|
||||
85.210.38.111 15684
|
||||
85.210.38.111 15602
|
||||
85.210.38.111 15618
|
||||
85.210.38.111 15759
|
||||
85.210.38.111 15649
|
||||
85.210.38.111 15734
|
||||
85.210.38.111 15586
|
||||
85.210.38.111 15689
|
||||
85.210.38.111 15688
|
||||
85.210.38.111 15716
|
||||
178.171.98.228 35691
|
||||
94.99.70.34 13738
|
||||
213.10.214.139 49488
|
||||
158.193.212.245 18849
|
||||
192.121.86.14 49001
|
||||
94.64.47.85 10584
|
||||
93.90.46.46 15966
|
||||
188.24.60.6 30511
|
||||
78.83.142.218 26179
|
||||
71.163.117.251 28836
|
||||
208.96.117.184 42494
|
||||
80.83.255.14 56288
|
||||
24.57.72.251 49219
|
||||
96.19.53.174 47181
|
||||
216.249.207.179 8080
|
||||
72.34.231.41 8013
|
||||
76.23.70.149 52720
|
||||
119.63.124.20 10605
|
||||
119.236.0.92 21746
|
||||
68.3.98.52 30952
|
||||
210.56.108.68 50295
|
||||
178.168.16.53 45094
|
||||
195.93.191.233 45522
|
||||
109.87.189.172 47133
|
||||
79.111.202.3 35996
|
||||
2.95.204.85 54892
|
||||
79.115.140.180 60708
|
||||
94.208.5.130 6881
|
||||
109.171.64.95 35691
|
||||
81.166.243.154 61275
|
||||
213.173.232.137 15009
|
||||
178.75.40.90 14971
|
||||
46.180.96.234 14743
|
||||
212.21.26.144 57441
|
||||
81.229.40.143 29722
|
||||
93.183.172.225 13349
|
||||
64.120.160.245 6821
|
||||
178.168.38.178 24978
|
||||
85.225.200.96 25648
|
||||
178.37.106.178 27501
|
||||
93.81.174.159 59973
|
||||
89.75.142.217 52944
|
||||
99.246.142.56 14544
|
||||
74.55.168.18 5401
|
||||
74.111.193.24 21414
|
||||
77.250.214.229 20403
|
||||
24.21.88.182 30282
|
||||
69.122.60.225 42998
|
||||
178.90.230.95 16311
|
||||
92.83.197.237 57436
|
||||
78.225.96.55 23793
|
||||
149.7.112.86 6893
|
||||
101.142.13.91 20864
|
||||
125.194.251.173 50055
|
||||
121.28.27.70 16001
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* a connect state box */
|
||||
|
||||
#include "connectstatebox.h"
|
||||
#include "netstatebox.h"
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
@ -16,15 +17,16 @@
|
||||
|
||||
|
||||
|
||||
PeerConnectStateBox::PeerConnectStateBox(std::string id)
|
||||
PeerConnectStateBox::PeerConnectStateBox()
|
||||
{
|
||||
mPeerId = id;
|
||||
//mPeerId = id;
|
||||
mState = CSB_START;
|
||||
mNetState = CSB_NETSTATE_UNKNOWN;
|
||||
mAttemptTS = 0;
|
||||
mNoAttempts = 0;
|
||||
}
|
||||
|
||||
|
||||
std::string NetStateAsString(uint32_t netstate)
|
||||
{
|
||||
std::string str;
|
||||
@ -151,8 +153,48 @@ std::string PeerConnectStateBox::connectState()
|
||||
}
|
||||
|
||||
|
||||
uint32_t PeerConnectStateBox::connectCb(uint32_t cbtype, uint32_t netstate)
|
||||
uint32_t convertNetStateToInternal(uint32_t netmode, uint32_t nattype)
|
||||
{
|
||||
uint32_t connNet = CSB_NETSTATE_UNKNOWN;
|
||||
|
||||
if (netmode == PNSB_NETWORK_EXTERNALIP)
|
||||
{
|
||||
connNet = CSB_NETSTATE_FORWARD;
|
||||
}
|
||||
else if (netmode == PNSB_NETWORK_BEHINDNAT)
|
||||
{
|
||||
if ((nattype == PNSB_NATTYPE_RESTRICTED_CONE) ||
|
||||
(nattype == PNSB_NATTYPE_FULL_CONE))
|
||||
{
|
||||
connNet = CSB_NETSTATE_STABLENAT;
|
||||
}
|
||||
else
|
||||
{
|
||||
connNet = CSB_NETSTATE_FIREWALLED;
|
||||
}
|
||||
}
|
||||
return connNet;
|
||||
}
|
||||
|
||||
bool shouldUseProxyPortInternal(uint32_t netstate)
|
||||
{
|
||||
if (netstate == CSB_NETSTATE_FORWARD)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PeerConnectStateBox::shouldUseProxyPort(uint32_t netmode, uint32_t nattype)
|
||||
{
|
||||
uint32_t netstate = convertNetStateToInternal(netmode, nattype);
|
||||
return shouldUseProxyPortInternal(netstate);
|
||||
}
|
||||
|
||||
uint32_t PeerConnectStateBox::connectCb(uint32_t cbtype, uint32_t netmode, uint32_t nattype)
|
||||
{
|
||||
uint32_t netstate = convertNetStateToInternal(netmode, nattype);
|
||||
|
||||
std::cerr << "PeerConnectStateBox::connectCb(";
|
||||
if (cbtype == CSB_CONNECT_DIRECT)
|
||||
{
|
||||
@ -260,6 +302,9 @@ uint32_t PeerConnectStateBox::connectCb_direct()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -268,10 +313,11 @@ uint32_t PeerConnectStateBox::connectCb_unreachable()
|
||||
uint32_t retval = 0;
|
||||
|
||||
uint32_t proxyPortMode = CSB_ACTION_PROXY_PORT;
|
||||
if (mNetState == CSB_NETSTATE_FORWARD)
|
||||
if (!shouldUseProxyPortInternal(mNetState))
|
||||
{
|
||||
proxyPortMode = CSB_ACTION_DHT_PORT;
|
||||
}
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
switch(mState)
|
||||
|
@ -50,13 +50,17 @@
|
||||
class PeerConnectStateBox
|
||||
{
|
||||
public:
|
||||
PeerConnectStateBox(std::string id);
|
||||
PeerConnectStateBox();
|
||||
|
||||
uint32_t connectCb(uint32_t cbtype, uint32_t netstate);
|
||||
uint32_t connectCb(uint32_t cbtype, uint32_t netmode, uint32_t nattype);
|
||||
uint32_t updateCb(uint32_t updateType);
|
||||
|
||||
bool shouldUseProxyPort(uint32_t netmode, uint32_t nattype);
|
||||
|
||||
std::string connectState();
|
||||
|
||||
std::string mPeerId;
|
||||
|
||||
private:
|
||||
|
||||
uint32_t connectCb_direct();
|
||||
@ -65,7 +69,7 @@ class PeerConnectStateBox
|
||||
void errorMsg(std::ostream &out, std::string msg, uint32_t updateParam);
|
||||
void stateMsg(std::ostream &out, std::string msg, uint32_t updateParam);
|
||||
|
||||
std::string mPeerId;
|
||||
|
||||
uint32_t mState;
|
||||
uint32_t mNetState;
|
||||
time_t mAttemptTS;
|
||||
|
@ -155,6 +155,7 @@ void DhtQuery::updateDhtQuery()
|
||||
|
||||
std::ostringstream flagsstr;
|
||||
flagsstr << "0x" << std::hex << std::setfill('0') << bdp->mPeerFlags;
|
||||
flagsstr << " EX:0x" << std::hex << std::setfill('0') << bdp->mExtraFlags;
|
||||
|
||||
std::ostringstream foundstr;
|
||||
foundstr << now - bdp->mFoundTime << " secs ago";
|
||||
@ -219,6 +220,7 @@ void DhtQuery::updateDhtQuery()
|
||||
|
||||
std::ostringstream flagsstr;
|
||||
flagsstr << "0x" << std::hex << std::setfill('0') << bdp->mPeerFlags;
|
||||
flagsstr << " EX:0x" << std::hex << std::setfill('0') << bdp->mExtraFlags;
|
||||
|
||||
std::ostringstream foundstr;
|
||||
foundstr << now - bdp->mFoundTime << " secs ago";
|
||||
@ -280,7 +282,8 @@ void DhtQuery::updateDhtQuery()
|
||||
|
||||
std::ostringstream flagsstr;
|
||||
flagsstr << "0x" << std::hex << std::setfill('0') << bdp->mPeerFlags;
|
||||
|
||||
flagsstr << " EX:0x" << std::hex << std::setfill('0') << bdp->mExtraFlags;
|
||||
|
||||
std::ostringstream foundstr;
|
||||
foundstr << now - bdp->mFoundTime << " secs ago";
|
||||
|
||||
@ -338,6 +341,7 @@ void DhtQuery::updateDhtQuery()
|
||||
|
||||
std::ostringstream flagsstr;
|
||||
flagsstr << "0x" << std::hex << std::setfill('0') << bdp->mPeerFlags;
|
||||
flagsstr << " EX:0x" << std::hex << std::setfill('0') << bdp->mExtraFlags;
|
||||
|
||||
std::ostringstream foundstr;
|
||||
foundstr << now - bdp->mFoundTime << " secs ago";
|
||||
|
@ -153,7 +153,7 @@ void DhtWindow::updateDhtPeers()
|
||||
|
||||
std::ostringstream flagsstr;
|
||||
flagsstr << "0x" << std::hex << std::setfill('0') << it->mPeerFlags;
|
||||
|
||||
flagsstr << " EX:0x" << std::hex << std::setfill('0') << it->mExtraFlags;
|
||||
std::ostringstream foundstr;
|
||||
foundstr << now - it->mFoundTime << " secs ago";
|
||||
|
||||
|
@ -86,6 +86,10 @@ def generateNet(basefolder, npeers, nfriends, fracProxy, fracRelay, nguis):
|
||||
fd4.write(' echo \"script needs expression as argument\"\n');
|
||||
fd4.write('fi\n\n')
|
||||
|
||||
#
|
||||
lsfilename = '%s/checklogs.sh' % (basefolder);
|
||||
fd5 = open(lsfilename, 'w');
|
||||
fd5.write('#!/bin/sh\n\n');
|
||||
|
||||
for i in range(npeers):
|
||||
random.shuffle(shuffledIdxs);
|
||||
@ -134,15 +138,23 @@ def generateNet(basefolder, npeers, nfriends, fracProxy, fracRelay, nguis):
|
||||
fd4.write('grep -n -A 10 $1 pn.log\n');
|
||||
fd4.write('cd ..\n\n');
|
||||
|
||||
|
||||
fd5.write('echo ------------ PEER FOLDER: %s\n' % folders[i]);
|
||||
fd5.write('cd %s\n' % folders[i]);
|
||||
fd5.write('ls -l pn.log\n');
|
||||
fd5.write('cd ..\n\n');
|
||||
|
||||
fd.close();
|
||||
fd2.close();
|
||||
fd3.close();
|
||||
fd4.close();
|
||||
fd5.close();
|
||||
|
||||
os.chmod(scriptfilename, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH);
|
||||
os.chmod(analysisfilename, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH);
|
||||
os.chmod(warningfilename, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH);
|
||||
os.chmod(exprfilename, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH);
|
||||
os.chmod(lsfilename, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH);
|
||||
|
||||
return;
|
||||
|
||||
|
@ -133,6 +133,29 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (doProxyRestricted)
|
||||
{
|
||||
std::list<std::pair<uint16_t, uint16_t> > portRestrictions;
|
||||
std::list<std::string>::iterator sit;
|
||||
|
||||
for(sit = proxyrestrictions.begin(); sit != proxyrestrictions.end(); sit++)
|
||||
{
|
||||
/* parse the string */
|
||||
unsigned int lport, uport;
|
||||
if (2 == sscanf(sit->c_str(), "%u-%u", &lport, &uport))
|
||||
{
|
||||
std::cerr << "Adding Port Restriction (" << lport << "-" << uport << ")";
|
||||
std::cerr << std::endl;
|
||||
portRestrictions.push_back(std::make_pair<uint16_t, uint16_t>(lport, uport));
|
||||
}
|
||||
}
|
||||
|
||||
if (portRestrictions.size() > 0)
|
||||
{
|
||||
pnet->setProxyUdpStackRestrictions(portRestrictions);
|
||||
}
|
||||
}
|
||||
|
||||
if (doLocalTesting)
|
||||
{
|
||||
pnet->setLocalTesting();
|
||||
|
@ -245,18 +245,20 @@ void MainWindow::updateNetPeers()
|
||||
#define PTW_COL_PEERID 0
|
||||
#define PTW_COL_DHT_STATUS 1
|
||||
|
||||
#define PTW_COL_PEER_CONNECT_STATUS 2
|
||||
#define PTW_COL_PEER_CONNECT_MODE 3
|
||||
#define PTW_COL_PEER_REQ_STATUS 4
|
||||
#define PTW_COL_PEER_CONNECTLOGIC 2
|
||||
|
||||
#define PTW_COL_PEER_CONNECT_STATUS 3
|
||||
#define PTW_COL_PEER_CONNECT_MODE 4
|
||||
#define PTW_COL_PEER_REQ_STATUS 5
|
||||
|
||||
#define PTW_COL_PEER_CB_MSG 5
|
||||
#define PTW_COL_PEER_CB_MSG 6
|
||||
|
||||
// These aren't that important.
|
||||
#define PTW_COL_PEER_CB_MODE 6
|
||||
#define PTW_COL_PEER_CB_PROXY 7
|
||||
#define PTW_COL_PEER_CB_MODE 7
|
||||
#define PTW_COL_PEER_CB_PROXY 8
|
||||
|
||||
#define PTW_COL_DHT_ADDRESS 8
|
||||
#define PTW_COL_DHT_UPDATETS 9
|
||||
#define PTW_COL_DHT_ADDRESS 9
|
||||
#define PTW_COL_DHT_UPDATETS 10
|
||||
|
||||
|
||||
/* clear old entries */
|
||||
@ -388,8 +390,10 @@ void MainWindow::updateNetPeers()
|
||||
bdStdPrintId(cbpstr, &(status.mPeerCbProxyId));
|
||||
|
||||
peer_item -> setData(PTW_COL_PEER_CB_MSG, Qt::DisplayRole, QString::fromStdString(status.mPeerCbMsg));
|
||||
peer_item -> setData(PTW_COL_PEER_CB_MODE, Qt::DisplayRole, QString::fromStdString(cbmstr.str()));
|
||||
peer_item -> setData(PTW_COL_PEER_CB_PROXY, Qt::DisplayRole, QString::fromStdString(cbpstr.str()));
|
||||
peer_item -> setData(PTW_COL_PEER_CONNECTLOGIC, Qt::DisplayRole,
|
||||
QString::fromStdString(status.mConnectLogic.connectState()));
|
||||
//peer_item -> setData(PTW_COL_PEER_CB_MODE, Qt::DisplayRole, QString::fromStdString(cbmstr.str()));
|
||||
//peer_item -> setData(PTW_COL_PEER_CB_PROXY, Qt::DisplayRole, QString::fromStdString(cbpstr.str()));
|
||||
|
||||
|
||||
switch(status.mDhtState)
|
||||
@ -468,8 +472,8 @@ void MainWindow::updateNetPeers()
|
||||
|
||||
peer_item -> setData(PTW_COL_PEERID, Qt::DisplayRole, QString::fromStdString(*it));
|
||||
peer_item -> setData(PTW_COL_DHT_STATUS, Qt::DisplayRole, "Unknown Peer");
|
||||
peer_item -> setData(PTW_COL_DHT_ADDRESS, Qt::DisplayRole, "");
|
||||
peer_item -> setData(PTW_COL_DHT_UPDATETS, Qt::DisplayRole, "");
|
||||
//peer_item -> setData(PTW_COL_DHT_ADDRESS, Qt::DisplayRole, "");
|
||||
//peer_item -> setData(PTW_COL_DHT_UPDATETS, Qt::DisplayRole, "");
|
||||
|
||||
// NOW CONNECT STATE
|
||||
peer_item -> setData(PTW_COL_PEER_CONNECT_STATUS, Qt::DisplayRole, QString::fromStdString(status.mPeerConnectMsg));
|
||||
@ -478,9 +482,12 @@ void MainWindow::updateNetPeers()
|
||||
|
||||
// NOW CB
|
||||
peer_item -> setData(PTW_COL_PEER_CB_MSG, Qt::DisplayRole, QString::fromStdString(status.mPeerCbMsg));
|
||||
peer_item -> setData(PTW_COL_PEER_CB_MODE, Qt::DisplayRole, "");
|
||||
peer_item -> setData(PTW_COL_PEER_CB_PROXY, Qt::DisplayRole, "None");
|
||||
|
||||
//peer_item -> setData(PTW_COL_PEER_CB_MODE, Qt::DisplayRole, "");
|
||||
//peer_item -> setData(PTW_COL_PEER_CB_PROXY, Qt::DisplayRole, "None");
|
||||
|
||||
// CONNECT LOGIC
|
||||
peer_item -> setData(PTW_COL_PEER_CONNECTLOGIC, Qt::DisplayRole,
|
||||
QString::fromStdString("Not a Friend"));
|
||||
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,11 @@
|
||||
<string>Dht Status</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>ConnectLogic</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Connect Status</string>
|
||||
@ -180,26 +185,6 @@
|
||||
<string>Cb Status</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cb Mode</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cb Address</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Dht Address</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Dht Update</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -72,6 +72,12 @@ void PeerNet::setUdpStackRestrictions(std::list<std::pair<uint16_t, uint16_t> >
|
||||
mUdpStackRestrictions = restrictions;
|
||||
}
|
||||
|
||||
void PeerNet::setProxyUdpStackRestrictions(std::list<std::pair<uint16_t, uint16_t> > &restrictions)
|
||||
{
|
||||
mDoProxyUdpStackRestrictions = true;
|
||||
mProxyUdpStackRestrictions = restrictions;
|
||||
}
|
||||
|
||||
void PeerNet::setLocalTesting()
|
||||
{
|
||||
mLocalNetTesting = true;
|
||||
@ -171,7 +177,23 @@ void PeerNet::init()
|
||||
struct sockaddr_in sndladdr;
|
||||
sockaddr_clear(&sndladdr);
|
||||
sndladdr.sin_port = htons(mPort + 11);
|
||||
rsUdpStack *mUdpProxyStack = new rsUdpStack(sndladdr);
|
||||
//rsUdpStack *mUdpProxyStack = NULL;
|
||||
|
||||
if (mDoProxyUdpStackRestrictions)
|
||||
{
|
||||
mUdpProxyStack = new UdpStack(UDP_TEST_RESTRICTED_LAYER, sndladdr);
|
||||
RestrictedUdpLayer *url = (RestrictedUdpLayer *) mUdpProxyStack->getUdpLayer();
|
||||
|
||||
std::list<std::pair<uint16_t, uint16_t> >::iterator it;
|
||||
for(it = mProxyUdpStackRestrictions.begin(); it != mProxyUdpStackRestrictions.end(); it++)
|
||||
{
|
||||
url->addRestrictedPortRange(it->first, it->second);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mUdpProxyStack = new UdpStack(sndladdr);
|
||||
}
|
||||
|
||||
std::cerr << "PeerNet() startup ... creating UdpStunner on UdpProxyStack";
|
||||
std::cerr << std::endl;
|
||||
@ -255,7 +277,8 @@ int PeerNet::add_peer(std::string id)
|
||||
mPeers[filteredId] = PeerStatus();
|
||||
std::map<std::string, PeerStatus>::iterator it = mPeers.find(filteredId);
|
||||
|
||||
mUdpBitDht->addFindNode(&tmpId, BITDHT_QFLAGS_DO_IDLE);
|
||||
//mUdpBitDht->addFindNode(&tmpId, BITDHT_QFLAGS_DO_IDLE);
|
||||
mUdpBitDht->addFindNode(&tmpId, BITDHT_QFLAGS_DO_IDLE | BITDHT_QFLAGS_UPDATES);
|
||||
|
||||
it->second.mId = filteredId;
|
||||
bdsockaddr_clear(&(it->second.mDhtAddr));
|
||||
@ -264,6 +287,7 @@ int PeerNet::add_peer(std::string id)
|
||||
it->second.mDhtUpdateTS = time(NULL);
|
||||
|
||||
// Initialise Everything.
|
||||
it->second.mConnectLogic.mPeerId = filteredId;
|
||||
|
||||
it->second.mPeerReqStatusMsg = "Just Added";
|
||||
it->second.mPeerReqState = PN_PEER_REQ_STOPPED;
|
||||
@ -794,8 +818,50 @@ int PeerNet::OnlinePeerCallback_locked(const bdId *id, uint32_t status, PeerStat
|
||||
std::cerr << "dhtPeerCallback. WARNING Ignoring Callback. Peer Online, but connection already underway: ";
|
||||
bdStdPrintId(std::cerr, id);
|
||||
std::cerr << std::endl;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
bool connectOk = true;
|
||||
|
||||
/* work out network state */
|
||||
uint32_t connectFlags = peerStatus->mConnectLogic.connectCb(CSB_CONNECT_DIRECT,
|
||||
mNetStateBox.getNetworkMode(), mNetStateBox.getNatTypeMode());
|
||||
bool useProxyPort = (connectFlags & CSB_ACTION_PROXY_PORT);
|
||||
|
||||
switch(connectFlags & CSB_ACTION_MASK_MODE)
|
||||
{
|
||||
default:
|
||||
case CSB_ACTION_WAIT:
|
||||
{
|
||||
connectOk = false;
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_DIRECT_CONN:
|
||||
{
|
||||
|
||||
connectOk = true;
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_PROXY_CONN:
|
||||
{
|
||||
/* ERROR */
|
||||
std::cerr << "dhtPeerCallback: ERROR ConnectLogic returned PROXY";
|
||||
std::cerr << std::endl;
|
||||
connectOk = false;
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_RELAY_CONN:
|
||||
{
|
||||
/* ERROR */
|
||||
std::cerr << "dhtPeerCallback: ERROR ConnectLogic returned RELAY";
|
||||
std::cerr << std::endl;
|
||||
connectOk = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (connectOk)
|
||||
{
|
||||
std::cerr << "dhtPeerCallback. Peer Online, triggering Direct Connection for: ";
|
||||
bdStdPrintId(std::cerr, id);
|
||||
@ -838,38 +904,52 @@ int PeerNet::UnreachablePeerCallback_locked(const bdId *id, uint32_t status, Pee
|
||||
bool proxyOk = false;
|
||||
bool connectOk = true;
|
||||
|
||||
/* work out network state */
|
||||
uint32_t connectFlags = peerStatus->mConnectLogic.connectCb(CSB_CONNECT_UNREACHABLE,
|
||||
mNetStateBox.getNetworkMode(), mNetStateBox.getNatTypeMode());
|
||||
bool useProxyPort = (connectFlags & CSB_ACTION_PROXY_PORT);
|
||||
|
||||
switch(connectFlags & CSB_ACTION_MASK_MODE)
|
||||
{
|
||||
// must check for extAddress before starting connection.
|
||||
|
||||
struct sockaddr_in extaddr;
|
||||
uint8_t extStable = 0;
|
||||
sockaddr_clear(&extaddr);
|
||||
|
||||
if (mProxyStunner->externalAddr(extaddr, extStable))
|
||||
default:
|
||||
case CSB_ACTION_WAIT:
|
||||
{
|
||||
if (extStable)
|
||||
{
|
||||
proxyOk = true;
|
||||
}
|
||||
connectOk = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_DIRECT_CONN:
|
||||
{
|
||||
/* ERROR */
|
||||
std::cerr << "dhtPeerCallback: ERROR ConnectLogic returned DIRECT";
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* determine if we should try and connect! */
|
||||
|
||||
if (proxyOk)
|
||||
{
|
||||
proxyOk = false;
|
||||
//connectOk = false;
|
||||
std::cerr << "dhtPeerCallback. Forcing all to RELAY for the moment.";
|
||||
std::cerr << std::endl;
|
||||
connectOk = false;
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_PROXY_CONN:
|
||||
{
|
||||
proxyOk = true;
|
||||
connectOk = true;
|
||||
}
|
||||
break;
|
||||
case CSB_ACTION_RELAY_CONN:
|
||||
{
|
||||
proxyOk = false;
|
||||
connectOk = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (connectOk)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
/* Push Back PeerAction */
|
||||
PeerAction ca;
|
||||
ca.mType = PEERNET_ACTION_TYPE_CONNECT;
|
||||
ca.mDestId = *id;
|
||||
peerStatus->mConnectLogicTS = now;
|
||||
peerStatus->mConnectLogicFlags = connectFlags;
|
||||
peerStatus->mConnectLogicProxyPort = useProxyPort;
|
||||
|
||||
if (proxyOk)
|
||||
{
|
||||
@ -1119,8 +1199,9 @@ int PeerNet::dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bd
|
||||
ca.mSrcId = *srcId;
|
||||
ca.mDestId = *destId;
|
||||
|
||||
/* Check Proxy ExtAddress Status */
|
||||
if (mode == BITDHT_CONNECT_MODE_PROXY)
|
||||
/* Check Proxy ExtAddress Status (but only if connection is Allowed) */
|
||||
if ((connectionAllowed == BITDHT_CONNECT_ANSWER_OKAY) &&
|
||||
(mode == BITDHT_CONNECT_MODE_PROXY))
|
||||
{
|
||||
std::cerr << "dhtConnectionCallback() Checking Address for Proxy";
|
||||
std::cerr << std::endl;
|
||||
@ -1129,13 +1210,48 @@ int PeerNet::dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bd
|
||||
uint8_t extStable = 0;
|
||||
sockaddr_clear(&extaddr);
|
||||
|
||||
if (mProxyStunner->externalAddr(extaddr, extStable))
|
||||
bool connectOk = false;
|
||||
bool proxyPort = false;
|
||||
std::cerr << "dhtConnectionCallback(): Proxy... deciding which port to use.";
|
||||
std::cerr << std::endl;
|
||||
|
||||
PeerStatus *ps = getPeerStatus_locked(&(peerId));
|
||||
if (ps)
|
||||
{
|
||||
proxyPort = ps->mConnectLogic.shouldUseProxyPort(
|
||||
mNetStateBox.getNetworkMode(), mNetStateBox.getNatTypeMode());
|
||||
|
||||
ps->mConnectLogicTS = now;
|
||||
ps->mConnectLogicFlags = 0;
|
||||
ps->mConnectLogicProxyPort = proxyPort;
|
||||
|
||||
std::cerr << "dhtConnectionCallback: Setting ProxyPort: ";
|
||||
std::cerr << " UseProxyPort? " << ps->mConnectLogicProxyPort;
|
||||
std::cerr << std::endl;
|
||||
|
||||
connectOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PeerAction: Connect Proxy: ERROR Cannot find PeerStatus";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
UdpStunner *stunner = mProxyStunner;
|
||||
if (!proxyPort)
|
||||
{
|
||||
stunner = mDhtStunner;
|
||||
}
|
||||
|
||||
if ((connectOk) && (stunner->externalAddr(extaddr, extStable)))
|
||||
{
|
||||
if (extStable)
|
||||
{
|
||||
std::cerr << "dhtConnectionCallback() Proxy Connection ";
|
||||
std::cerr << "dhtConnectionCallback() Proxy Connection Attempt to: ";
|
||||
bdStdPrintId(std::cerr, &(peerId));
|
||||
std::cerr << " is OkGo as we have Stable Own External Proxy Address";
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (point == BD_PROXY_CONNECTION_END_POINT)
|
||||
{
|
||||
ca.mDestId.addr = extaddr;
|
||||
@ -1143,6 +1259,8 @@ int PeerNet::dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bd
|
||||
else
|
||||
{
|
||||
ca.mSrcId.addr = extaddr;
|
||||
std::cerr << "dhtConnectionCallback() ERROR Proxy Auth as SrcId";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1157,13 +1275,12 @@ int PeerNet::dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bd
|
||||
else
|
||||
{
|
||||
connectionAllowed = BITDHT_CONNECT_ERROR_TEMPUNAVAIL;
|
||||
std::cerr << "PeerAction: ERROR Proxy Connection ";
|
||||
std::cerr << "dhtConnectionCallback() ERROR Proxy Connection ";
|
||||
std::cerr << " is Discarded, as Failed to get Own External Proxy Address.";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ca.mMode = mode;
|
||||
ca.mPoint = point;
|
||||
ca.mAnswer = connectionAllowed;
|
||||
@ -1264,6 +1381,53 @@ int PeerNet::dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bd
|
||||
ps->mPeerReqStatusMsg += decodeConnectionError(errcode);
|
||||
ps->mPeerReqState = PN_PEER_REQ_STOPPED;
|
||||
ps->mPeerReqTS = now;
|
||||
|
||||
int updatecode = CSB_UPDATE_FAILED_ATTEMPT;
|
||||
int errtype = errcode & BITDHT_CONNECT_ERROR_MASK_TYPE;
|
||||
switch(errtype)
|
||||
{
|
||||
/* fatal errors */
|
||||
case BITDHT_CONNECT_ERROR_AUTH_DENIED:
|
||||
{
|
||||
updatecode = CSB_UPDATE_AUTH_DENIED;
|
||||
}
|
||||
break;
|
||||
|
||||
/* move on errors */
|
||||
case BITDHT_CONNECT_ERROR_UNREACHABLE: // sym NAT.
|
||||
case BITDHT_CONNECT_ERROR_UNSUPPORTED: // mode unavailable.
|
||||
{
|
||||
updatecode = CSB_UPDATE_MODE_UNAVAILABLE;
|
||||
}
|
||||
break;
|
||||
|
||||
/* standard failed attempts */
|
||||
case BITDHT_CONNECT_ERROR_GENERIC:
|
||||
case BITDHT_CONNECT_ERROR_PROTOCOL:
|
||||
case BITDHT_CONNECT_ERROR_TIMEOUT:
|
||||
case BITDHT_CONNECT_ERROR_TEMPUNAVAIL:
|
||||
case BITDHT_CONNECT_ERROR_NOADDRESS:
|
||||
case BITDHT_CONNECT_ERROR_OVERLOADED:
|
||||
case BITDHT_CONNECT_ERROR_DUPLICATE:
|
||||
/* CB_REQUEST errors */
|
||||
case BITDHT_CONNECT_ERROR_TOOMANYRETRY:
|
||||
case BITDHT_CONNECT_ERROR_OUTOFPROXY:
|
||||
{
|
||||
updatecode = CSB_UPDATE_FAILED_ATTEMPT;
|
||||
}
|
||||
break;
|
||||
|
||||
/* user cancelled ... no update */
|
||||
case BITDHT_CONNECT_ERROR_USER:
|
||||
{
|
||||
updatecode = CSB_UPDATE_NONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (updatecode)
|
||||
{
|
||||
ps->mConnectLogic.updateCb(updatecode);
|
||||
}
|
||||
}
|
||||
else // a new connection attempt.
|
||||
{
|
||||
@ -1324,6 +1488,11 @@ int PeerNet::tick()
|
||||
|
||||
keepaliveConnections();
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
std::cerr << "PeerNet::tick() TIME: " << ctime(&now) << std::endl;
|
||||
std::cerr.flush();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1417,8 +1586,39 @@ int PeerNet::doActions()
|
||||
struct sockaddr_in extaddr;
|
||||
uint8_t extStable = 0;
|
||||
sockaddr_clear(&extaddr);
|
||||
bool proxyPort = true;
|
||||
bool connectOk = false;
|
||||
|
||||
if (mProxyStunner->externalAddr(extaddr, extStable))
|
||||
std::cerr << "PeerAction: Proxy... deciding which port to use.";
|
||||
std::cerr << std::endl;
|
||||
{
|
||||
bdStackMutex stack(mPeerMutex); /********** LOCKED MUTEX ***************/
|
||||
|
||||
PeerStatus *ps = getPeerStatus_locked(&(action.mDestId));
|
||||
if (ps)
|
||||
{
|
||||
std::cerr << "PeerAction: Proxy: Using ConnectLogic Info from: ";
|
||||
std::cerr << now-ps->mConnectLogicTS << " ago. Flags: " << ps->mConnectLogicFlags;
|
||||
std::cerr << " UseProxyPort? " << ps->mConnectLogicProxyPort;
|
||||
std::cerr << std::endl;
|
||||
|
||||
connectOk = true;
|
||||
proxyPort = ps->mConnectLogicProxyPort;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PeerAction: Connect Proxy: ERROR Cannot find PeerStatus";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
UdpStunner *stunner = mProxyStunner;
|
||||
if (!proxyPort)
|
||||
{
|
||||
stunner = mDhtStunner;
|
||||
}
|
||||
|
||||
if ((connectOk) && (stunner->externalAddr(extaddr, extStable)))
|
||||
{
|
||||
if (extStable)
|
||||
{
|
||||
@ -1537,6 +1737,37 @@ int PeerNet::doActions()
|
||||
action.mMode, action.mPoint, action.mAnswer);
|
||||
}
|
||||
break;
|
||||
|
||||
case PEERNET_ACTION_TYPE_RESTARTREQ:
|
||||
{
|
||||
/* connect attempt */
|
||||
std::cerr << "PeerAction. Restart Connection Attempt to: ";
|
||||
bdStdPrintId(std::cerr, &(action.mDestId));
|
||||
std::cerr << " mode: " << action.mMode;
|
||||
std::cerr << std::endl;
|
||||
|
||||
struct sockaddr_in laddr;
|
||||
sockaddr_clear(&laddr);
|
||||
uint32_t start = 1;
|
||||
mUdpBitDht->ConnectionRequest(&laddr, &(action.mDestId.id), action.mMode, start);
|
||||
}
|
||||
break;
|
||||
|
||||
case PEERNET_ACTION_TYPE_KILLREQ:
|
||||
{
|
||||
/* connect attempt */
|
||||
std::cerr << "PeerAction. Kill Connection Attempt to: ";
|
||||
bdStdPrintId(std::cerr, &(action.mDestId));
|
||||
std::cerr << " mode: " << action.mMode;
|
||||
std::cerr << std::endl;
|
||||
|
||||
struct sockaddr_in laddr;
|
||||
sockaddr_clear(&laddr);
|
||||
uint32_t start = 0;
|
||||
mUdpBitDht->ConnectionRequest(&laddr, &(action.mDestId.id), action.mMode, start);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -1767,7 +1998,25 @@ void PeerNet::initiateConnection(const bdId *srcId, const bdId *proxyId, const b
|
||||
break;
|
||||
|
||||
case BITDHT_CONNECT_MODE_PROXY:
|
||||
fd = tou_socket(PN_TOU_RECVER_PROXY_IDX, TOU_RECEIVER_TYPE_UDPPEER, 0);
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
std::cerr << "PeerNet::initiateConnection() Peer Mode Proxy... deciding which port to use.";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "PeerNet::initiateConnection() Using ConnectLogic Info from: ";
|
||||
std::cerr << now-it->second.mConnectLogicTS << " ago. Flags: " << it->second.mConnectLogicFlags;
|
||||
std::cerr << " UseProxyPort? " << it->second.mConnectLogicProxyPort;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (it->second.mConnectLogicProxyPort)
|
||||
{
|
||||
fd = tou_socket(PN_TOU_RECVER_PROXY_IDX, TOU_RECEIVER_TYPE_UDPPEER, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = tou_socket(PN_TOU_RECVER_DIRECT_IDX, TOU_RECEIVER_TYPE_UDPPEER, 0);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case BITDHT_CONNECT_MODE_RELAY:
|
||||
@ -1925,6 +2174,8 @@ void PeerNet::monitorConnections()
|
||||
it->second.mPeerConnectState = PN_PEER_CONN_CONNECTED;
|
||||
it->second.mPeerConnectTS = time(NULL);
|
||||
|
||||
it->second.mConnectLogic.updateCb(CSB_UPDATE_CONNECTED);
|
||||
|
||||
std::ostringstream msg;
|
||||
msg << "Connected in " << it->second.mPeerConnectTS - it->second.mPeerConnectUdpTS;
|
||||
msg << " secs";
|
||||
@ -1936,11 +2187,23 @@ void PeerNet::monitorConnections()
|
||||
std::cerr << "PeerNet::monitorConnections() Request Active, Stopping Request";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
struct sockaddr_in tmpaddr;
|
||||
bdsockaddr_clear(&tmpaddr);
|
||||
int start = 0;
|
||||
mUdpBitDht->ConnectionRequest(&tmpaddr, &(it->second.mPeerConnectPeerId.id), it->second.mPeerConnectMode, start);
|
||||
/* Push Back PeerAction */
|
||||
PeerAction ca;
|
||||
ca.mType = PEERNET_ACTION_TYPE_KILLREQ;
|
||||
ca.mMode = it->second.mPeerConnectMode;
|
||||
//ca.mProxyId = *proxyId;
|
||||
//ca.mSrcId = *srcId;
|
||||
ca.mDestId = it->second.mPeerConnectPeerId;
|
||||
//ca.mPoint = point;
|
||||
ca.mAnswer = BITDHT_CONNECT_ERROR_NONE;
|
||||
|
||||
mActions.push_back(ca);
|
||||
|
||||
// What the Action should do...
|
||||
//struct sockaddr_in tmpaddr;
|
||||
//bdsockaddr_clear(&tmpaddr);
|
||||
//int start = 0;
|
||||
//mUdpBitDht->ConnectionRequest(&tmpaddr, &(it->second.mPeerConnectPeerId.id), it->second.mPeerConnectMode, start);
|
||||
}
|
||||
// only an error if we initiated the connection.
|
||||
else if (it->second.mPeerConnectPoint == BD_PROXY_CONNECTION_START_POINT)
|
||||
@ -1952,7 +2215,7 @@ void PeerNet::monitorConnections()
|
||||
}
|
||||
else if (now - it->second.mPeerConnectUdpTS > PEERNET_CONNECT_TIMEOUT)
|
||||
{
|
||||
std::cerr << "PeerNet::monitorConnections() InProgress Connection Failed: " << it->second.mId;
|
||||
std::cerr << "PeerNet::monitorConnections() ERROR InProgress Connection Failed: " << it->second.mId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* shut id down */
|
||||
@ -1964,12 +2227,25 @@ void PeerNet::monitorConnections()
|
||||
{
|
||||
std::cerr << "PeerNet::monitorConnections() Request Active (Paused)... restarting";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
/* Push Back PeerAction */
|
||||
PeerAction ca;
|
||||
ca.mType = PEERNET_ACTION_TYPE_RESTARTREQ;
|
||||
ca.mMode = it->second.mPeerConnectMode;
|
||||
//ca.mProxyId = *proxyId;
|
||||
//ca.mSrcId = *srcId;
|
||||
ca.mDestId = it->second.mPeerConnectPeerId;
|
||||
//ca.mPoint = point;
|
||||
ca.mAnswer = BITDHT_CONNECT_ERROR_NONE;
|
||||
|
||||
mActions.push_back(ca);
|
||||
|
||||
// What the Action should do!
|
||||
// tell it to keep going.
|
||||
struct sockaddr_in tmpaddr;
|
||||
bdsockaddr_clear(&tmpaddr);
|
||||
int start = 1;
|
||||
mUdpBitDht->ConnectionRequest(&tmpaddr, &(it->second.mPeerConnectPeerId.id), it->second.mPeerConnectMode, start);
|
||||
//struct sockaddr_in tmpaddr;
|
||||
//bdsockaddr_clear(&tmpaddr);
|
||||
//int start = 1;
|
||||
//mUdpBitDht->ConnectionRequest(&tmpaddr, &(it->second.mPeerConnectPeerId.id), it->second.mPeerConnectMode, start);
|
||||
}
|
||||
// only an error if we initiated the connection.
|
||||
else if (it->second.mPeerConnectPoint == BD_PROXY_CONNECTION_START_POINT)
|
||||
@ -2013,6 +2289,8 @@ void PeerNet::monitorConnections()
|
||||
std::cerr << "PeerNet::monitorConnections() Active Connection Closed: " << it->second.mId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
it->second.mConnectLogic.updateCb(CSB_UPDATE_DISCONNECTED);
|
||||
|
||||
it->second.mPeerConnectState = PN_PEER_CONN_DISCONNECTED;
|
||||
it->second.mPeerConnectClosedTS = time(NULL);
|
||||
std::ostringstream msg;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "tcponudp/udprelay.h"
|
||||
|
||||
#include "netstatebox.h"
|
||||
#include "connectstatebox.h"
|
||||
|
||||
#define PN_DHT_STATE_UNKNOWN 0
|
||||
#define PN_DHT_STATE_SEARCHING 1
|
||||
@ -80,6 +81,16 @@ class PeerStatus
|
||||
bdId mPeerReqProxyId;
|
||||
time_t mPeerReqTS;
|
||||
|
||||
/* Connection Request History / Connection Logic */
|
||||
uint32_t mCRHState;
|
||||
uint32_t mCRHFlags;
|
||||
uint32_t mCRHDirectTS;
|
||||
uint32_t mCRHDirectAttempts;
|
||||
uint32_t mCRHProxyTS;
|
||||
uint32_t mCRHProxyAttempts;
|
||||
uint32_t mCRHRelayTS;
|
||||
uint32_t mCRHRelayAttempts;
|
||||
|
||||
/* Callback Info */
|
||||
std::string mPeerCbMsg;
|
||||
uint32_t mPeerCbMode;
|
||||
@ -88,6 +99,11 @@ class PeerStatus
|
||||
bdId mPeerCbDestId;
|
||||
time_t mPeerCbTS;
|
||||
|
||||
/* new ConnectLogic stuff. */
|
||||
PeerConnectStateBox mConnectLogic;
|
||||
uint32_t mConnectLogicTS;
|
||||
uint32_t mConnectLogicFlags;
|
||||
bool mConnectLogicProxyPort;
|
||||
|
||||
/* Actual Connection Status */
|
||||
uint32_t mPeerConnectState;
|
||||
@ -99,6 +115,7 @@ class PeerStatus
|
||||
struct sockaddr_in mPeerConnectAddr;
|
||||
uint32_t mPeerConnectPoint;
|
||||
|
||||
|
||||
time_t mPeerConnectUdpTS;
|
||||
time_t mPeerConnectTS;
|
||||
time_t mPeerConnectClosedTS;
|
||||
@ -112,6 +129,8 @@ class PeerStatus
|
||||
#define PEERNET_ACTION_TYPE_CONNECT 1
|
||||
#define PEERNET_ACTION_TYPE_AUTHORISE 2
|
||||
#define PEERNET_ACTION_TYPE_START 3
|
||||
#define PEERNET_ACTION_TYPE_RESTARTREQ 4
|
||||
#define PEERNET_ACTION_TYPE_KILLREQ 5
|
||||
|
||||
class PeerAction
|
||||
{
|
||||
@ -134,6 +153,8 @@ class PeerNet: public BitDhtCallback
|
||||
|
||||
/* setup functions. must be called before init() */
|
||||
void setUdpStackRestrictions(std::list<std::pair<uint16_t, uint16_t> > &restrictions);
|
||||
void setProxyUdpStackRestrictions(std::list<std::pair<uint16_t, uint16_t> > &restrictions);
|
||||
|
||||
void setLocalTesting();
|
||||
|
||||
void init();
|
||||
@ -251,6 +272,9 @@ int UnreachablePeerCallback_locked(const bdId *id,
|
||||
bool mDoUdpStackRestrictions;
|
||||
std::list<std::pair<uint16_t, uint16_t> > mUdpStackRestrictions;
|
||||
|
||||
bool mDoProxyUdpStackRestrictions;
|
||||
std::list<std::pair<uint16_t, uint16_t> > mProxyUdpStackRestrictions;
|
||||
|
||||
/* these probably should be protected - but aren't for now */
|
||||
time_t mMinuteTS;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user