Commit b3de8c9c authored by Claes Sjofors's avatar Claes Sjofors

Redundance communication 2

parent 849344c7
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
100 20 100 20
135 20 135 20
101 20 101 20
102 126 102 182
103 324 103 260
104 2.3299 104 2.51111
136 2.3299 136 2.51111
105 100 105 100
106 2 106 2
107 1 107 1
...@@ -40,11 +40,11 @@ ...@@ -40,11 +40,11 @@
109 1 109 1
110 45.5 110 45.5
111 0.499999 111 0.499999
116 12 116 20
117 36 117 31
118 130 118 112
119 113 119 108
120 1 120 0
121 Claes context 121 Claes context
122 0 122 0
126 0.5 126 0.5
...@@ -7667,6 +7667,8 @@ pwr_exe: ...@@ -7667,6 +7667,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -8228,6 +8230,8 @@ pwr_exe: ...@@ -8228,6 +8230,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -9011,8 +9015,8 @@ pwr_exe: ...@@ -9011,8 +9015,8 @@ pwr_exe:
3100 100 3100 100
3101 0 3101 0
3102 35 3102 35
3103 478 3103 358
3110 482 3110 362
3111 1 3111 1
3106 3106
3107 3107
...@@ -9619,6 +9623,8 @@ pwr_exe: ...@@ -9619,6 +9623,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActSpeed 5000 $object.ActSpeed
...@@ -10818,6 +10824,8 @@ pwr_exe: ...@@ -10818,6 +10824,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.RefSpeed 5000 $object.RefSpeed
...@@ -10992,6 +11000,8 @@ pwr_exe: ...@@ -10992,6 +11000,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActSpeed 5000 $object.ActSpeed
...@@ -11166,6 +11176,8 @@ pwr_exe: ...@@ -11166,6 +11176,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.RefSpeed 5000 $object.RefSpeed
...@@ -11914,6 +11926,8 @@ pwr_exe: ...@@ -11914,6 +11926,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -12125,8 +12139,8 @@ pwr_exe: ...@@ -12125,8 +12139,8 @@ pwr_exe:
3100 100 3100 100
3101 0 3101 0
3102 35 3102 35
3103 358 3103 418
3110 362 3110 422
3111 1 3111 1
3106 3106
3107 3107
...@@ -12428,6 +12442,8 @@ pwr_exe: ...@@ -12428,6 +12442,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -12699,6 +12715,8 @@ pwr_exe: ...@@ -12699,6 +12715,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -12709,6 +12727,7 @@ pwr_exe: ...@@ -12709,6 +12727,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -12846,6 +12865,8 @@ pwr_exe: ...@@ -12846,6 +12865,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -12856,6 +12877,7 @@ pwr_exe: ...@@ -12856,6 +12877,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -12993,6 +13015,8 @@ pwr_exe: ...@@ -12993,6 +13015,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActTorque 5000 $object.ActTorque
...@@ -13275,6 +13299,8 @@ pwr_exe: ...@@ -13275,6 +13299,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActCurrent 5000 $object.ActCurrent
...@@ -13752,6 +13778,8 @@ pwr_exe: ...@@ -13752,6 +13778,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -13762,6 +13790,7 @@ pwr_exe: ...@@ -13762,6 +13790,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -13899,6 +13928,8 @@ pwr_exe: ...@@ -13899,6 +13928,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -13909,6 +13940,7 @@ pwr_exe: ...@@ -13909,6 +13940,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14114,6 +14146,8 @@ pwr_exe: ...@@ -14114,6 +14146,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -14124,6 +14158,7 @@ pwr_exe: ...@@ -14124,6 +14158,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14261,6 +14296,8 @@ pwr_exe: ...@@ -14261,6 +14296,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -14271,6 +14308,7 @@ pwr_exe: ...@@ -14271,6 +14308,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14808,6 +14846,8 @@ pwr_exe: ...@@ -14808,6 +14846,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 4 1302 4
...@@ -14818,6 +14858,7 @@ pwr_exe: ...@@ -14818,6 +14858,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
101 20 101 20
102 137 102 137
103 317 103 317
104 2.13409 104 2.46725
136 2.13409 136 2.46725
105 100 105 100
106 2 106 2
107 1 107 1
...@@ -40,11 +40,11 @@ ...@@ -40,11 +40,11 @@
109 1 109 1
110 45.5 110 45.5
111 0.499999 111 0.499999
116 12 116 14
117 32 117 38
118 120 118 104
119 102 119 113
120 0 120 1
121 Claes context 121 Claes context
122 0 122 0
126 0.5 126 0.5
...@@ -7667,6 +7667,8 @@ pwr_exe: ...@@ -7667,6 +7667,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -8228,6 +8230,8 @@ pwr_exe: ...@@ -8228,6 +8230,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -9011,8 +9015,8 @@ pwr_exe: ...@@ -9011,8 +9015,8 @@ pwr_exe:
3100 100 3100 100
3101 0 3101 0
3102 35 3102 35
3103 418 3103 358
3110 422 3110 362
3111 1 3111 1
3106 3106
3107 3107
...@@ -9485,6 +9489,8 @@ pwr_exe: ...@@ -9485,6 +9489,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActSpeed 5000 $object.ActSpeed
...@@ -10684,6 +10690,8 @@ pwr_exe: ...@@ -10684,6 +10690,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.RefSpeed 5000 $object.RefSpeed
...@@ -10858,6 +10866,8 @@ pwr_exe: ...@@ -10858,6 +10866,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActSpeed 5000 $object.ActSpeed
...@@ -11032,6 +11042,8 @@ pwr_exe: ...@@ -11032,6 +11042,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.RefSpeed 5000 $object.RefSpeed
...@@ -11780,6 +11792,8 @@ pwr_exe: ...@@ -11780,6 +11792,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -12125,8 +12139,8 @@ pwr_exe: ...@@ -12125,8 +12139,8 @@ pwr_exe:
3100 100 3100 100
3101 0 3101 0
3102 35 3102 35
3103 358 3103 418
3110 362 3110 422
3111 1 3111 1
3106 3106
3107 3107
...@@ -12428,6 +12442,8 @@ pwr_exe: ...@@ -12428,6 +12442,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
99 99
99 99
...@@ -12699,6 +12715,8 @@ pwr_exe: ...@@ -12699,6 +12715,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -12709,6 +12727,7 @@ pwr_exe: ...@@ -12709,6 +12727,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -12846,6 +12865,8 @@ pwr_exe: ...@@ -12846,6 +12865,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -12856,6 +12877,7 @@ pwr_exe: ...@@ -12856,6 +12877,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -12993,6 +13015,8 @@ pwr_exe: ...@@ -12993,6 +13015,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActTorque 5000 $object.ActTorque
...@@ -13275,6 +13299,8 @@ pwr_exe: ...@@ -13275,6 +13299,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
50 50
5000 $object.ActCurrent 5000 $object.ActCurrent
...@@ -13752,6 +13778,8 @@ pwr_exe: ...@@ -13752,6 +13778,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -13762,6 +13790,7 @@ pwr_exe: ...@@ -13762,6 +13790,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -13899,6 +13928,8 @@ pwr_exe: ...@@ -13899,6 +13928,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -13909,6 +13940,7 @@ pwr_exe: ...@@ -13909,6 +13940,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14114,6 +14146,8 @@ pwr_exe: ...@@ -14114,6 +14146,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -14124,6 +14158,7 @@ pwr_exe: ...@@ -14124,6 +14158,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14261,6 +14296,8 @@ pwr_exe: ...@@ -14261,6 +14296,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 0 1302 0
...@@ -14271,6 +14308,7 @@ pwr_exe: ...@@ -14271,6 +14308,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
...@@ -14808,6 +14846,8 @@ pwr_exe: ...@@ -14808,6 +14846,8 @@ pwr_exe:
1202 1 1202 1
1203 1 1203 1
1204 0 1204 0
1205
1206 0
99 99
13 13
1302 4 1302 4
...@@ -14818,6 +14858,7 @@ pwr_exe: ...@@ -14818,6 +14858,7 @@ pwr_exe:
1307 1307
1308 1308
1309 0 1309 0
1310 0
99 99
99 99
99 99
......
...@@ -29,21 +29,21 @@ ...@@ -29,21 +29,21 @@
100 20 100 20
135 20 135 20
101 20 101 20
102 68 102 40
103 -190 103 -141
104 3.09165 104 3.31378
136 3.09165 136 3.31378
105 100 105 100
106 3 106 3
107 -29 107 -23
108 31.5 108 31.5
109 1 109 1
110 27.05 110 27.05
111 0.5 111 0.5
116 7 116 3
117 0 117 0
118 120 118 124
119 93 119 100
120 0 120 0
121 Claes context 121 Claes context
122 0 122 0
...@@ -6504,8 +6504,8 @@ pwr_exe: ...@@ -6504,8 +6504,8 @@ pwr_exe:
2 2
19 19
1904 O327 1904 O327
1900 23.4499 1900 23.544
1901 18.8028 1901 18.8969
1902 6.50425 1902 6.50425
1903 4.45956 1903 4.45956
1908 0 1908 0
...@@ -6549,7 +6549,7 @@ pwr_exe: ...@@ -6549,7 +6549,7 @@ pwr_exe:
28 28
2800 1.11803 2800 1.11803
2801 0 2801 0
2802 -2.59444 2802 -2.5003
2803 0 2803 0
2804 2.12851 2804 2.12851
2805 -6.6289 2805 -6.6289
...@@ -10245,8 +10245,8 @@ pwr_exe: ...@@ -10245,8 +10245,8 @@ pwr_exe:
3105 3105
19 19
1904 O308 1904 O308
1900 21.9989 1900 22.0258
1901 20.4414 1901 20.4683
1902 22.0116 1902 22.0116
1903 6.55984 1903 6.55984
1908 0 1908 0
...@@ -10290,7 +10290,7 @@ pwr_exe: ...@@ -10290,7 +10290,7 @@ pwr_exe:
28 28
2800 3.11513 2800 3.11513
2801 0 2801 0
2802 -54.4775 2802 -54.4506
2803 0 2803 0
2804 3.09036 2804 3.09036
2805 -15.2272 2805 -15.2272
...@@ -11252,8 +11252,8 @@ pwr_exe: ...@@ -11252,8 +11252,8 @@ pwr_exe:
99 99
20 20
2004 O328 2004 O328
2000 21.15 2000 21.2441
2001 21.15 2001 21.2441
2002 6.46824 2002 6.46824
2003 5.14067 2003 5.14067
2009 442 2009 442
...@@ -11277,7 +11277,7 @@ pwr_exe: ...@@ -11277,7 +11277,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 -0.115673 2802 -0.0215356
2803 0 2803 0
2804 3.6 2804 3.6
2805 -18.6572 2805 -18.6572
...@@ -11310,8 +11310,8 @@ pwr_exe: ...@@ -11310,8 +11310,8 @@ pwr_exe:
3105 3105
19 19
1904 O351 1904 O351
1900 22.4121 1900 22.5062
1901 19.9014 1901 19.9955
1902 6.13255 1902 6.13255
1903 5.50214 1903 5.50214
1908 370 1908 370
...@@ -11355,7 +11355,7 @@ pwr_exe: ...@@ -11355,7 +11355,7 @@ pwr_exe:
28 28
2800 0 2800 0
2801 -0.361252 2801 -0.361252
2802 23.9294 2802 24.0235
2803 0.504327 2803 0.504327
2804 -0 2804 -0
2805 -0.92803 2805 -0.92803
...@@ -11379,8 +11379,8 @@ pwr_exe: ...@@ -11379,8 +11379,8 @@ pwr_exe:
99 99
20 20
2004 O352 2004 O352
2000 19.15 2000 19.2441
2001 19.15 2001 19.2441
2002 5.75 2002 5.75
2003 5.75 2003 5.75
2009 0 2009 0
...@@ -11404,7 +11404,7 @@ pwr_exe: ...@@ -11404,7 +11404,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 -0.1 2802 -0.0058626
2803 0 2803 0
2804 1 2804 1
2805 -1.5 2805 -1.5
...@@ -11413,8 +11413,8 @@ pwr_exe: ...@@ -11413,8 +11413,8 @@ pwr_exe:
99 99
20 20
2004 O353 2004 O353
2000 19.65 2000 19.7441
2001 19.15 2001 19.2441
2002 5.75 2002 5.75
2003 5.75 2003 5.75
2009 442 2009 442
...@@ -11438,7 +11438,7 @@ pwr_exe: ...@@ -11438,7 +11438,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 -0.1 2802 -0.0058626
2803 0 2803 0
2804 1 2804 1
2805 -1.5 2805 -1.5
...@@ -11447,8 +11447,8 @@ pwr_exe: ...@@ -11447,8 +11447,8 @@ pwr_exe:
99 99
20 20
2004 O354 2004 O354
2000 23.15 2000 23.2441
2001 22.65 2001 22.7441
2002 5.75 2002 5.75
2003 5.75 2003 5.75
2009 442 2009 442
...@@ -11472,7 +11472,7 @@ pwr_exe: ...@@ -11472,7 +11472,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 -0.1 2802 -0.0058626
2803 0 2803 0
2804 1 2804 1
2805 -1.5 2805 -1.5
...@@ -11481,8 +11481,8 @@ pwr_exe: ...@@ -11481,8 +11481,8 @@ pwr_exe:
99 99
20 20
2004 O355 2004 O355
2000 22.9 2000 22.9941
2001 22.9 2001 22.9941
2002 6 2002 6
2003 5.5 2003 5.5
2009 442 2009 442
...@@ -11506,7 +11506,7 @@ pwr_exe: ...@@ -11506,7 +11506,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 -0.1 2802 -0.0058626
2803 0 2803 0
2804 1 2804 1
2805 -1.5 2805 -1.5
...@@ -11515,8 +11515,8 @@ pwr_exe: ...@@ -11515,8 +11515,8 @@ pwr_exe:
99 99
30 30
3004 O356 3004 O356
3000 21.7883 3000 21.8825
3001 20.4883 3001 20.5825
3002 5.17208 3002 5.17208
3003 4.47208 3003 4.47208
3008 442 3008 442
...@@ -11540,7 +11540,7 @@ pwr_exe: ...@@ -11540,7 +11540,7 @@ pwr_exe:
28 28
2800 1 2800 1
2801 0 2801 0
2802 1.09473 2802 1.18887
2803 0 2803 0
2804 1 2804 1
2805 -0.867717 2805 -0.867717
......
This diff is collapsed.
...@@ -490,6 +490,8 @@ id ( ...@@ -490,6 +490,8 @@ id (
errh_Info("Received '%s' from nid %s", errh_Info("Received '%s' from nid %s",
cMsg[get->type.s], cdh_NodeIdToString(NULL, mp->hdr.nid, 0, 0)); cMsg[get->type.s], cdh_NodeIdToString(NULL, mp->hdr.nid, 0, 0));
} }
printf("Id Received '%s' from nid %s\n",
cMsg[get->type.s], cdh_NodeIdToString(NULL, mp->hdr.nid, 0, 0));
if (get->sender.nid == gdbroot->my_qid.nid && mp->hdr.nid == gdbroot->db->nid) { if (get->sender.nid == gdbroot->my_qid.nid && mp->hdr.nid == gdbroot->db->nid) {
errh_Error("New node using nid %s, conflicts with local node, '%s' ignored", errh_Error("New node using nid %s, conflicts with local node, '%s' ignored",
...@@ -934,6 +936,8 @@ sendId ( ...@@ -934,6 +936,8 @@ sendId (
errh_Info("Sending 'id' to %s (%s)", errh_Info("Sending 'id' to %s (%s)",
np->name, cdh_NodeIdToString(NULL, np->nid, 0, 0)); np->name, cdh_NodeIdToString(NULL, np->nid, 0, 0));
} }
printf("Sending 'id' to %s (%s)\n",
np->name, cdh_NodeIdToString(NULL, np->nid, 0, 0));
if ( np->handler.nid) if ( np->handler.nid)
tgt = np->handler; tgt = np->handler;
......
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2016 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_qmon_h
#define rt_qmon_h
/* rt_qmon.h -- QCom monitor */
#define qmon_cMsgClassAction 205
typedef enum {
qmon_eMsgTypeAction_NodeActive,
qmon_eMsgTypeAction_NodePassive
} qmon_eMsgTypeAction;
#endif
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "rt_net.h" #include "rt_net.h"
#include "rt_qcom.h" #include "rt_qcom.h"
#include "rt_qcom_msg.h" #include "rt_qcom_msg.h"
#include "rt_qmon.h"
#include "rt_gdh.h" #include "rt_gdh.h"
#include "rt_lst.h" #include "rt_lst.h"
#include "rt_que.h" #include "rt_que.h"
...@@ -361,6 +362,7 @@ static pwr_tStatus redu_node_init(); ...@@ -361,6 +362,7 @@ static pwr_tStatus redu_node_init();
static redu_sNode* get_node( pwr_tNodeId nid); static redu_sNode* get_node( pwr_tNodeId nid);
static void state_change_request( sLink *lp, sIseg *sp, pwr_eRedundancyState state); static void state_change_request( sLink *lp, sIseg *sp, pwr_eRedundancyState state);
static sEseg* request_state_change( sLink *lp, pwr_eRedundancyState state); static sEseg* request_state_change( sLink *lp, pwr_eRedundancyState state);
static void send_state_change();
int int
...@@ -441,7 +443,7 @@ main (int argc, char *argv[]) ...@@ -441,7 +443,7 @@ main (int argc, char *argv[])
} }
l.head.nid = l.nid; l.head.nid = l.nid;
l.head.birth = qdb->my_node->birth = time_Clock(NULL, NULL); l.head.birth = qdb->my_node->link[0].birth = time_Clock(NULL, NULL);
ini_link_info(&l.link_info); ini_link_info(&l.link_info);
do { do {
...@@ -508,7 +510,7 @@ static pwr_tStatus redu_node_init( ) ...@@ -508,7 +510,7 @@ static pwr_tStatus redu_node_init( )
int local_found = 0; int local_found = 0;
sprintf( fname, pwr_cNameReduNode, "$pwrp_load/", qdb->my_node->name, qdb->g->bus); sprintf( fname, pwr_cNameRedcom, "$pwrp_load/", qdb->my_node->link[0].name, qdb->g->bus);
dcli_translate_filename( fname, fname); dcli_translate_filename( fname, fname);
fp = fopen( fname, "r"); fp = fopen( fname, "r");
if ( !fp) if ( !fp)
...@@ -529,13 +531,14 @@ static pwr_tStatus redu_node_init( ) ...@@ -529,13 +531,14 @@ static pwr_tStatus redu_node_init( )
errors++; errors++;
} }
if ( strcmp( name, qdb->my_node->name) == 0) { if ( strcmp( name, qdb->my_node->link[0].name) == 0) {
local_found = 1; local_found = 1;
l.port = atoi(s_port); l.port = atoi(s_port);
if ( l.port == 0) if ( l.port == 0)
l.port = redu_cPort; l.port = redu_cPort;
redu_segment_size = atoi(s_seg_size); redu_segment_size = atoi(s_seg_size);
l.nodep->RedundancyState = atoi(s_state); l.nodep->RedundancyState = atoi(s_state);
qdb->my_node->redundancy_state = l.nodep->RedundancyState;
l.min_resend_time = atoi(s_min_resend_time); l.min_resend_time = atoi(s_min_resend_time);
l.max_resend_time = atoi(s_max_resend_time); l.max_resend_time = atoi(s_max_resend_time);
l.export_buf_quota = atoi(s_export_buf_quota); l.export_buf_quota = atoi(s_export_buf_quota);
...@@ -1245,11 +1248,11 @@ ini_link_info ( ...@@ -1245,11 +1248,11 @@ ini_link_info (
{ {
qdb_sNode *my_np = qdb->my_node; qdb_sNode *my_np = qdb->my_node;
strcpy(lp->name, my_np->name); strcpy(lp->name, my_np->link[0].name);
lp->version = ntohl(my_np->version); lp->version = ntohl(my_np->version);
lp->nid = ntohl(l.nid); lp->nid = ntohl(l.nid);
lp->birth = ntohl(my_np->birth); lp->birth = ntohl(my_np->link[0].birth);
lp->bus = ntohl(qdb->g->bus); lp->bus = ntohl(qdb->g->bus);
lp->os = ntohl(my_np->os); lp->os = ntohl(my_np->os);
lp->hw = ntohl(my_np->hw); lp->hw = ntohl(my_np->hw);
...@@ -1540,7 +1543,7 @@ link_purge ( ...@@ -1540,7 +1543,7 @@ link_purge (
alloc_cnt += sp->size; alloc_cnt += sp->size;
i++; i++;
} }
printf( "link_purge: %d cnt %d (%d)\n", i, lp->np->link.export_alloc_cnt, alloc_cnt); printf( "redcom link_purge: %d cnt %d (%d)\n", i, lp->np->link.export_alloc_cnt, alloc_cnt);
lp->np->link.export_alloc_cnt = alloc_cnt; lp->np->link.export_alloc_cnt = alloc_cnt;
lp->np->link.export_purge_cnt++; lp->np->link.export_purge_cnt++;
l.config->Link[lp->idx].ExportPurged = lp->np->link.export_purge_cnt; l.config->Link[lp->idx].ExportPurged = lp->np->link.export_purge_cnt;
...@@ -2212,6 +2215,8 @@ state_change_request ( ...@@ -2212,6 +2215,8 @@ state_change_request (
case pwr_eRedundancyState_Passive: case pwr_eRedundancyState_Passive:
case pwr_eRedundancyState_Off: case pwr_eRedundancyState_Off:
l.nodep->RedundancyState = state; l.nodep->RedundancyState = state;
qdb->my_node->redundancy_state = l.nodep->RedundancyState;
break; break;
} }
} }
...@@ -2264,6 +2269,8 @@ cyclic_thread () ...@@ -2264,6 +2269,8 @@ cyclic_thread ()
request_state_change( lp, pwr_eRedundancyState_Passive); request_state_change( lp, pwr_eRedundancyState_Passive);
l.config->SetActive = 0; l.config->SetActive = 0;
l.nodep->RedundancyState = pwr_eRedundancyState_Active; l.nodep->RedundancyState = pwr_eRedundancyState_Active;
qdb->my_node->redundancy_state = l.nodep->RedundancyState;
send_state_change();
} }
if ( l.config->SetPassive) { if ( l.config->SetPassive) {
...@@ -2271,6 +2278,8 @@ cyclic_thread () ...@@ -2271,6 +2278,8 @@ cyclic_thread ()
request_state_change( lp, pwr_eRedundancyState_Active); request_state_change( lp, pwr_eRedundancyState_Active);
l.config->SetPassive = 0; l.config->SetPassive = 0;
l.nodep->RedundancyState = pwr_eRedundancyState_Passive; l.nodep->RedundancyState = pwr_eRedundancyState_Passive;
qdb->my_node->redundancy_state = l.nodep->RedundancyState;
send_state_change();
} }
if ( l.config->SetOff) { if ( l.config->SetOff) {
...@@ -2278,8 +2287,32 @@ cyclic_thread () ...@@ -2278,8 +2287,32 @@ cyclic_thread ()
request_state_change( lp, pwr_eRedundancyState_Off); request_state_change( lp, pwr_eRedundancyState_Off);
l.config->SetOff = 0; l.config->SetOff = 0;
l.nodep->RedundancyState = pwr_eRedundancyState_Off; l.nodep->RedundancyState = pwr_eRedundancyState_Off;
qdb->my_node->redundancy_state = l.nodep->RedundancyState;
} }
nanosleep( &ts, NULL); nanosleep( &ts, NULL);
} }
return NULL; return NULL;
} }
void send_state_change()
{
pwr_tStatus sts;
qcom_sPut put;
qcom_sQid qmon_qid = {qcom_cImonAction, 0};
memset( &put, 0, sizeof(put));
put.type.b = (qcom_eBtype) qmon_cMsgClassAction;
switch ( l.nodep->RedundancyState) {
case pwr_eRedundancyState_Active:
put.type.s = (qcom_eStype) qmon_eMsgTypeAction_NodeActive;
break;
case pwr_eRedundancyState_Passive:
put.type.s = (qcom_eStype) qmon_eMsgTypeAction_NodePassive;
break;
}
put.size = 4;
put.data = qcom_Alloc( &sts, put.size);
qcom_Put( &sts, &qmon_qid, &put);
}
...@@ -942,6 +942,11 @@ int rt_report::parse( char *line) ...@@ -942,6 +942,11 @@ int rt_report::parse( char *line)
{ {
char line_array[5][80]; char line_array[5][80];
int num; int num;
char aline[200];
char rline[200];
replace_value( rline, sizeof(rline), line);
dcli_trim( aline, rline);
num = dcli_parse( line, " ", "", num = dcli_parse( line, " ", "",
(char *) line_array, sizeof( line_array)/sizeof( line_array[0]), (char *) line_array, sizeof( line_array)/sizeof( line_array[0]),
...@@ -985,6 +990,10 @@ int rt_report::parse( char *line) ...@@ -985,6 +990,10 @@ int rt_report::parse( char *line)
else else
return 0; return 0;
} }
else if ( strncmp( aline, "system(", 7) == 0 && aline[strlen(aline)-1] == ')') {
aline[strlen(aline)-1] = 0;
system( &aline[7]);
}
else else
return 0; return 0;
......
...@@ -636,7 +636,7 @@ typedef enum { ...@@ -636,7 +636,7 @@ typedef enum {
} pwr_eSafetyLevel; } pwr_eSafetyLevel;
/*_* /*_*
@aref activepassiveenum ActivePassiveEnum @aref redundancystateenum RedundancyStateEnum
*/ */
typedef pwr_tEnum pwr_tRedundancyStateEnum; typedef pwr_tEnum pwr_tRedundancyStateEnum;
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
# define pwr_cNameBaseWttHelp "$pwr_lang/wtt_help.dat" # define pwr_cNameBaseWttHelp "$pwr_lang/wtt_help.dat"
# define pwr_cNameProjectXttHelp "$pwrp_load/xtt_help.dat" # define pwr_cNameProjectXttHelp "$pwrp_load/xtt_help.dat"
# define pwr_cNamePlcXttHelp "$pwrp_load/xtthelp_%s_plc.dat" # define pwr_cNamePlcXttHelp "$pwrp_load/xtthelp_%s_plc.dat"
# define pwr_cNameReduNode "%sld_redunode_%s_%04d.dat" # define pwr_cNameRedcom "%sld_redcom_%s_%04d.dat"
#elif defined OS_VMS || defined OS_ELN #elif defined OS_VMS || defined OS_ELN
......
...@@ -169,7 +169,7 @@ Parameter RTTSYS_NODE_NAME ...@@ -169,7 +169,7 @@ Parameter RTTSYS_NODE_NAME
Text/Dualpar "!" Text/Dualpar "!"
Privileges NO Privileges NO
Outputflags Outputflags
Characters 6 Characters 10
Decimals 0 Decimals 0
MaxLimit 0.000000 MaxLimit 0.000000
MinLimit 0.000000 MinLimit 0.000000
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -137,6 +137,7 @@ cvols_Notify ( ...@@ -137,6 +137,7 @@ cvols_Notify (
put.reply = qcom_cNQid; put.reply = qcom_cNQid;
put.data = (char *)&nmp->msg; put.data = (char *)&nmp->msg;
put.size = nmp->size; put.size = nmp->size;
put.allocate = 1;
nmp->msg.hdr.hdr.xdr = 0; nmp->msg.hdr.hdr.xdr = 0;
nmp->msg.hdr.hdr.msn = 0; nmp->msg.hdr.hdr.msn = 0;
nmp->msg.hdr.hdr.nid = gdbroot->my_node->nid; nmp->msg.hdr.hdr.nid = gdbroot->my_node->nid;
......
...@@ -855,6 +855,7 @@ log_message (errh_sLog *lp, char severity, const char *msg, va_list ap) ...@@ -855,6 +855,7 @@ log_message (errh_sLog *lp, char severity, const char *msg, va_list ap)
if (lp != NULL && lp->send) { if (lp != NULL && lp->send) {
lp->put.data = string; lp->put.data = string;
lp->put.size = strlen(string) + 1; lp->put.size = strlen(string) + 1;
lp->put.allocate = 1;
qcom_Put(NULL, &lp->logQ, &lp->put); qcom_Put(NULL, &lp->logQ, &lp->put);
} }
} }
......
...@@ -215,6 +215,7 @@ struct io_sCtx { ...@@ -215,6 +215,7 @@ struct io_sCtx {
pwr_sClass_IOHandler *IOHandler; /* Pointer to IO Handler object */ pwr_sClass_IOHandler *IOHandler; /* Pointer to IO Handler object */
float ScanTime; /* Scantime supplied by caller */ float ScanTime; /* Scantime supplied by caller */
io_tSupCtx SupCtx; /* Context for supervise object lists */ io_tSupCtx SupCtx; /* Context for supervise object lists */
int read_reset; /* Reset pending read buffers */
}; };
/*----------------------------------------------------------------------------*\ /*----------------------------------------------------------------------------*\
......
...@@ -68,6 +68,7 @@ mh_NetSendMessage( ...@@ -68,6 +68,7 @@ mh_NetSendMessage(
if ((msg.data = (char*)qcom_Alloc(&sts, size)) == NULL) if ((msg.data = (char*)qcom_Alloc(&sts, size)) == NULL)
return sts; return sts;
msg.allocate = 0;
msg.type.b = mh_cMsgClass; msg.type.b = mh_cMsgClass;
msg.type.s = subtype; msg.type.s = subtype;
msg.reply = hp->qid; msg.reply = hp->qid;
......
...@@ -220,6 +220,7 @@ sendMessage ( ...@@ -220,6 +220,7 @@ sendMessage (
put.reply.qix = 0; put.reply.qix = 0;
put.reply.nid = 0; put.reply.nid = 0;
put.size = sizeof(*head); put.size = sizeof(*head);
put.allocate = 1;
qcom_Put(&sts, target, &put); qcom_Put(&sts, target, &put);
......
...@@ -415,6 +415,7 @@ Error ( ...@@ -415,6 +415,7 @@ Error (
put.reply = qcom_cNQid; put.reply = qcom_cNQid;
put.data = (char *)&err; put.data = (char *)&err;
put.size = sizeof(err); put.size = sizeof(err);
put.allocate = 1;
qcom_Put(&sts, &tgt, &put); qcom_Put(&sts, &tgt, &put);
...@@ -494,6 +495,7 @@ Put ( ...@@ -494,6 +495,7 @@ Put (
put.type.s = subtype; put.type.s = subtype;
put.msg_id = id; put.msg_id = id;
put.size = size; put.size = size;
put.allocate = 0;
put.data = qcom_Alloc(&lsts, size); put.data = qcom_Alloc(&lsts, size);
if (put.data == NULL) if (put.data == NULL)
......
...@@ -192,6 +192,7 @@ struct plc_sThread { ...@@ -192,6 +192,7 @@ struct plc_sThread {
unsigned int sim_idx; unsigned int sim_idx;
unsigned int sim_halted; unsigned int sim_halted;
unsigned int sim_singlestep; unsigned int sim_singlestep;
pwr_tRedundancyStateEnum redu_state_old;
redu_tCtx redu; redu_tCtx redu;
}; };
......
...@@ -478,18 +478,6 @@ scan ( ...@@ -478,18 +478,6 @@ scan (
tp->ActualScanTime = MIN_SCANTIME; tp->ActualScanTime = MIN_SCANTIME;
} }
if (pp->IOHandler->IOReadWriteFlag) {
sts = io_read(tp->plc_io_ctx);
if (EVEN(sts)) {
pp->IOHandler->IOReadWriteFlag = FALSE;
errh_Error("IO read, %m", sts);
errh_SetStatus( PLC__IOREAD);
}
}
if ( pp->Node->EmergBreakTrue && !tp->emergency_break_old)
io_swap(tp->plc_io_ctx, io_eEvent_EmergencyBreak);
tp->emergency_break_old = pp->Node->EmergBreakTrue;
if ( tp->redu && tp->pp->Node->RedundancyState == pwr_eRedundancyState_Passive) { if ( tp->redu && tp->pp->Node->RedundancyState == pwr_eRedundancyState_Passive) {
time_GetTimeMonotonic(&tp->before_scan); time_GetTimeMonotonic(&tp->before_scan);
time_GetTime(&tp->before_scan_abs); time_GetTime(&tp->before_scan_abs);
...@@ -511,11 +499,32 @@ scan ( ...@@ -511,11 +499,32 @@ scan (
tp->one_before_scan = tp->before_scan; tp->one_before_scan = tp->before_scan;
tp->ActualScanTime = tp->f_scan_time; tp->ActualScanTime = tp->f_scan_time;
tp->redu_state_old = tp->pp->Node->RedundancyState;
return; return;
} }
if ( tp->pp->Node->RedundancyState != pwr_eRedundancyState_Passive) { if ( tp->pp->Node->RedundancyState != pwr_eRedundancyState_Passive) {
if (pp->IOHandler->IOReadWriteFlag) {
if ( tp->redu_state_old == pwr_eRedundancyState_Passive)
tp->plc_io_ctx->read_reset = 1;
sts = io_read(tp->plc_io_ctx);
if ( tp->redu_state_old == pwr_eRedundancyState_Passive)
tp->plc_io_ctx->read_reset = 0;
if (EVEN(sts)) {
pp->IOHandler->IOReadWriteFlag = FALSE;
errh_Error("IO read, %m", sts);
errh_SetStatus( PLC__IOREAD);
}
tp->redu_state_old = tp->pp->Node->RedundancyState;
}
if ( pp->Node->EmergBreakTrue && !tp->emergency_break_old)
io_swap(tp->plc_io_ctx, io_eEvent_EmergencyBreak);
tp->emergency_break_old = pp->Node->EmergBreakTrue;
thread_MutexLock(&pp->io_copy_mutex); thread_MutexLock(&pp->io_copy_mutex);
memcpy(tp->copy.ai_a.p, pp->base.ai_a.p, tp->copy.ai_a.size); memcpy(tp->copy.ai_a.p, pp->base.ai_a.p, tp->copy.ai_a.size);
......
...@@ -98,6 +98,7 @@ extern "C" ...@@ -98,6 +98,7 @@ extern "C"
#define qcom_cIhdClient (1<<31 | 105) #define qcom_cIhdClient (1<<31 | 105)
#define qcom_cInacp (1<<31 | 106) #define qcom_cInacp (1<<31 | 106)
#define qcom_cIini (1<<31 | 107) #define qcom_cIini (1<<31 | 107)
#define qcom_cImonAction (1<<31 | 108)
/** @defgroup QCOM_DS Qcom Data Structures /** @defgroup QCOM_DS Qcom Data Structures
* @ingroup QCOM * @ingroup QCOM
......
...@@ -432,6 +432,8 @@ qdb_Alloc ( ...@@ -432,6 +432,8 @@ qdb_Alloc (
bp = pool_Alloc(sts, &qdb->pool, sizeof(*bp) + size); bp = pool_Alloc(sts, &qdb->pool, sizeof(*bp) + size);
if (bp == NULL) return NULL; if (bp == NULL) return NULL;
// printf( "qdb_Alloc %u %ld %u\n", bp, pool_Reference(sts,&qdb->pool,bp),size);
bp->c.type = btype; bp->c.type = btype;
switch (btype) { switch (btype) {
...@@ -584,6 +586,8 @@ qdb_Free ( ...@@ -584,6 +586,8 @@ qdb_Free (
qdb_AssumeLocked; qdb_AssumeLocked;
// printf( "qdb_Free %u %ld\n", bp, pool_Reference(sts,&qdb->pool,bp));
switch (bp->c.type) { switch (bp->c.type) {
case qdb_eBuffer_base: case qdb_eBuffer_base:
if (pool_QisLinked(sts, &qdb->pool, &bp->c.ll)) if (pool_QisLinked(sts, &qdb->pool, &bp->c.ll))
...@@ -767,11 +771,12 @@ qdb_CreateDb ( ...@@ -767,11 +771,12 @@ qdb_CreateDb (
np->sa.sin_addr.s_addr = htonl(INADDR_ANY); np->sa.sin_addr.s_addr = htonl(INADDR_ANY);
np->sa.sin_port = htons(55000 + qdb->g->bus); np->sa.sin_port = htons(55000 + qdb->g->bus);
time_GetTime(&time); time_GetTime(&time);
np->birth = time.tv_sec; np->link[0].birth = time.tv_sec;
qdb->no_node = qdb_AddNode(sts, 0, qdb_mAdd_failIfAdded); qdb->no_node = qdb_AddNode(sts, 0, qdb_mAdd_failIfAdded);
if (qdb->no_node == NULL) errh_Bugcheck(*sts, "creating the unknown node"); if (qdb->no_node == NULL) errh_Bugcheck(*sts, "creating the unknown node");
strcpy(qdb->no_node->name, "*** I am the unknown node ***"); strcpy(qdb->no_node->nidstr, "*** 0.0.0.0 ***");
strcpy(qdb->no_node->link[0].name, "******");
qdb->g->up = TRUE; qdb->g->up = TRUE;
qdb->g->tmo_export = 10000; qdb->g->tmo_export = 10000;
...@@ -1473,16 +1478,16 @@ qdb_NodeInfo ( ...@@ -1473,16 +1478,16 @@ qdb_NodeInfo (
pwr_Status(status, QDB__SUCCESS); pwr_Status(status, QDB__SUCCESS);
node->flags.b.initiated = np->flags.b.initiated; node->flags.b.initiated = np->link[np->clx].qflags.b.initiated;
node->flags.b.connected = np->flags.b.connected; node->flags.b.connected = np->link[np->clx].qflags.b.connected;
node->flags.b.active = np->flags.b.active; node->flags.b.active = np->link[np->clx].qflags.b.active;
node->nid = np->nid; node->nid = np->nid;
strncpy(node->name, np->name, sizeof(np->name)); strncpy(node->name, np->link[np->clx].name, sizeof(node->name));
node->os = np->os; node->os = np->os;
node->hw = np->hw; node->hw = np->hw;
node->bo = np->bo; node->bo = np->bo;
node->ft = np->ft; node->ft = np->ft;
node->connection = np->connection; node->connection = np->link[np->clx].connection;
} }
void void
...@@ -1524,8 +1529,8 @@ qdb_Que ( ...@@ -1524,8 +1529,8 @@ qdb_Que (
np = hash_Search(sts, &qdb->nid_ht, &q.pwr.nid); np = hash_Search(sts, &qdb->nid_ht, &q.pwr.nid);
if (np == NULL) pwr_Return(NULL, sts, QCOM__NOLINK); if (np == NULL) pwr_Return(NULL, sts, QCOM__NOLINK);
if (!np->flags.b.connected) pwr_Return(NULL, sts, QCOM__NOLINK); if (!np->link[np->clx].qflags.b.connected) pwr_Return(NULL, sts, QCOM__NOLINK);
if (!np->flags.b.active && !qdb->flags.b.ignoreStall) pwr_Return(NULL, sts, QCOM__LINKDOWN); if (!np->link[np->clx].qflags.b.active && !qdb->flags.b.ignoreStall) pwr_Return(NULL, sts, QCOM__LINKDOWN);
/* the que may exist on the remote node, lets export it */ /* the que may exist on the remote node, lets export it */
qp = qdb->exportque; qp = qdb->exportque;
......
...@@ -439,32 +439,6 @@ typedef struct { ...@@ -439,32 +439,6 @@ typedef struct {
int ts pwr_dPacked; /* Time stamp. */ int ts pwr_dPacked; /* Time stamp. */
} qdb_sAck; } qdb_sAck;
typedef struct {
qdb_mLink flags;
int win_count;
int win_max;
float rtt_rxmax;
float rtt_rxmin;
float rtt_rtt;
float rtt_srtt;
float rtt_var;
float rtt_rto;
qdb_sAck lack;
qdb_sAck rack;
int seq;
pwr_tBoolean pending_rack;
pwr_tTime rack_tmo;
qcom_tBus bus;
struct sockaddr_in sa;
pwr_tDeltaTime timer;
int export_quota;
int export_alloc_cnt;
int export_purge_cnt;
int err_red;
int err_seq;
int err_seg_seq;
} qdb_sLink;
typedef char qdb_tQname[32]; typedef char qdb_tQname[32];
typedef struct { typedef struct {
...@@ -601,6 +575,66 @@ typedef struct { ...@@ -601,6 +575,66 @@ typedef struct {
pool_sQlink tgt_ll; pool_sQlink tgt_ll;
} qdb_sQbond; } qdb_sQbond;
typedef struct {
qdb_mLink flags;
pwr_tUInt32 birth; /* current incarnation identity */
int win_count;
int win_max;
float rtt_rxmax;
float rtt_rxmin;
float rtt_rtt;
float rtt_srtt;
float rtt_var;
float rtt_rto;
qdb_sAck lack;
qdb_sAck rack;
int seq;
pwr_tBoolean pending_rack;
pwr_tTime rack_tmo;
qcom_tBus bus;
struct sockaddr_in sa;
pwr_tDeltaTime timer;
int export_quota;
int export_alloc_cnt;
int export_purge_cnt;
int err_red;
int err_seq;
int err_seg_seq;
/* Moved from qdb_sNode */
char name[80]; /* ascii name of node (nul-terminated)
zero-length means empty slot */
pwr_tBoolean up; /* communication is up/down */
qdb_mNode qflags;
pwr_tUInt32 upcnt; /* # of times up */
pwr_tTime timeup; /* Most recent time link came up */
pwr_tTime timedown; /* Most recent time link went down */
pwr_tUInt32 thrown_bufs;
pwr_tUInt32 thrown_segs;
pwr_tUInt32 lost_segs;
/* broadcast */
qcom_tRid bc_snd_id;
qcom_tRid bc_rcv_id;
/* The following attributes may only be used by rt_qimp. */
qdb_sBuffer *bp;
pwr_tBoolean in_arp;
struct arpreq arp;
void *mon; /* Monitor private data. */
qcom_eNodeConnection connection; /* Type of connection */
pwr_tUInt32 min_resend_time;
pwr_tUInt32 max_resend_time;
pwr_tUInt32 export_buf_quota;
pwr_tFloat32 ack_delay;
pwr_tUInt32 seg_size;
} qdb_sLink;
typedef struct { typedef struct {
qcom_tQix qix; qcom_tQix qix;
pool_sQlink qix_htl; pool_sQlink qix_htl;
...@@ -635,12 +669,11 @@ typedef struct { ...@@ -635,12 +669,11 @@ typedef struct {
typedef struct { typedef struct {
pwr_tNodeId nid; /* node identity */ pwr_tNodeId nid; /* node identity */
pwr_tBoolean initiated; /* are values valid */ pwr_tBoolean initiated; /* are values valid */
pwr_tUInt32 birth; /* current incarnation identity */
pool_sQlink nid_htl; /* link in nid-to-node hash table */ pool_sQlink nid_htl; /* link in nid-to-node hash table */
pool_sQlink node_ll; /* link in list of all links */ pool_sQlink node_ll; /* link in list of all links */
pool_sQlink own_lh; /* */ pool_sQlink own_lh; /* */
pwr_tUInt32 own_lc; /* number of owned volumes */ pwr_tUInt32 own_lc; /* number of owned volumes */
char name[80]; /* ascii name of node (nul-terminated) char nidstr[20]; /* ascii name of node (nul-terminated)
zero-length means empty slot */ zero-length means empty slot */
int version; /* Qcom protocol version */ int version; /* Qcom protocol version */
...@@ -649,41 +682,15 @@ typedef struct { ...@@ -649,41 +682,15 @@ typedef struct {
co_eBO bo; /* byte order */ co_eBO bo; /* byte order */
co_eFT ft; /* float type */ co_eFT ft; /* float type */
qdb_sLink link; /* Qmon link information. */ unsigned int clx; /* Current link index */
pwr_tBoolean up; /* communication is up/down */ unsigned int is_secondary; /* Node is secondary */
qdb_mNode flags; pwr_eRedundancyState redundancy_state; /* Redundancy state, active, passive or off */
pwr_tUInt32 upcnt; /* # of times up */ unsigned int link_cnt; /* Number of links */
pwr_tTime timeup; /* Most recent time link came up */ qdb_sLink link[2]; /* Qmon link information for primary and secondary link */
pwr_tTime timedown; /* Most recent time link went down */ struct sockaddr_in sa;
pool_sQlink bcb_lh; /* broadcast buffer list header */
qdb_sCount get; qdb_sCount get;
qdb_sCount put; qdb_sCount put;
pwr_tUInt32 thrown_bufs;
pwr_tUInt32 thrown_segs;
pwr_tUInt32 lost_segs;
/* broadcast */
pool_sQlink bcb_lh; /* broadcast buffer list header */
qcom_tRid bc_snd_id;
qcom_tRid bc_rcv_id;
/* The following attributes may only be used by rt_qimp. */
qdb_sBuffer *bp;
pwr_tBoolean in_arp;
struct arpreq arp;
struct sockaddr_in sa;
void *mon; /* Monitor private data. */
qcom_eNodeConnection connection; /* Type of connection */
pwr_tUInt32 min_resend_time;
pwr_tUInt32 max_resend_time;
pwr_tUInt32 export_buf_quota;
pwr_tFloat32 ack_delay;
pwr_tUInt32 seg_size;
} qdb_sNode; } qdb_sNode;
typedef struct { typedef struct {
......
...@@ -61,7 +61,8 @@ addNode ( ...@@ -61,7 +61,8 @@ addNode (
np = qdb_AddNode(&sts, nep->nid, 0); np = qdb_AddNode(&sts, nep->nid, 0);
if (np == NULL) return NULL; if (np == NULL) return NULL;
strcpy(np->name, nep->name); strcpy(np->link[0].name, nep->name);
strncpy( np->nidstr, cdh_NodeIdToString( 0, nep->nid, 0, 0), sizeof(np->nidstr));
np->sa.sin_family = AF_INET; np->sa.sin_family = AF_INET;
np->sa.sin_addr.s_addr = nep->naddr.s_addr; np->sa.sin_addr.s_addr = nep->naddr.s_addr;
if (nep->flags.b.port) if (nep->flags.b.port)
...@@ -69,14 +70,33 @@ addNode ( ...@@ -69,14 +70,33 @@ addNode (
else else
np->sa.sin_port = htons(55000 + qdb->g->bus); np->sa.sin_port = htons(55000 + qdb->g->bus);
memcpy(&np->arp.arp_pa.sa_data, &np->sa.sin_addr.s_addr, sizeof(np->sa.sin_addr.s_addr)); memcpy(&np->link[0].arp.arp_pa.sa_data, &np->link[0].sa.sin_addr.s_addr, sizeof(np->link[0].sa.sin_addr.s_addr));
np->connection = nep->connection; np->link[0].sa.sin_family = AF_INET;
np->min_resend_time = nep->min_resend_time; if ( nep->port)
np->max_resend_time = nep->max_resend_time; np->link[0].sa.sin_port = nep->port;
np->export_buf_quota = nep->export_buf_quota; else
np->ack_delay = nep->ack_delay; np->link[0].sa.sin_port = htons(55000 + qdb->g->bus);
np->seg_size = nep->seg_size; np->link[0].sa.sin_addr.s_addr = nep->naddr.s_addr;
np->link[0].connection = nep->connection;
np->link[0].min_resend_time = nep->min_resend_time;
np->link[0].max_resend_time = nep->max_resend_time;
np->link[0].export_buf_quota = nep->export_buf_quota;
np->link[0].ack_delay = nep->ack_delay;
np->link[0].seg_size = nep->seg_size;
np->link_cnt++;
np->is_secondary = nep->is_secondary;
if ( strcmp( nep->secondary_name, "") != 0) {
strcpy(np->link[1].name, nep->secondary_name);
np->link[1].sa.sin_family = AF_INET;
if ( nep->port)
np->link[1].sa.sin_port = nep->port;
else
np->link[1].sa.sin_port = htons(55000 + qdb->g->bus);
np->link[1].sa.sin_addr.s_addr = nep->secondary_naddr.s_addr;
np->link_cnt++;
}
return np; return np;
} }
...@@ -138,6 +158,9 @@ qini_ParseFile ( ...@@ -138,6 +158,9 @@ qini_ParseFile (
char s_export_buf_quota[20]; char s_export_buf_quota[20];
char s_ack_delay[20]; char s_ack_delay[20];
char s_seg_size[20]; char s_seg_size[20];
char s_is_secondary[20];
char secondary_name[80];
char s_secondary_naddr[80];
pwr_tNodeId nid; pwr_tNodeId nid;
struct in_addr naddr; struct in_addr naddr;
qini_sNode *nep; qini_sNode *nep;
...@@ -150,8 +173,9 @@ qini_ParseFile ( ...@@ -150,8 +173,9 @@ qini_ParseFile (
continue; continue;
} }
n = sscanf(s, "%s %s %s %s %s %s %s %s %s %s", name, s_nid, s_naddr, s_port, s_connection, n = sscanf(s, "%s %s %s %s %s %s %s %s %s %s %s %s %s", name, s_nid, s_naddr, s_port, s_connection,
s_min_resend_time, s_max_resend_time, s_export_buf_quota, s_ack_delay, s_seg_size); s_min_resend_time, s_max_resend_time, s_export_buf_quota, s_ack_delay, s_seg_size,
s_is_secondary, secondary_name, s_secondary_naddr);
if (n < 3) { if (n < 3) {
errh_Error("error in line, <wrong number of arguments>, skip to next line.\n>> %s", s); errh_Error("error in line, <wrong number of arguments>, skip to next line.\n>> %s", s);
(*errors)++; (*errors)++;
...@@ -208,7 +232,7 @@ qini_ParseFile ( ...@@ -208,7 +232,7 @@ qini_ParseFile (
nep = tree_Find(&sts, ntp, &nid); nep = tree_Find(&sts, ntp, &nid);
if (nep != NULL) { if (nep != NULL) {
errh_Warning("node is allready defined: %s, skip to next line", s); errh_Warning("node is already defined: %s, skip to next line", s);
(*warnings)++; (*warnings)++;
continue; continue;
} else { } else {
...@@ -240,6 +264,21 @@ qini_ParseFile ( ...@@ -240,6 +264,21 @@ qini_ParseFile (
else else
nep->seg_size = 8192; nep->seg_size = 8192;
if (n > 8)
nep->is_secondary = atoi(s_is_secondary);
if (n > 9 && strcmp( secondary_name, "-") != 0)
strcpy(nep->secondary_name, secondary_name);
if (n > 10 && strcmp( s_secondary_naddr, "-") != 0) {
sts = net_StringToAddr( s_secondary_naddr, &naddr);
nep->secondary_naddr.s_addr = htonl(naddr.s_addr);
if ( EVEN(sts)) {
errh_Error("error in line, <network address>, skip to next line.\n>> %s", s);
(*errors)++;
continue;
}
}
memset(&arpreq, 0, sizeof(arpreq)); memset(&arpreq, 0, sizeof(arpreq));
memcpy(&arpreq.arp_pa.sa_data, &naddr, sizeof(naddr)); memcpy(&arpreq.arp_pa.sa_data, &naddr, sizeof(naddr));
......
...@@ -115,6 +115,9 @@ typedef struct { ...@@ -115,6 +115,9 @@ typedef struct {
pwr_tUInt32 export_buf_quota; pwr_tUInt32 export_buf_quota;
pwr_tFloat32 ack_delay; pwr_tFloat32 ack_delay;
pwr_tUInt32 seg_size; pwr_tUInt32 seg_size;
unsigned int is_secondary;
char secondary_name[80];
struct in_addr secondary_naddr;
} qini_sNode; } qini_sNode;
int qini_ParseFile (FILE*, tree_sTable*, int*, int*, int*); int qini_ParseFile (FILE*, tree_sTable*, int*, int*, int*);
......
This diff is collapsed.
...@@ -831,7 +831,7 @@ int rtt_cli( rtt_t_comtbl *command_table, ...@@ -831,7 +831,7 @@ int rtt_cli( rtt_t_comtbl *command_table,
if ( hitnr > 1) if ( hitnr > 1)
{ {
/* Command not unic */ /* Command not unique */
return RTT__COM_AMBIG; return RTT__COM_AMBIG;
} }
else if ( hitnr < 1) else if ( hitnr < 1)
...@@ -899,7 +899,7 @@ int rtt_cli( rtt_t_comtbl *command_table, ...@@ -899,7 +899,7 @@ int rtt_cli( rtt_t_comtbl *command_table,
} }
else if ( hitnr > 1) else if ( hitnr > 1)
{ {
/* qualifier not unic */ /* qualifier not unique */
return RTT__QUAL_AMBIG; return RTT__QUAL_AMBIG;
} }
/* Place back the / and = within quotes */ /* Place back the / and = within quotes */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment