Modify flora license version.
[platform/core/messaging/msg-service.git] / utils / MsgUtilFunction.cpp
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *    http://floralicense.org/license/
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "MsgDebug.h"
18 #include "MsgUtilFunction.h"
19
20  /*==================================================================================================
21                                      FUNCTION IMPLEMENTATION
22 ==================================================================================================*/
23
24 // Encoders
25 int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest)
26 {
27         int dataSize = 0;
28
29         dataSize = sizeof(MSG_COUNT_INFO_S);
30
31         *ppDest = (char*)new char[dataSize];
32
33         void* p = (void*)*ppDest;
34
35         memcpy(p, pCountInfo, dataSize);
36
37         return dataSize;
38 }
39
40
41 int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest)
42 {
43         int count = 0, dataSize = 0;
44
45         count = pRecipientList->recipientCnt;
46         dataSize = sizeof(int) + (sizeof(MSG_ADDRESS_INFO_S)*count);
47
48         *ppDest = (char*)new char[dataSize];
49
50         void* p = (void*)*ppDest;
51
52         memcpy(p, &count, sizeof(int));
53         p = (void*)((char*)p + sizeof(int));
54
55         for (int i = 0; i < count; i++)
56         {
57                 memcpy(p, &(pRecipientList->recipientAddr[i]), sizeof(MSG_ADDRESS_INFO_S));
58                 p = (void*)((char*)p + sizeof(MSG_ADDRESS_INFO_S));
59         }
60
61         return dataSize;
62 }
63
64
65 int MsgEncodeCountByMsgType(int MsgCount, char **ppDest)
66 {
67         int dataSize = 0;
68
69         dataSize = sizeof(int);
70
71         *ppDest = (char*)new char[dataSize];
72
73         void* p = (void*)*ppDest;
74
75         memcpy(p, &MsgCount, dataSize);
76
77         return dataSize;
78 }
79
80
81 int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest)
82 {
83         int dataSize = 0;
84
85         dataSize = (sizeof(msg_message_id_t));
86
87         *ppDest = (char*)new char[dataSize];
88
89         void* p = (void*)*ppDest;
90
91         memcpy(p, pMsgId, dataSize);
92
93         return dataSize;
94 }
95
96
97 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest)
98 {
99         int dataSize = 0;
100
101         dataSize = sizeof(MSG_MESSAGE_INFO_S);
102
103         *ppDest = (char*)new char[dataSize];
104
105         void* p = (void*)*ppDest;
106
107         memcpy(p, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
108
109         p = (void*)((char*)p + sizeof(MSG_MESSAGE_INFO_S));
110
111         return dataSize;
112 }
113
114
115 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest)
116 {
117         int dataSize = 0;
118
119         dataSize = (sizeof(MSG_MESSAGE_INFO_S) + sizeof(MSG_SENDINGOPT_INFO_S));
120
121         *ppDest = (char*)new char[dataSize];
122
123         void* p = (void*)*ppDest;
124
125         memcpy(p, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
126
127         p = (void*)((char*)p + sizeof(MSG_MESSAGE_INFO_S));
128
129         memcpy(p, pSendOptInfo, sizeof(MSG_SENDINGOPT_INFO_S));
130
131         return dataSize;
132 }
133
134 int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest)
135 {
136         int count = 0, dataSize = 0;
137
138         count = pFolderList->nCount;
139         dataSize = sizeof(int) + (sizeof(MSG_FOLDER_INFO_S)*count);
140
141         *ppDest = (char*)new char[dataSize];
142
143         void* p = (void*)*ppDest;
144
145         memcpy(p, &count, sizeof(int));
146         p = (void*)((char*)p + sizeof(int));
147
148         msg_struct_s *folder_info = NULL;
149
150         for (int i = 0; i < count; i++)
151         {
152                 folder_info = (msg_struct_s *)pFolderList->msg_struct_info[i];
153                 memcpy(p, folder_info->data, sizeof(MSG_FOLDER_INFO_S));
154                 p = (void*)((char*)p + sizeof(MSG_FOLDER_INFO_S));
155         }
156
157         return dataSize;
158 }
159
160 int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest)
161 {
162         int count = 0, dataSize = 0;
163
164         count = pFilterList->nCount;
165         dataSize = sizeof(int) + (sizeof(MSG_FILTER_S)*count);
166
167         *ppDest = (char*)new char[dataSize];
168
169         void* p = (void*)*ppDest;
170
171         memcpy(p, &count, sizeof(int));
172         p = (void*)((char*)p + sizeof(int));
173
174         msg_struct_s *filter_info = NULL;
175
176         for (int i = 0; i < count; i++)
177         {
178                 filter_info = (msg_struct_s *)pFilterList->msg_struct_info[i];
179                 memcpy(p, filter_info->data, sizeof(MSG_FILTER_S));
180                 p = (void*)((char*)p + sizeof(MSG_FILTER_S));
181         }
182
183         return dataSize;
184 }
185
186
187 int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest)
188 {
189         int dataSize = 0;
190
191         dataSize = (sizeof(bool));
192
193         *ppDest = (char*)new char[dataSize];
194
195         void* p = (void*)*ppDest;
196
197         memcpy(p, pSetFlag, dataSize);
198
199         return dataSize;
200 }
201
202
203 int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest)
204 {
205         int dataSize = 0;
206
207         dataSize = (sizeof(MSG_MESSAGE_TYPE_S));
208
209         *ppDest = (char*)new char[dataSize];
210
211         void* p = (void*)*ppDest;
212
213         memcpy(p, pMsgType, dataSize);
214
215         return dataSize;
216 }
217
218
219 int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest)
220 {
221         int count = 0, dataSize = 0;
222
223         count = pThreadViewList->nCount;
224
225         dataSize = sizeof(int) + (sizeof(MSG_THREAD_VIEW_S)*count);
226
227         *ppDest = (char*)new char[dataSize];
228
229         void* p = (void*)*ppDest;
230
231         memcpy(p, &count, sizeof(int));
232         p = (void*)((char*)p + sizeof(int));
233
234         msg_struct_s *thread_info = NULL;
235
236         for (int i = 0; i < count; i++)
237         {
238                 thread_info = (msg_struct_s *)pThreadViewList->msg_struct_info[i];
239                 memcpy(p, thread_info->data, sizeof(MSG_THREAD_VIEW_S));
240                 p = (void*)((char*)p + sizeof(MSG_THREAD_VIEW_S));
241         }
242
243         return dataSize;
244 }
245
246
247 int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest)
248 {
249         int count = 0, dataSize = 0;
250
251         count = pConvViewList->nCount;
252
253         dataSize = sizeof(int) + (sizeof(msg_struct_list_s)*count);
254
255         *ppDest = (char*)new char[dataSize];
256
257         void* p = (void*)*ppDest;
258
259         memcpy(p, &count, sizeof(int));
260         p = (void*)((char*)p + sizeof(int));
261
262         for (int i = 0; i < count; i++)
263         {
264                 memcpy(p, &(pConvViewList->msg_struct_info[i]), sizeof(msg_struct_list_s));
265                 p = (void*)((char*)p + sizeof(msg_struct_list_s));
266         }
267
268         return dataSize;
269 }
270
271
272 int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest)
273 {
274         int dataSize = sizeof(int) + sizeof(int) + sizeof(int) + sizeof(int);
275
276         MSG_DEBUG("datasize = [%d] \n", dataSize);
277
278         *ppDest = (char*)new char[dataSize];
279
280         void* p = (void*)*ppDest;
281
282         memcpy(p, &(threadCountInfo->totalCount), sizeof(int));
283         p = (void*)((char*)p + sizeof(int));
284
285         memcpy(p, &(threadCountInfo->unReadCount), sizeof(int));
286         p = (void*)((char*)p + sizeof(int));
287
288         memcpy(p, &(threadCountInfo->mmsMsgCount), sizeof(int));
289         p = (void*)((char*)p + sizeof(int));
290
291         memcpy(p, &(threadCountInfo->smsMsgCount), sizeof(int));
292         p = (void*)((char*)p + sizeof(int));
293
294         return dataSize;
295 }
296
297 int MsgEncodeMemSize(unsigned int *memsize, char **ppDest)
298 {
299         int dataSize = 0;
300
301         dataSize = sizeof(unsigned int);
302
303         *ppDest = (char*)new char[dataSize];
304
305         void* p = (void*)*ppDest;
306
307         memcpy(p, memsize, dataSize);
308
309         return dataSize;
310 }
311
312
313 int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest)
314 {
315         int dataSize = 0;
316
317         dataSize = sizeof(int) + sizeof(int);
318
319         *ppDest = (char*)new char[dataSize];
320
321         void* p = (void*)*ppDest;
322
323         memcpy(p, &msgId, sizeof(int));
324         p = (void*)((char*)p + sizeof(int));
325
326         memcpy(p, &extId, sizeof(int));
327
328         return dataSize;
329 }
330
331
332 int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest)
333 {
334         int dataSize = 0;
335         int count = 0;
336
337         count = pMsgIdList->nCount;
338
339         dataSize = sizeof(msg_storage_change_type_t) + sizeof(int) + (sizeof(msg_message_id_t)*count);
340
341         *ppDest = (char*)new char[dataSize];
342
343         void* p = (void*)*ppDest;
344
345         memcpy(p, &storageChangeType, sizeof(msg_storage_change_type_t));
346         p = (void*)((char*)p + sizeof(msg_storage_change_type_t));
347
348         memcpy(p, &count, sizeof(int));
349         p = (void*)((char*)p + sizeof(int));
350
351         for (int i = 0; i < count; i++) {
352                 memcpy(p, &(pMsgIdList->msgIdList[i]), sizeof(msg_message_id_t));
353                 p = (void*)((char*)p + sizeof(msg_message_id_t));
354         }
355
356         return dataSize;
357 }
358
359
360 int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, int count, char **ppDest)
361 {
362         int dataSize = 0;
363
364         dataSize = (sizeof(MSG_REPORT_STATUS_INFO_S)*count + sizeof(int));
365
366         *ppDest = (char*)new char[dataSize];
367
368         void* p = (void*)*ppDest;
369
370         memcpy(p, &count, sizeof(int));
371
372         p = (void*)(p + sizeof(int));
373
374         memcpy(p, pReportStatus, sizeof(MSG_REPORT_STATUS_INFO_S)*count);
375
376         return dataSize;
377 }
378
379
380 int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest)
381 {
382         int dataSize = 0;
383
384         dataSize = (sizeof(msg_thread_id_t));
385
386         *ppDest = (char*)new char[dataSize];
387
388         void* p = (void*)*ppDest;
389
390         memcpy(p, pThreadId, dataSize);
391
392         return dataSize;
393 }
394
395
396 int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest)
397 {
398         int dataSize = 0;
399
400         dataSize = sizeof(MSG_THREAD_VIEW_S);
401
402         *ppDest = (char*)new char[dataSize];
403
404         void* p = (void*)*ppDest;
405
406         memcpy(p, pThreadInfo, sizeof(MSG_THREAD_VIEW_S));
407
408         p = (void*)((char*)p + sizeof(MSG_THREAD_VIEW_S));
409
410         return dataSize;
411 }
412
413
414
415 // Decoders
416 void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId)
417 {
418         memcpy(pMsgId, pSrc, sizeof(msg_message_id_t));
419 }
420
421
422 void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo)
423 {
424         memcpy(pCountInfo, pSrc, sizeof(MSG_COUNT_INFO_S));
425 }
426
427
428 void MsgDecodeMemSize(char *pSrc, unsigned int *memsize)
429 {
430         memcpy(memsize, pSrc, sizeof(unsigned int));
431 }
432
433
434 void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo)
435 {
436         memcpy(pMsgInfo, pSrc, sizeof(MSG_MESSAGE_INFO_S));
437
438         pSrc = pSrc + sizeof(MSG_MESSAGE_INFO_S);
439
440         memcpy(pSendOptInfo, pSrc, sizeof(MSG_SENDINGOPT_INFO_S));
441 }
442
443 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList)
444 {
445         int count = 0;
446
447         memcpy(&count, pSrc, sizeof(int));
448         pSrc = pSrc + sizeof(int);
449
450         pRecipientList->recipientCnt= count;
451         pRecipientList->recipientAddr = (MSG_ADDRESS_INFO_S*)new char[sizeof(MSG_ADDRESS_INFO_S)*count];
452
453         MSG_ADDRESS_INFO_S* pInfoTmp = pRecipientList->recipientAddr;
454
455         for (int i = 0; i < count; i++)
456         {
457                 memcpy(pInfoTmp, pSrc, sizeof(MSG_ADDRESS_INFO_S));
458                 pSrc = pSrc + sizeof(MSG_ADDRESS_INFO_S);
459                 pInfoTmp++;
460         }
461 }
462
463
464 void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList)
465 {
466         int count = 0;
467
468         memcpy(&count, pSrc, sizeof(int));
469         pSrc = pSrc + sizeof(int);
470
471         if( count > 0 )
472         {
473                 pFolderList->nCount = count;
474                 pFolderList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FOLDER_INFO_S *)*count];
475
476                 msg_struct_s *pInfoTmp = NULL;
477
478                 for (int i = 0; i < count; i++)
479                 {
480
481                         pFolderList->msg_struct_info[i] = (msg_struct_t )new char[sizeof(msg_struct_s)];
482                         pInfoTmp = (msg_struct_s *)pFolderList->msg_struct_info[i];
483                         pInfoTmp->type = MSG_STRUCT_FOLDER_INFO;
484                         pInfoTmp->data = new char[sizeof(MSG_FOLDER_INFO_S)];
485                         memcpy(pInfoTmp->data, pSrc, sizeof(MSG_FOLDER_INFO_S));
486                         pSrc = pSrc + sizeof(MSG_FOLDER_INFO_S);
487                 }
488         }
489         else if ( count == 0 )
490         {
491                 pFolderList->nCount = count;
492                 pFolderList->msg_struct_info = NULL;
493         }
494 }
495
496 void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList)
497 {
498         int count = 0;
499
500         memcpy(&count, pSrc, sizeof(int));
501         pSrc = pSrc + sizeof(int);
502
503         if( count > 0 )
504         {
505                 pFilterList->nCount = count;
506                 pFilterList->msg_struct_info = (msg_struct_t *)new char[sizeof(MSG_FILTER_S *)*count];
507
508                 msg_struct_s *pStructTmp = NULL;
509
510                 for (int i = 0; i < count; i++)
511                 {
512                         pFilterList->msg_struct_info[i] = (msg_struct_t )new char[sizeof(msg_struct_s)];
513                         pStructTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
514                         pStructTmp->type = MSG_STRUCT_FILTER;
515                         pStructTmp->data = new char[sizeof(MSG_FILTER_S)];
516                         memcpy(pStructTmp->data, pSrc, sizeof(MSG_FILTER_S));
517                         pSrc = pSrc + sizeof(MSG_FILTER_S);
518                 }
519         }
520         else if ( count == 0 )
521         {
522                 pFilterList->nCount = count;
523                 pFilterList->msg_struct_info = NULL;
524         }
525
526 }
527
528
529 void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag)
530 {
531         memcpy(pSetFlag, pSrc, sizeof(bool));
532 }
533
534
535 void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType)
536 {
537         memcpy(pMsgType, pSrc, sizeof(MSG_MESSAGE_TYPE_S));
538 }
539
540 void    MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList)
541 {
542         int count = 0;
543
544         if(pSrc == NULL)
545                 return;
546
547         memcpy(&count, pSrc, sizeof(int));
548         pSrc = pSrc + sizeof(int);
549         pMsgThreadCountList->totalCount = count;
550
551
552         memcpy(&count, pSrc, sizeof(int));
553         pSrc = pSrc + sizeof(int);
554         pMsgThreadCountList->unReadCount        = count;
555
556
557         memcpy(&count, pSrc, sizeof(int));
558         pSrc = pSrc + sizeof(int);
559         pMsgThreadCountList->mmsMsgCount        = count;
560
561
562         memcpy(&count, pSrc, sizeof(int));
563         pSrc = pSrc + sizeof(int);
564         pMsgThreadCountList->smsMsgCount        = count;
565
566
567         return;
568 }
569
570
571 void MsgDecodeReportStatus(char *pSrc,  msg_struct_list_s *report_list)
572 {
573         int count = 0;
574
575         if(pSrc == NULL)
576                 return;
577
578         memcpy(&count, pSrc, sizeof(int));
579         pSrc = pSrc + sizeof(int);
580
581         report_list->nCount = count;
582
583         msg_struct_t *report_status =  (msg_struct_t *)new char[sizeof(msg_struct_t)*count];
584         for (int i = 0; i < count; i++) {
585
586                 msg_struct_s *report_status_item = new msg_struct_s;
587                 report_status_item->type = MSG_STRUCT_REPORT_STATUS_INFO;
588                 report_status_item->data = new MSG_REPORT_STATUS_INFO_S;
589                 memset(report_status_item->data, 0x00, sizeof(MSG_REPORT_STATUS_INFO_S));
590
591                 MSG_REPORT_STATUS_INFO_S *report_status_info =  (MSG_REPORT_STATUS_INFO_S *)report_status_item->data;
592                 memcpy(report_status_info, pSrc, sizeof(MSG_REPORT_STATUS_INFO_S));
593
594                 pSrc = pSrc + sizeof(MSG_REPORT_STATUS_INFO_S);
595
596                 report_status[i] = (msg_struct_t)report_status_item;
597
598                 MSG_DEBUG("Report_type = %d, status addr = %s, status = %d, time = %d",
599                                 report_status_info->type, report_status_info->addressVal,
600                                 report_status_info->status, report_status_info->statusTime);
601         }
602
603         report_list->msg_struct_info = report_status;
604         return;
605 }
606
607 void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId)
608 {
609         memcpy(pThreadId, pSrc, sizeof(msg_thread_id_t));
610 }
611
612 void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo)
613 {
614         memcpy(pThreadInfo, pSrc, sizeof(MSG_THREAD_VIEW_S));
615 }
616
617 // Event Encoder
618 int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent)
619 {
620         MSG_EVENT_S* pMsgEvent = NULL;
621
622         *ppEvent = (MSG_EVENT_S*)new char[sizeof(MSG_EVENT_S) + DataSize];
623
624         pMsgEvent = (MSG_EVENT_S*)*ppEvent;
625
626         pMsgEvent->eventType = MsgEvent;
627         pMsgEvent->result = MsgError;
628
629         MSG_DEBUG("eventType [%d : %s]", pMsgEvent->eventType, MsgDbgEvtStr(pMsgEvent->eventType));
630         MSG_DEBUG("result [%d]", pMsgEvent->result);
631
632         if (DataSize > 0)
633                 memcpy((void*)pMsgEvent->data, pData, DataSize);
634
635         return (sizeof(MSG_EVENT_S) + DataSize);
636 }
637
638 int msg_verify_number(const char *raw, char *trimmed)
639 {
640         if (!(raw && trimmed)) {
641                 MSG_DEBUG("Phone Number is NULL");
642                 return MSG_ERR_NULL_POINTER;
643         }
644
645         for (int i=0, j=0 ; raw[i] ; i++) {
646                 if ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == '+' || raw[i] == ',' || raw[i] == ' ' \
647                                 || raw[i] == '*' ||  raw[i] == '#') {
648                         trimmed[j++] = raw[i];
649                 } else if (raw[i] == '-') {
650                         continue;
651                 } else {
652                         MSG_DEBUG("Unacceptable character in telephone number: [%c]", raw[i]);
653                         return MSG_ERR_INVALID_PARAMETER;
654                 }
655         }
656
657         MSG_DEBUG("Trimming [%s]->[%s]", raw, trimmed);
658         return MSG_SUCCESS;
659 }
660
661 int msg_verify_email(const char *raw)
662 {
663         bool onlyNum = true;
664         bool atExist = false;
665
666         if (!raw) {
667                 MSG_DEBUG("Email is NULL");
668                 return MSG_ERR_NULL_POINTER;
669         }
670
671         for (int i = 0; raw[i]; i++) {
672
673                 if (raw[i] == '@') {
674                         onlyNum = false;
675
676                         if (atExist == false) {
677                                 atExist = true;
678                                 continue;
679                         } else {
680                                 MSG_DEBUG("Character [@] is included more than twice in email address.");
681                                 return MSG_ERR_INVALID_PARAMETER;
682                         }
683                 }
684
685                 if ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == '+' || raw[i] == '*' ||  raw[i] == '#') {
686                         continue;
687                 } else if ((raw[i] >= 'a' && raw[i] <= 'z') ||(raw[i] >= 'A' && raw[i] <= 'Z') ||(raw[i] == '.') || raw[i] == '_' || raw[i] == '-') {
688                         onlyNum = false;
689                         continue;
690                 } else if (raw[i] == ',') {
691                         if (onlyNum == false && atExist == false) {
692                                 MSG_DEBUG("Unacceptable type in address.");
693                                 return MSG_ERR_INVALID_PARAMETER;
694                         }
695                         atExist = false;
696                         onlyNum = true;
697                         continue;
698                 } else {
699                         MSG_DEBUG("Unacceptable character in address : [%c]", raw[i]);
700                         return MSG_ERR_INVALID_PARAMETER;
701                 }
702         }
703
704         return MSG_SUCCESS;
705 }