16 #ifndef CONFIG_CHANGE_H
17 #define CONFIG_CHANGE_H
19 #include "SignalData.hpp"
33 STATIC_CONST( SignalLength = 1 );
51 STATIC_CONST( SignalLength = 1 );
72 ConfigChangeOnGoing = 1,
78 IllegalConfigChange = 7,
80 InvalidGeneration = 9,
81 InvalidConfigName = 10,
82 IllegalInitialState = 11,
83 IllegalInitialGeneration = 12,
84 DifferentInitial = 13,
86 NotPrimaryMgmNode = 15,
90 STATIC_CONST( SignalLength = 1 );
92 static const char* errorMessage(Uint32 error) {
94 case ConfigChangeOnGoing:
95 return "Config change ongoing";
97 return "Not the config change master";
99 return "No config data in signal";
101 return "Config is not ok";
103 return "ConfigChangeRef, internal error";
105 return "Prepare of config change failed";
106 case IllegalConfigChange:
107 return "Illegal configuration change";
109 return "Failed to unpack the configuration";
110 case InvalidGeneration:
111 return "Invalid generation in configuration";
112 case InvalidConfigName:
113 return "Invalid configuration name in configuration";
114 case IllegalInitialState:
115 return "Initial config change not allowed in this state";
116 case IllegalInitialGeneration:
117 return "Initial config change with generation not 0";
118 case DifferentInitial:
119 return "Different initial config files";
121 return " Not all mgm nodes are started";
122 case NotPrimaryMgmNode:
123 return "Not primary mgm node for configuration";
125 return "Failed to send signal to other node";
128 return "ConfigChangeRef, unknown error";
149 STATIC_CONST( SignalLength = 3 );
165 STATIC_CONST( SignalLength = 1 );
178 STATIC_CONST( SignalLength = 1 );
196 STATIC_CONST( SignalLengthBeforeChecksum = 2 );
197 STATIC_CONST( SignalLength = 3 );
217 STATIC_CONST( SignalLength = 2 );
242 static const char* errorMessage(Uint32 error) {
245 return "Wrong state";
246 case WrongGeneration:
247 return "Wrong generation";
249 return "Wrong checksum";
252 return "ConfigCheckRef, unknown error";
256 STATIC_CONST( SignalLength = 5 );
257 STATIC_CONST( SignalLengthWithConfig = 6 );
261 Uint32 expected_generation;
263 Uint32 expected_state;