0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* System Includes
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#include <assert.h>
|
|
23 |
|
|
24 |
|
|
25 |
/*******************************************************************************
|
|
26 |
*
|
|
27 |
* Local Includes
|
|
28 |
*
|
|
29 |
******************************************************************************/
|
|
30 |
#include "strncpynt.h"
|
|
31 |
#include "CUuinterfaceStub.h"
|
|
32 |
#include "CCUuinterface.h"
|
|
33 |
#include "../../Core/UCCS_ServiceValues.h"
|
|
34 |
#include "../../Core/UCCS_ErrorCodes.h"
|
|
35 |
|
|
36 |
|
|
37 |
/*******************************************************************************
|
|
38 |
*
|
|
39 |
* Definitions
|
|
40 |
*
|
|
41 |
******************************************************************************/
|
|
42 |
|
|
43 |
/*******************************************************************************
|
|
44 |
*
|
|
45 |
* Macro Functions
|
|
46 |
*
|
|
47 |
******************************************************************************/
|
|
48 |
|
|
49 |
/*******************************************************************************
|
|
50 |
*
|
|
51 |
* Constructor / Destructor
|
|
52 |
*
|
|
53 |
******************************************************************************/
|
|
54 |
CUuinterfaceStub::CUuinterfaceStub()
|
|
55 |
{
|
|
56 |
iUuClient = new CCUuinterface();
|
|
57 |
assert( iUuClient != NULL );
|
|
58 |
}
|
|
59 |
|
|
60 |
|
|
61 |
CUuinterfaceStub::~CUuinterfaceStub()
|
|
62 |
{
|
|
63 |
delete iUuClient;
|
|
64 |
}
|
|
65 |
|
|
66 |
|
|
67 |
/*******************************************************************************
|
|
68 |
*
|
|
69 |
* Startup / Shutdown
|
|
70 |
*
|
|
71 |
******************************************************************************/
|
|
72 |
int CUuinterfaceStub::StartUccsService( char *aHostName, int *aErrorCode, int *aUnused )
|
|
73 |
{
|
|
74 |
int client_stub_error;
|
|
75 |
|
|
76 |
// check params
|
|
77 |
assert( aHostName != NULL );
|
|
78 |
assert( aErrorCode != NULL );
|
|
79 |
*aErrorCode = 0;
|
|
80 |
|
|
81 |
// connect to the remote service
|
|
82 |
client_stub_error = iUuClient->Connect( aHostName );
|
|
83 |
|
|
84 |
// return the result
|
|
85 |
return client_stub_error;
|
|
86 |
}
|
|
87 |
|
|
88 |
|
|
89 |
int CUuinterfaceStub::StopUccsService( int *aErrorCode, int *aUnused )
|
|
90 |
{
|
|
91 |
int client_stub_error;
|
|
92 |
|
|
93 |
// check params
|
|
94 |
assert( aErrorCode != NULL );
|
|
95 |
*aErrorCode = 0;
|
|
96 |
|
|
97 |
// shutdown the stub -- force it to close
|
|
98 |
client_stub_error = iUuClient->Disconnect();
|
|
99 |
|
|
100 |
// done
|
|
101 |
return client_stub_error;
|
|
102 |
}
|
|
103 |
|
|
104 |
|
|
105 |
/*******************************************************************************
|
|
106 |
*
|
|
107 |
* IssueCommand
|
|
108 |
*
|
|
109 |
******************************************************************************/
|
|
110 |
CDataRecord* CUuinterfaceStub::IssueCommand( CDataRecord* aRequest )
|
|
111 |
{
|
|
112 |
int call_result, err, client_stub_error, method_id = -1;
|
|
113 |
|
|
114 |
int value_int, value_frac, sigma_int, sigma_frac, cor_int, cor_frac;
|
|
115 |
int max_value_int, max_value_frac;
|
|
116 |
int source_port, destination_port;
|
|
117 |
char *source_address, *destination_address;
|
|
118 |
char *protocol;
|
|
119 |
|
|
120 |
CDataRecord *request_reply;
|
|
121 |
|
|
122 |
TStartupInfo sarg_startup_info;
|
|
123 |
int rv_integer, sarg_integer;
|
|
124 |
|
|
125 |
TResult rv;
|
|
126 |
TComponentList rv_component_list;
|
|
127 |
|
|
128 |
struct TConfigValue val;
|
|
129 |
|
|
130 |
// check params
|
|
131 |
assert( aRequest != NULL );
|
|
132 |
|
|
133 |
// create a standard reply
|
|
134 |
request_reply = CreateBaseReply( aRequest );
|
|
135 |
assert( request_reply != NULL );
|
|
136 |
|
|
137 |
// get and check the method_id
|
|
138 |
err = request_reply->GetFieldAsInt( "METHODID", &method_id );
|
|
139 |
if( method_id == -1 ) {
|
|
140 |
UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
|
|
141 |
return request_reply;
|
|
142 |
}
|
|
143 |
|
|
144 |
// now dispatch and call the appropriate method
|
|
145 |
switch( method_id ) {
|
|
146 |
|
|
147 |
// ss_startuprpcservice
|
|
148 |
case 1:
|
|
149 |
|
|
150 |
// extract the parameters
|
|
151 |
sarg_startup_info.iEmpty = 0;
|
|
152 |
|
|
153 |
// make the call and update the return value
|
|
154 |
client_stub_error = iUuClient->ss_startuprpcservice( sarg_startup_info, &rv_integer );
|
|
155 |
UpdateCompletionCode( request_reply, client_stub_error );
|
|
156 |
if( client_stub_error != ERR_NONE ) {
|
|
157 |
break;
|
|
158 |
}
|
|
159 |
|
|
160 |
// set any return information
|
|
161 |
request_reply->NewField( "RESULT", rv_integer );
|
|
162 |
break;
|
|
163 |
|
|
164 |
// sc_shutdownrpcservice
|
|
165 |
case 2:
|
|
166 |
|
|
167 |
// extract the parameters
|
|
168 |
GETINTEGERARGUMENT( "FORCE", &sarg_integer, 1, 1, aRequest, request_reply );
|
|
169 |
|
|
170 |
// make the call and update the return value
|
|
171 |
client_stub_error = iUuClient->sc_shutdownrpcservice( sarg_integer, &rv_integer );
|
|
172 |
UpdateCompletionCode( request_reply, client_stub_error );
|
|
173 |
if( client_stub_error != ERR_NONE ) {
|
|
174 |
break;
|
|
175 |
}
|
|
176 |
|
|
177 |
// set the return values
|
|
178 |
request_reply->NewField( "RESULT", rv_integer );
|
|
179 |
break;
|
|
180 |
|
|
181 |
// list_devices
|
|
182 |
case 30:
|
|
183 |
|
|
184 |
// make the call and update the return value
|
|
185 |
client_stub_error = iUuClient->list_devices( &rv_component_list );
|
|
186 |
UpdateCompletionCode( request_reply, client_stub_error );
|
|
187 |
if( client_stub_error != ERR_NONE ) {
|
|
188 |
break;
|
|
189 |
}
|
|
190 |
|
|
191 |
// set the return values
|
|
192 |
request_reply->NewField( "COUNT", rv_component_list.TComponentList_len );
|
|
193 |
assert ( rv_component_list.TComponentList_len== 0 );
|
|
194 |
break;
|
|
195 |
|
|
196 |
// st_setdelay
|
|
197 |
case 3:
|
|
198 |
// Extract the parameters
|
|
199 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
200 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
201 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
202 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
203 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
204 |
GETINTEGERARGUMENT( "DELAYI", &value_int, 6, 0, aRequest, request_reply );
|
|
205 |
GETINTEGERARGUMENT( "DELAYF", &value_frac, 7, 1, aRequest, request_reply );
|
|
206 |
GETINTEGERARGUMENT( "SIGMAI", &sigma_int, 8, 1, aRequest, request_reply );
|
|
207 |
GETINTEGERARGUMENT( "SIGMAF", &sigma_frac, 9, 1, aRequest, request_reply );
|
|
208 |
GETINTEGERARGUMENT( "CORRI", &cor_int, 7, 10, aRequest, request_reply );
|
|
209 |
GETINTEGERARGUMENT( "CORRF", &cor_frac, 11, 1, aRequest, request_reply );
|
|
210 |
|
|
211 |
// Create the config values stub
|
|
212 |
//setPortValues ( &source_port, &destination_port );
|
|
213 |
CreateConfigValue( &val,
|
|
214 |
source_address, destination_address,
|
|
215 |
protocol,
|
|
216 |
source_port, destination_port,
|
|
217 |
value_int, value_frac,
|
|
218 |
sigma_int, sigma_frac,
|
|
219 |
cor_int, cor_frac,
|
|
220 |
0,0,0,0 );
|
|
221 |
|
|
222 |
// Make the call and update the return values
|
|
223 |
call_result = iUuClient->st_setdelay( val, &rv );
|
|
224 |
UpdateCompletionCode( request_reply, call_result );
|
|
225 |
if( call_result != ERR_NONE ) {
|
|
226 |
break;
|
|
227 |
}
|
|
228 |
|
|
229 |
// Set the return values
|
|
230 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
231 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
232 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
233 |
|
|
234 |
break;
|
|
235 |
|
|
236 |
// st_setdroppercentage
|
|
237 |
case 4:
|
|
238 |
//Extract the parameters
|
|
239 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
240 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
241 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
242 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
243 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
244 |
GETINTEGERARGUMENT( "DROPI", &value_int, 6, 0, aRequest, request_reply );
|
|
245 |
GETINTEGERARGUMENT( "DROPF", &value_frac, 7, 1, aRequest, request_reply );
|
|
246 |
GETINTEGERARGUMENT( "CORRI", &cor_int, 8, 1, aRequest, request_reply );
|
|
247 |
GETINTEGERARGUMENT( "CORRF", &cor_frac, 9, 1, aRequest, request_reply );
|
|
248 |
|
|
249 |
// Create the config values stub
|
|
250 |
//setPortValues ( &source_port, &destination_port );
|
|
251 |
CreateConfigValue( &val,
|
|
252 |
source_address, destination_address,
|
|
253 |
protocol,
|
|
254 |
source_port, destination_port,
|
|
255 |
value_int, value_frac,
|
|
256 |
0,0,
|
|
257 |
cor_int, cor_frac,
|
|
258 |
0,0,0,0 );
|
|
259 |
|
|
260 |
// Make the call and update the return values
|
|
261 |
call_result = iUuClient->st_setdroppercentage( val, &rv );
|
|
262 |
UpdateCompletionCode( request_reply, call_result );
|
|
263 |
if( call_result != ERR_NONE ) {
|
|
264 |
break;
|
|
265 |
}
|
|
266 |
|
|
267 |
// Set the return values
|
|
268 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
269 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
270 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
271 |
|
|
272 |
break;
|
|
273 |
|
|
274 |
//st_setduplicatepercentage
|
|
275 |
case 5:
|
|
276 |
//Extract the parameters
|
|
277 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
278 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
279 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
280 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
281 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
282 |
GETINTEGERARGUMENT( "DUPI", &value_int, 6, 0, aRequest, request_reply );
|
|
283 |
GETINTEGERARGUMENT( "DUPF", &value_frac, 7, 1, aRequest, request_reply );
|
|
284 |
GETINTEGERARGUMENT( "CORRI", &cor_int, 8, 1, aRequest, request_reply );
|
|
285 |
GETINTEGERARGUMENT( "CORRF", &cor_frac, 9, 1, aRequest, request_reply );
|
|
286 |
|
|
287 |
// Create the config values stub
|
|
288 |
//setPortValues ( &source_port, &destination_port );
|
|
289 |
CreateConfigValue( &val,
|
|
290 |
source_address, destination_address,
|
|
291 |
protocol,
|
|
292 |
source_port, destination_port,
|
|
293 |
value_int, value_frac,
|
|
294 |
0,0,
|
|
295 |
cor_int, cor_frac,
|
|
296 |
0,0,0,0 );
|
|
297 |
|
|
298 |
// Make the call and update the return values
|
|
299 |
call_result = iUuClient->st_setduplicatepercentage( val, &rv );
|
|
300 |
UpdateCompletionCode( request_reply, call_result );
|
|
301 |
if( call_result != ERR_NONE ) {
|
|
302 |
break;
|
|
303 |
}
|
|
304 |
|
|
305 |
// Set the return values
|
|
306 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
307 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
308 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
309 |
|
|
310 |
break;
|
|
311 |
|
|
312 |
// st_setbandwidth
|
|
313 |
case 6:
|
|
314 |
//Extract the parameters
|
|
315 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
316 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
317 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
318 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
319 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
320 |
GETINTEGERARGUMENT( "BWI", &value_int, 6, 0, aRequest, request_reply );
|
|
321 |
GETINTEGERARGUMENT( "BWF", &value_frac, 7, 1, aRequest, request_reply );
|
|
322 |
|
|
323 |
// Create the config values stub
|
|
324 |
//setPortValues ( &source_port, &destination_port );
|
|
325 |
CreateConfigValue( &val,
|
|
326 |
source_address, destination_address,
|
|
327 |
protocol,
|
|
328 |
source_port, destination_port,
|
|
329 |
value_int, value_frac,
|
|
330 |
0,0,0,0,0,0,0,0 );
|
|
331 |
|
|
332 |
// Make the call and update the return values
|
|
333 |
call_result = iUuClient->st_setbandwidth( val, &rv );
|
|
334 |
UpdateCompletionCode( request_reply, call_result );
|
|
335 |
if( call_result != ERR_NONE ) {
|
|
336 |
break;
|
|
337 |
}
|
|
338 |
|
|
339 |
// Set the return values
|
|
340 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
341 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
342 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
343 |
|
|
344 |
break;
|
|
345 |
|
|
346 |
// st_setdrd
|
|
347 |
case 7:
|
|
348 |
//Extract the parameters
|
|
349 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
350 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
351 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
352 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
353 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
354 |
GETINTEGERARGUMENT( "MINI", &value_int, 6, 0, aRequest, request_reply );
|
|
355 |
GETINTEGERARGUMENT( "MINF", &value_frac, 7, 1, aRequest, request_reply );
|
|
356 |
GETINTEGERARGUMENT( "MAXI", &max_value_int, 8, 0, aRequest, request_reply );
|
|
357 |
GETINTEGERARGUMENT( "MAXF", &max_value_frac, 9, 1, aRequest, request_reply );
|
|
358 |
GETINTEGERARGUMENT( "CONGI", &cor_int, 10, 1, aRequest, request_reply );
|
|
359 |
GETINTEGERARGUMENT( "CONGF", &cor_frac, 11, 1, aRequest, request_reply );
|
|
360 |
|
|
361 |
// Create the config values stub
|
|
362 |
//setPortValues ( &source_port, &destination_port );
|
|
363 |
CreateConfigValue( &val,
|
|
364 |
source_address, destination_address,
|
|
365 |
protocol,
|
|
366 |
source_port, destination_port,
|
|
367 |
value_int, value_frac,
|
|
368 |
0,0,0,0,
|
|
369 |
max_value_int, max_value_frac,
|
|
370 |
cor_int, cor_frac );
|
|
371 |
|
|
372 |
// Make the call and update the return values
|
|
373 |
call_result = iUuClient->st_setdrd( val, &rv );
|
|
374 |
UpdateCompletionCode( request_reply, call_result );
|
|
375 |
if( call_result != ERR_NONE ) {
|
|
376 |
break;
|
|
377 |
}
|
|
378 |
|
|
379 |
// Set the return values
|
|
380 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
381 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
382 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
383 |
|
|
384 |
break;
|
|
385 |
|
|
386 |
// st_clearsettings
|
|
387 |
case 8:
|
|
388 |
//Extract the parameters
|
|
389 |
GETSTRINGARGUMENT( "SRC", &source_address, 1, 0, aRequest, request_reply );
|
|
390 |
GETSTRINGARGUMENT( "DST", &destination_address, 2, 0, aRequest, request_reply );
|
|
391 |
GETINTEGERARGUMENT( "SRCPORT", &source_port, 3, 1, aRequest, request_reply );
|
|
392 |
GETINTEGERARGUMENT( "DSTPORT", &destination_port, 4, 1, aRequest, request_reply );
|
|
393 |
GETSTRINGARGUMENT( "PROTOCOL", &protocol, 5, 1, aRequest, request_reply );
|
|
394 |
|
|
395 |
// Create the config values stub
|
|
396 |
//setPortValues ( &source_port, &destination_port );
|
|
397 |
CreateConfigValue( &val,
|
|
398 |
source_address, destination_address,
|
|
399 |
protocol,
|
|
400 |
source_port, destination_port,
|
|
401 |
0,0,0,0,0,0,0,0,0,0 );
|
|
402 |
|
|
403 |
// Make the call and update the return values
|
|
404 |
call_result = iUuClient->st_clearsettings( val, &rv );
|
|
405 |
UpdateCompletionCode( request_reply, call_result );
|
|
406 |
if( call_result != ERR_NONE ) {
|
|
407 |
break;
|
|
408 |
}
|
|
409 |
|
|
410 |
// Set the return values
|
|
411 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
412 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
413 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
414 |
|
|
415 |
break;
|
|
416 |
|
|
417 |
// st_stopservice
|
|
418 |
case 9:
|
|
419 |
// Make the call and update the return values
|
|
420 |
call_result = iUuClient->st_stopservice( &rv );
|
|
421 |
UpdateCompletionCode( request_reply, call_result );
|
|
422 |
if( call_result != ERR_NONE ) {
|
|
423 |
break;
|
|
424 |
}
|
|
425 |
|
|
426 |
// Set the return values
|
|
427 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
428 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
429 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
430 |
|
|
431 |
break;
|
|
432 |
|
|
433 |
// st_reset
|
|
434 |
case 10:
|
|
435 |
// Make the call and update the return values
|
|
436 |
call_result = iUuClient->st_reset( &rv );
|
|
437 |
UpdateCompletionCode( request_reply, call_result );
|
|
438 |
if( call_result != ERR_NONE ) {
|
|
439 |
break;
|
|
440 |
}
|
|
441 |
|
|
442 |
// Set the return values
|
|
443 |
request_reply->NewField( "RESULT", rv.iStandardResult );
|
|
444 |
request_reply->NewField( "RESULT_DETAIL", rv.iExtendedCode );
|
|
445 |
request_reply->NewField( "RESULT_SYSTEM_ERROR", rv.iSystemError );
|
|
446 |
|
|
447 |
break;
|
|
448 |
|
|
449 |
// Any other method id results in an invalid method id result
|
|
450 |
default:
|
|
451 |
UpdateCompletionCode( request_reply, ERR_INVALID_METHOD );
|
|
452 |
break;
|
|
453 |
}
|
|
454 |
|
|
455 |
// everything should be handled above
|
|
456 |
return request_reply;
|
|
457 |
}
|
|
458 |
|
|
459 |
|
|
460 |
/*******************************************************************************
|
|
461 |
*
|
|
462 |
* GetStatus()
|
|
463 |
*
|
|
464 |
******************************************************************************/
|
|
465 |
int CUuinterfaceStub::GetStatus()
|
|
466 |
{
|
|
467 |
assert( !"GetStatus() - is not implemented" );
|
|
468 |
return -1;
|
|
469 |
}
|
|
470 |
|
|
471 |
|
|
472 |
/*******************************************************************************
|
|
473 |
*
|
|
474 |
* GetLastRPCError()
|
|
475 |
*
|
|
476 |
******************************************************************************/
|
|
477 |
char *CUuinterfaceStub::GetLastRPCError( int *aIntError )
|
|
478 |
{
|
|
479 |
return iUuClient->GetLastRPCError( aIntError );
|
|
480 |
}
|
|
481 |
|
|
482 |
/*******************************************************************************
|
|
483 |
*
|
|
484 |
* CreateConfigValue()
|
|
485 |
*
|
|
486 |
******************************************************************************/
|
|
487 |
void CUuinterfaceStub::CreateConfigValue( TConfigValue* aConfigValue,
|
|
488 |
char* aSrc, char* aDst,
|
|
489 |
char* aProtocol,
|
|
490 |
int aSrcPort, int aDstPort,
|
|
491 |
int aValueIntegerPart, int aValueFractionPart,
|
|
492 |
int aSigmaIntegerPart, int aSigmaFractionPart,
|
|
493 |
int aCorrelationIntegerPart, int aCorrelationFractionPart,
|
|
494 |
int aMaximumValueIntegerPart, int aMaximumValueFractionPart,
|
|
495 |
int aCongestionIntegerPart, int aCongestionFractionPart )
|
|
496 |
{
|
|
497 |
int slen;
|
|
498 |
|
|
499 |
// check the params
|
|
500 |
assert( aSrc != NULL );
|
|
501 |
assert( aDst != NULL );
|
|
502 |
|
|
503 |
// copy the source address
|
|
504 |
STRNCPY_NULL_TERMINATE( aConfigValue->iSourceAddress, aSrc, X_MAX_ADDRESS_LENGTH);
|
|
505 |
|
|
506 |
// copy the destination address
|
|
507 |
STRNCPY_NULL_TERMINATE( aConfigValue->iDestinationAddress, aDst, X_MAX_ADDRESS_LENGTH);
|
|
508 |
|
|
509 |
// set the protocol
|
|
510 |
slen = strlen( aProtocol );
|
|
511 |
if( (aProtocol != NULL) && (strnicmp(aProtocol,UDP,slen) == 0) ) {
|
|
512 |
aConfigValue->iProtocol = X_UDP;
|
|
513 |
} else {
|
|
514 |
aConfigValue->iProtocol = X_TCP;
|
|
515 |
}
|
|
516 |
|
|
517 |
// set all the values
|
|
518 |
aConfigValue->iSrcPort = aSrcPort;
|
|
519 |
aConfigValue->iDstPort = aDstPort;
|
|
520 |
aConfigValue->iValueIntegerPart = aValueIntegerPart;
|
|
521 |
aConfigValue->iValueFractionPart = aValueFractionPart;
|
|
522 |
aConfigValue->iSigmaIntegerPart = aSigmaIntegerPart;
|
|
523 |
aConfigValue->iSigmaFractionPart = aSigmaFractionPart;
|
|
524 |
aConfigValue->iCorrelationIntegerPart = aCorrelationIntegerPart;
|
|
525 |
aConfigValue->iCorrelationFractionPart = aCorrelationFractionPart;
|
|
526 |
aConfigValue->iMaximumValueIntegerPart = aMaximumValueIntegerPart;
|
|
527 |
aConfigValue->iMaximumValueFractionPart = aMaximumValueFractionPart;
|
|
528 |
aConfigValue->iCongestionIntegerPart = aCongestionIntegerPart;
|
|
529 |
aConfigValue->iCongestionFractionPart = aCongestionFractionPart;
|
|
530 |
|
|
531 |
// done
|
|
532 |
|
|
533 |
}
|