1 mday 1.1 //%///-*-c++-*-/////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 mday 1.1 //==============================================================================
23 //
24 // Author: Mike Day (mdday@us.ibm.com)
25 //
26 // Modified By:
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #include "CimomMessage.h"
31
32 PEGASUS_NAMESPACE_BEGIN
33
34 const Uint32 CIMOM_Q_ID = MessageQueue::getNextQueueId();
35
36 const Uint32 async_results::OK = 0x00000000;
37 const Uint32 async_results::PARAMETER_ERROR = 0x00000001;
38 const Uint32 async_results::MODULE_ALREADY_REGISTERED = 0x00000002;
39 const Uint32 async_results::MODULE_NOT_FOUND = 0x00000003;
40 const Uint32 async_results::INTERNAL_ERROR = 0x00000004;
41
42
43 mday 1.1 const Uint32 async_results::ASYNC_STARTED = 0x00000005;
44 const Uint32 async_results::ASYNC_PROCESSING = 0x00000006;
45 const Uint32 async_results::ASYNC_COMPLETE = 0x00000007;
46 const Uint32 async_results::ASYNC_CANCELLED = 0x00000008;
47 const Uint32 async_results::ASYNC_PAUSED = 0x00000009;
48 const Uint32 async_results::ASYNC_RESUMED = 0x0000000a;
49
50 const Uint32 async_results::CIM_SERVICE_STARTED = 0x0000000b;
51 const Uint32 async_results::CIM_SERVICE_STOPPED = 0x0000000c;
52
53 const Uint32 async_results::CIM_SERVICE_PAUSED = 0x0000000d;
54 const Uint32 async_results::CIM_SERVICE_RESUMED = 0x0000000e;
55 const Uint32 async_results::CIM_NAK = 0x0000000f;
56
57 const Uint32 async_results::ASYNC_PHASE_COMPLETE = 0x00000010;
58 const Uint32 async_results::ASYNC_CHILD_COMPLETE = 0x00000011;
59 const Uint32 async_results::ASYNC_PHASE_STARTED = 0x00000012;
60 const Uint32 async_results::ASYNC_CHILD_STARTED = 0x00000013;
|
61 mday 1.4 const Uint32 async_results::CIM_PAUSED = 0x00000014;
62 const Uint32 async_results::CIM_STOPPED = 0x00000015;
63
|
64 mday 1.1
65
66 const Uint32 async_messages::HEARTBEAT = 0x00000000;
67 const Uint32 async_messages::REPLY = 0x00000000;
68 const Uint32 async_messages::REGISTER_CIM_SERVICE = 0x00000001;
69 const Uint32 async_messages::DEREGISTER_CIM_SERVICE = 0x00000002;
70 const Uint32 async_messages::UPDATE_CIM_SERVICE = 0x00000003;
71 const Uint32 async_messages::IOCTL = 0x00000004;
72 const Uint32 async_messages::CIMSERVICE_START = 0x00000005;
73 const Uint32 async_messages::CIMSERVICE_STOP = 0x00000006;
74 const Uint32 async_messages::CIMSERVICE_PAUSE = 0x00000007;
75 const Uint32 async_messages::CIMSERVICE_RESUME = 0x00000008;
76
77 const Uint32 async_messages::ASYNC_OP_START = 0x00000009;
78 const Uint32 async_messages::ASYNC_OP_RESULT = 0x0000000a;
79 const Uint32 async_messages::ASYNC_LEGACY_OP_START = 0x0000000b;
80 const Uint32 async_messages::ASYNC_LEGACY_OP_RESULT = 0x0000000c;
81
82 const Uint32 async_messages::FIND_SERVICE_Q = 0x0000000d;
83 const Uint32 async_messages::FIND_SERVICE_Q_RESULT = 0x0000000e;
84 const Uint32 async_messages::ENUMERATE_SERVICE = 0x0000000f;
85 mday 1.1 const Uint32 async_messages::ENUMERATE_SERVICE_RESULT = 0x00000010;
86
87
88 AsyncMessage::AsyncMessage(Uint32 type,
89 Uint32 key,
90 Uint32 routing,
91 Uint32 mask,
92 AsyncOpNode *operation)
93 : Message(type, key, routing, mask | message_mask::ha_async),
|
94 mday 1.3 op(operation),
95 _myself(0),
96 _service(0)
|
97 mday 1.1 {
98
99 }
100
101
102 AsyncRequest::AsyncRequest(Uint32 type,
103 Uint32 key,
104 Uint32 routing,
105 Uint32 mask,
106 AsyncOpNode *operation,
107 Uint32 destination,
108 Uint32 response,
109 Boolean blocking)
110 : AsyncMessage(type, key, routing, mask | message_mask::ha_request, operation),
111 dest(destination),
112 resp(response),
113 block(blocking)
114 {
|
115 mday 1.2 if( op != 0 )
116 op->put_request(this);
|
117 mday 1.1 }
118
119 AsyncReply::AsyncReply(Uint32 type,
120 Uint32 key,
121 Uint32 routing,
122 Uint32 mask,
123 AsyncOpNode *operation,
124 Uint32 result_code,
125 Uint32 destination,
126 Boolean blocking)
127 : AsyncMessage(type, key, routing, mask | message_mask::ha_reply, operation),
128 result(result_code),
129 dest(destination),
130 block(blocking)
131 {
|
132 mday 1.2 if( op != 0 )
133 op->put_response(this);
|
134 mday 1.1 }
135
136
137
138
139 RegisterCimService::RegisterCimService(Uint32 routing,
140 AsyncOpNode *operation,
141 Boolean blocking,
142 String service_name,
143 Uint32 service_capabilities,
144 Uint32 service_mask,
145 Uint32 service_queue)
146 : AsyncRequest( async_messages::REGISTER_CIM_SERVICE,
147 Message::getNextKey(),
148 routing, 0, operation, CIMOM_Q_ID,
149 service_queue, blocking),
150 name(service_name),
151 capabilities(service_capabilities),
152 mask(service_mask),
153 queue(service_queue)
154 {
155 mday 1.1
156 }
157
158
159 DeRegisterCimService::DeRegisterCimService(Uint32 routing,
160 AsyncOpNode *operation,
161 Boolean blocking,
162 Uint32 service_queue)
163 : AsyncRequest( async_messages::DEREGISTER_CIM_SERVICE,
164 Message::getNextKey(),
165 routing, 0, operation, CIMOM_Q_ID,
166 service_queue, blocking),
167 queue(service_queue)
168 {
169
170 }
171
172
173
174 UpdateCimService::UpdateCimService(Uint32 routing,
175 AsyncOpNode *operation,
176 mday 1.1 Boolean blocking,
177 Uint32 service_queue,
178 Uint32 service_capabilities,
179 Uint32 service_mask)
180 : AsyncRequest( async_messages::UPDATE_CIM_SERVICE,
181 Message::getNextKey(),
182 routing, 0, operation, CIMOM_Q_ID,
183 service_queue, blocking),
184 queue(service_queue),
185 capabilities(service_capabilities),
186 mask(service_mask)
187 {
188
189 }
190
191
192 AsyncIoctl::AsyncIoctl(Uint32 routing,
193 AsyncOpNode *operation,
194 Uint32 destination,
195 Uint32 response,
196 Boolean blocking,
197 mday 1.1 Uint32 code,
198 Uint32 int_param,
199 void *p_param)
200 : AsyncRequest( async_messages::IOCTL,
201 Message::getNextKey(),
202 routing, 0, operation,
203 destination, response, blocking),
204 ctl(code),
205 intp(int_param),
|
206 mday 1.3 voidp(p_param)
|
207 mday 1.1 {
208
209 }
210
211
212 CimServiceStart::CimServiceStart(Uint32 routing,
213 AsyncOpNode *operation,
214 Uint32 destination,
215 Uint32 response,
216 Boolean blocking)
217 : AsyncRequest(async_messages::CIMSERVICE_START,
218 Message::getNextKey(), routing,
219 0, operation, destination,
220 response, blocking)
221 {
222
223 }
224
225
226 CimServiceStop::CimServiceStop(Uint32 routing,
227 AsyncOpNode *operation,
228 mday 1.1 Uint32 destination,
229 Uint32 response,
230 Boolean blocking)
231 : AsyncRequest(async_messages::CIMSERVICE_STOP,
232 Message::getNextKey(), routing,
233 0, operation, destination,
234 response, blocking)
235 {
236
237 }
238
239
240
241 CimServicePause::CimServicePause(Uint32 routing,
242 AsyncOpNode *operation,
243 Uint32 destination,
244 Uint32 response,
245 Boolean blocking)
246 : AsyncRequest(async_messages::CIMSERVICE_PAUSE,
247 Message::getNextKey(), routing,
248 0, operation, destination,
249 mday 1.1 response, blocking)
250 {
251
252 }
253
254
255 CimServiceResume::CimServiceResume(Uint32 routing,
256 AsyncOpNode *operation,
257 Uint32 destination,
258 Uint32 response,
259 Boolean blocking)
260 : AsyncRequest(async_messages::CIMSERVICE_RESUME,
261 Message::getNextKey(), routing,
262 0, operation, destination,
263 response, blocking)
264 {
265
266 }
267
268 AsyncOperationStart::AsyncOperationStart(Uint32 routing,
269 AsyncOpNode *operation,
270 mday 1.1 Uint32 destination,
271 Uint32 response,
272 Boolean blocking,
273 Message *action)
274 : AsyncRequest(async_messages::ASYNC_OP_START,
275 Message::getNextKey(), routing, 0,
276 operation,
277 destination, response, blocking),
278 act(action)
279 {
|
280 mday 1.2 if( op != 0 )
281 op->put_request(act);
|
282 mday 1.1 }
283
284
285 AsyncOperationResult::AsyncOperationResult(Uint32 key,
286 Uint32 routing,
287 AsyncOpNode *operation,
288 Uint32 result_code,
289 Uint32 destination,
290 Uint32 blocking)
291 : AsyncReply(async_messages::ASYNC_OP_RESULT,
292 key, routing, 0,
293 operation, result_code, destination,
294 blocking)
295 {
296
297 }
298
299
300
301 AsyncLegacyOperationStart::AsyncLegacyOperationStart(Uint32 routing,
302 AsyncOpNode *operation,
303 mday 1.1 Uint32 destination,
|
304 mday 1.5 Message *action,
305 Uint32 action_destination)
|
306 mday 1.1 : AsyncRequest(async_messages::ASYNC_LEGACY_OP_START,
307 Message::getNextKey(), routing, 0,
308 operation, destination, CIMOM_Q_ID, false),
|
309 mday 1.5 act(action) , legacy_destination(action_destination)
|
310 mday 1.1 {
|
311 mday 1.5
|
312 mday 1.1 }
313
314
315 AsyncLegacyOperationResult::AsyncLegacyOperationResult(Uint32 key,
316 Uint32 routing,
317 AsyncOpNode *operation,
318 Message *result)
319 : AsyncReply(async_messages::ASYNC_LEGACY_OP_RESULT,
320 key, routing, 0, operation,
321 0, CIMOM_Q_ID, false),
322 res(result)
323 {
|
324 mday 1.5
|
325 mday 1.1 }
326
327
328
329 FindServiceQueue::FindServiceQueue(Uint32 routing,
330 AsyncOpNode *operation,
331 Uint32 response,
332 Boolean blocking,
333 String service_name,
334 Uint32 service_capabilities,
335 Uint32 service_mask)
336 : AsyncRequest(async_messages::FIND_SERVICE_Q,
337 Message::getNextKey(),
338 routing, 0, operation,
339 CIMOM_Q_ID,
340 response,
341 blocking),
342 name(service_name),
343 capabilities(service_capabilities),
344 mask(service_mask)
345 {
346 mday 1.1
347 }
348
349
350
351 FindServiceQueueResult::FindServiceQueueResult(Uint32 key,
352 Uint32 routing,
353 AsyncOpNode *operation,
354 Uint32 result_code,
355 Uint32 destination,
356 Boolean blocking,
357 Array<Uint32> queue_ids)
358 : AsyncReply(async_messages::FIND_SERVICE_Q_RESULT,
359 key, routing, 0, operation,
360 result_code, destination, blocking),
361 qids(queue_ids)
362 {
363
364 }
365
366 EnumerateService::EnumerateService(Uint32 routing,
367 mday 1.1 AsyncOpNode *operation,
368 Uint32 response,
369 Boolean blocking,
370 Uint32 queue_id)
371 : AsyncRequest(async_messages::ENUMERATE_SERVICE,
372 Message::getNextKey(),
373 routing, 0,
374 operation,
375 CIMOM_Q_ID,
376 response,
377 blocking),
378 qid(queue_id)
379 {
380
381 }
382
383 EnumerateServiceResponse::EnumerateServiceResponse(Uint32 key,
384 Uint32 routing,
385 AsyncOpNode *operation,
386 Uint32 result_code,
387 Uint32 response,
388 mday 1.1 Boolean blocking,
389 String service_name,
390 Uint32 service_capabilities,
391 Uint32 service_mask,
392 Uint32 service_qid)
393 : AsyncReply(async_messages::ENUMERATE_SERVICE_RESULT,
394 key,
395 routing, 0,
396 operation,
397 result_code,
398 response,
399 blocking),
400 name(service_name),
401 capabilities(service_capabilities),
402 mask(service_mask),
403 qid(service_qid)
404 {
405
406 }
407
408
409 mday 1.1 PEGASUS_NAMESPACE_END
|