blob: dcd26c46e035b11a6dc4f6664cff1740bb49e205 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/************************************************************************
2* °æÈ¨ËùÓÐ (C)2012, ÉîÛÚÊÐÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3*
4* ÎļþÃû³Æ£º zte_web_mc.c
5* Îļþ±êʶ£º
6* ÄÚÈÝÕªÒª£º
7* ÆäËü˵Ã÷£º
8* µ±Ç°°æ±¾£º V0.1
9* ×÷ Õߣº liuyingnan
10* Íê³ÉÈÕÆÚ£º 2012-10-25
11*
12* Ð޸ļǼ1£º
13* ÐÞ¸ÄÄÚÈÝ£º³õʼ°æ±¾
14************************************************************************/
15
16#include "zte_web_mc.h"
17#include "message.h"
18
19/******************************************************
20* Function: zte_mc_relay_sms_send_msg
21* Description: the fun to relay SMS send send msg to the mc process
22* Input:
23* Output:
24* Return:
25* Others:
26* Modify Date Version Author Modification
27* 20121025 V1.0 liuyingnan create
28*******************************************************/
29int zte_mc_relay_sms_send_msg(T_zUfiSms_SendReq *msg_ptr)
30{
31 int ret_code = 0;
32 T_zGoaheadMsgBuf send_msg;
33
34
35 memset(&send_msg, 0, sizeof(send_msg));
36
37 /*check the input param*/
38 if (msg_ptr == NULL) {
xf.libdd93d52023-05-12 07:10:14 -070039 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_sms_send_msg fun's input param is valid!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -070040 return -1;
41 }
42
43 /*set the value*/
44 send_msg.msg_hdr.type = ZTE_SMS_RELAY_TYPE;
45 send_msg.msg_hdr.id = ZTE_MC_SMS_SEND_MSG_CMD;
46 send_msg.msg_hdr.result = OK;
47#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
48 /*check the length before memcpy for safe*/
49 if (sizeof(T_zUfiSms_SendReq) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -070050 slog(MISC_PRINT, SLOG_ERR, "the size of sms_send_msg_ui_req_info_s_type is more than the msg buf , sizeof(sms_send_msg_ui_req_info_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -070051 , sizeof(T_zUfiSms_SendReq));/*lint !e26*/
52 return -1;
53 }
54#endif
55 memcpy(send_msg.msg_data, msg_ptr, sizeof(T_zUfiSms_SendReq));
56
xf.libdd93d52023-05-12 07:10:14 -070057 slog(MISC_PRINT, SLOG_NORMAL, "send_message sms send msg start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -070058
59 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL,MSG_CMD_SEND_SMS, sizeof(send_msg), (char*)&send_msg);
60 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_SEND_SMS, sizeof(send_msg), (char*)&send_msg, 0);
xf.libdd93d52023-05-12 07:10:14 -070061 slog(MISC_PRINT, SLOG_DEBUG, "send_message sms send msg end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -070062
63 if (ret_code != OK) {
64 slog(MISC_PRINT, SLOG_ERR, "mc lib relay sms send msg fail"); /*lint !e26*/
65 return -1;
66 }
67
68 return OK;
69}
70
71
72/******************************************************
73* Function: zte_mc_relay_sms_modify_tag
74* Description: the fun to relay SMS send modify tag msg to the mc process
75* Input:
76* Output:
77* Return:
78* Others:
79* Modify Date Version Author Modification
80* 20121025 V1.0 liuyingnan create
81*******************************************************/
82int zte_mc_relay_sms_modify_tag(T_zUfiSms_ModifyFlag *modify_info_tmp)
83{
84 int ret_code = 0;
85 T_zGoaheadMsgBuf send_msg;
86 //zte_wms_modify_tag_s_type modify_info_tmp;
87
88 memset(&send_msg, 0, sizeof(send_msg));
89 //memset(&modify_info_tmp, 0, sizeof(modify_info_tmp));
90
91 /*set the value*/
92 send_msg.msg_hdr.type = ZTE_SMS_RELAY_TYPE;
93 send_msg.msg_hdr.id = ZTE_MC_SMS_MODIFY_TAG_CMD;
94 send_msg.msg_hdr.result = OK;
95
96 //modify_info_tmp.sms_file = sms_file;
97 //modify_info_tmp.sms_id = msg_id;
98#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
99 /*check the length before memcpy for safe*/
100 if (sizeof(T_zUfiSms_ModifyFlag) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700101 slog(MISC_PRINT, SLOG_ERR, "the size of mc_relay_sms_modify_s_type is more than the msg buf , sizeof(mc_relay_sms_modify_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700102 , sizeof(T_zUfiSms_ModifyFlag));/*lint !e26*/
103 return -1;
104 }
105#endif
106 memcpy(send_msg.msg_data, modify_info_tmp, sizeof(T_zUfiSms_ModifyFlag));
107
xf.libdd93d52023-05-12 07:10:14 -0700108 slog(MISC_PRINT, SLOG_NORMAL, "send_message sms modify tag start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700109 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL,MSG_CMD_SMS_MODIFY_TAG, sizeof(send_msg), (char*)&send_msg);
110 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_SMS_MODIFY_TAG, sizeof(send_msg), (char*)&send_msg, 0);
xf.libdd93d52023-05-12 07:10:14 -0700111 slog(MISC_PRINT, SLOG_DEBUG, "send_message sms modify tag end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700112
113 if (ret_code != OK) {
114 slog(MISC_PRINT, SLOG_ERR, "mc lib relay sms send modify tag msg fail"); /*lint !e26*/
115 return -1;
116 }
117
118 return OK;
119}
120
121
122/******************************************************
123* Function: zte_mc_relay_sms_write_msg
124* Description: the fun to relay SMS send write msg to the mc process
125* Input:
126* Output:
127* Return:
128* Others:
129* Modify Date Version Author Modification
130* 20121025 V1.0 liuyingnan create
131*******************************************************/
132int zte_mc_relay_sms_write_msg(T_zUfiSms_SaveReq *msg_ptr)
133{
134 int ret_code = 0;
135 T_zGoaheadMsgBuf send_msg;
136
137 memset(&send_msg, 0, sizeof(send_msg));
138
139 /*check the input param*/
140 if (msg_ptr == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700141 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_sms_write_msg fun's input param is valid!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700142 return -1;
143 }
144
145 /*set the value*/
146 send_msg.msg_hdr.type = ZTE_SMS_RELAY_TYPE;
147 send_msg.msg_hdr.id = ZTE_MC_SMS_WRITE_MSG_CMD;
148 send_msg.msg_hdr.result = OK;
149#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
150 /*check the length before memcpy for safe*/
151 if (sizeof(T_zUfiSms_SaveReq) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700152 slog(MISC_PRINT, SLOG_ERR, "the size of sms_write_msg_info_s_type is more than the msg buf , sizeof(sms_write_msg_info_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700153 , sizeof(T_zUfiSms_SaveReq));/*lint !e26*/
154 return -1;
155 }
156#endif
157 memcpy(send_msg.msg_data, msg_ptr, sizeof(T_zUfiSms_SaveReq));
158
xf.libdd93d52023-05-12 07:10:14 -0700159 slog(MISC_PRINT, SLOG_NORMAL, "send_message sms write msg start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700160 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL,MSG_CMD_DRAFTS_SAVE,sizeof(send_msg), (char*)&send_msg);
161 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_DRAFTS_SAVE, sizeof(send_msg), (char*)&send_msg, 0);
xf.libdd93d52023-05-12 07:10:14 -0700162 slog(MISC_PRINT, SLOG_DEBUG, "send_message sms write msg end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700163
164 if (ret_code != OK) {
165 slog(MISC_PRINT, SLOG_ERR, "mc lib relay sms send write msg fail"); /*lint !e26*/
166 return -1;
167 }
168
169 return OK;
170}
171
172
173/******************************************************
174* Function: zte_mc_relay_sms_delete_msg
175* Description: the fun to relay SMS send delete msg to the mc process
176* Input:
177* Output:
178* Return:
179* Others:
180* Modify Date Version Author Modification
181* 20121025 V1.0 liuyingnan create
182*******************************************************/
183int zte_mc_relay_sms_delete_msg(T_zUfiSms_DelReq *del_info_ptr)
184{
185 int ret_code = 0;
186
187 //int tmp = 0;
188 //int i_tmp = 0;
189
190 /*check the input param*/
191 if (del_info_ptr == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700192 slog(MISC_PRINT, SLOG_ERR,"the mc_relay_sms_delete_msg fun's input param is valid!");/*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700193 return -1;
194 }
195
196#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
197 /*check the length before memcpy for safe*/
198 if (sizeof(T_zUfiSms_DelReq) > MSG_DATA_MAX_LEN) {
xf.libdd93d52023-05-12 07:10:14 -0700199 slog(MISC_PRINT, SLOG_ERR,"the size of sms_delete_msg_info_s_type is more than the msg buf , sizeof(sms_delete_msg_info_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700200 , sizeof(T_zUfiSms_DelReq));/*lint !e26*/
201 return -1;
202 }
203#endif
204
205 //slog(MISC_PRINT,SLOG_NORMAL,"del_info_ptr->db is %d\n",del_info_ptr->db);/*lint !e26*/
206
207 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
208 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL, MSG_CMD_DEL_SMS_BY_INDEX, sizeof(T_zUfiSms_DelReq), (char *)del_info_ptr);
209 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_DEL_SMS_BY_INDEX, sizeof(T_zUfiSms_DelReq), (char *)del_info_ptr, 0);
xf.libdd93d52023-05-12 07:10:14 -0700210 slog(MISC_PRINT, SLOG_DEBUG,"send_message sms delete msg end!");/*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700211 if (ret_code != OK) {
212 slog(MISC_PRINT, SLOG_ERR,"mc lib relay sms send delete msg fail");/*lint !e26*/
213 return -1;
214 }
215 return OK;
216}
217/******************************************************
218* Function: zte_mc_relay_sms_move_to_sim_msg
219* Description: the fun to SMS move to sim msg to the mc process
220* Input:
221* Output:
222* Return:
223* Others:
224* Modify Date Version Author Modification
225* 20121025 V1.0 liuyingnan create
226*******************************************************/
227int zte_mc_relay_sms_move_to_sim_msg(T_zUfiSms_DelReq *del_info_ptr)
228{
229 int ret_code = 0;
230
231 int tmp = 0;
232 int i_tmp = 0;
233
234 /*check the input param*/
235 if (del_info_ptr == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700236 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_sms_move_to_sim_msg fun's input param is valid!");
lh9ed821d2023-04-07 01:36:19 -0700237 return -1;
238 }
239
240#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
241 /*check the length before memcpy for safe*/
242 if (sizeof(T_zUfiSms_DelReq) > MSG_DATA_MAX_LEN) {
xf.libdd93d52023-05-12 07:10:14 -0700243 slog(MISC_PRINT, SLOG_ERR, "the size of sms_delete_msg_info_s_type is more than the msg buf , sizeof(sms_delete_msg_info_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700244 , sizeof(T_zUfiSms_DelReq));
245 return -1;
246 }
247#endif
248
xf.libdd93d52023-05-12 07:10:14 -0700249 slog(MISC_PRINT, SLOG_NORMAL, "send_message sms move to sim msg start!");
lh9ed821d2023-04-07 01:36:19 -0700250 //slog(MISC_PRINT,SLOG_DEBUG,"del_info_ptr->db is %d\n",del_info_ptr->db);
251
252 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
253 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL, MSG_CMD_COPY_SMS, sizeof(T_zUfiSms_DelReq), (char *)del_info_ptr);
254 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_COPY_SMS, sizeof(T_zUfiSms_DelReq), (char *)del_info_ptr, 0);
xf.libdd93d52023-05-12 07:10:14 -0700255 slog(MISC_PRINT, SLOG_DEBUG, "send_message sms move to sim msg end!");
lh9ed821d2023-04-07 01:36:19 -0700256 if (ret_code != OK) {
257 slog(MISC_PRINT, SLOG_ERR, "mc lib relay sms send move to sim msg fail");
258 return -1;
259 }
260 return OK;
261}
262
263/******************************************************
264* Function: zte_mc_relay_sms_set_parameter
265* Description: the fun to relay SMS send set_parameter to the mc process
266* Input:
267* Output:
268* Return:
269* Others:
270* Modify Date Version Author Modification
271* 20121025 V1.0 liuyingnan create
272*******************************************************/
273int zte_mc_relay_sms_set_parameter(T_zUfiSms_ParaInfo *parameter_ptr)
274{
275 int ret_code = 0;
276 T_zGoaheadMsgBuf send_msg;
277
278 memset(&send_msg, 0, sizeof(send_msg));
279
280 /*check the input param*/
281 if (parameter_ptr == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700282 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_sms_set_parameter fun's input param is valid!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700283 return -1;
284 }
285
286 /*set the value*/
287 send_msg.msg_hdr.type = ZTE_SMS_RELAY_TYPE;
288 send_msg.msg_hdr.id = ZTE_MC_SMS_SET_PARAM_CMD;
289 send_msg.msg_hdr.result = OK;
290#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
291 /*check the length before memcpy for safe*/
292 if (sizeof(T_zUfiSms_ParaInfo) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700293 slog(MISC_PRINT, SLOG_ERR, "the size of sms_parameter_info_s_type is more than the msg buf , sizeof(sms_parameter_info_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700294 , sizeof(T_zUfiSms_ParaInfo));/*lint !e26*/
295 return -1;
296 }
297#endif
298 memcpy(send_msg.msg_data, parameter_ptr, sizeof(T_zUfiSms_ParaInfo));
299
xf.libdd93d52023-05-12 07:10:14 -0700300 slog(MISC_PRINT, SLOG_NORMAL, "send_message sms set parameter( start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700301 //ret_code = zte_send_message(ZUFI_MODULE_ID_AT_LOCAL,MSG_CMD_SMS_LOCATION_SET, sizeof(send_msg), (char*)&send_msg);
302 ret_code = ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_SMS, MSG_CMD_SMS_LOCATION_SET, sizeof(send_msg), (char*)&send_msg, 0);
xf.libdd93d52023-05-12 07:10:14 -0700303 slog(MISC_PRINT, SLOG_DEBUG, "send_message sms set parameter( end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700304
305 if (ret_code != OK) {
306 slog(MISC_PRINT, SLOG_ERR, "mc lib relay sms set parameter msg fail"); /*lint !e26*/
307 return -1;
308 }
309
310 return OK;
311}
312
313
314
315
316/******************************************************
317* Function: zte_mc_relay_pbm_create_modify_record
318* Description: the fun to relay PBM send create modify to the mc process
319* Input:
320* Output:
321* Return:
322* Others:
323* Modify Date Version Author Modification
324* 20121025 V1.0 liuyingnan create
325*******************************************************/
326int zte_mc_relay_pbm_create_modify_record(zte_pbm_create_ext_record_s_type *pbm_recv_record)
327{
328 int ret_code = 0;
329 T_zGoaheadMsgBuf send_msg;
330
331 memset(&send_msg, 0, sizeof(send_msg));
332
333 /*check the input param*/
334 if (pbm_recv_record == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700335 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_pbm_create_modify_record fun's input is NULL "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700336 return -1;
337 }
338
xf.libdd93d52023-05-12 07:10:14 -0700339 slog(MISC_PRINT, SLOG_DEBUG, "enter the mc_relay_pbm_create_modify_record fun "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700340
341 /*set the value*/
342 send_msg.msg_hdr.type = ZTE_PBM_RELAY_TYPE;
343 send_msg.msg_hdr.id = ZTE_MC_PBM_CREATE_MODIFY_RECORD_CMD;
344 send_msg.msg_hdr.result = OK;
345#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
346 /*check the length before memcpy for safe*/
347 if (sizeof(zte_pbm_create_ext_record_s_type) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700348 slog(MISC_PRINT, SLOG_ERR, "the size of pbm_create_ext_record_s_type is more than the msg buf , sizeof(pbm_create_ext_record_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700349 , sizeof(zte_pbm_create_ext_record_s_type));/*lint !e26*/
350 return -1;
351 }
352#endif
353 memcpy(send_msg.msg_data, pbm_recv_record, sizeof(zte_pbm_create_ext_record_s_type));
354
xf.libdd93d52023-05-12 07:10:14 -0700355 slog(MISC_PRINT, SLOG_NORMAL, "send_message PBM create modify record start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700356#if 0 // cov M when zte_send_message is commented, ret_code!= OK is unreachable
357 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
xf.libdd93d52023-05-12 07:10:14 -0700358 slog(MISC_PRINT, SLOG_DEBUG, "send_message PBM create modify record end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700359
360 if (ret_code != OK) {
361 slog(MISC_PRINT, SLOG_ERR, "mc lib relay pbm send create modify record fail"); /*lint !e26*/
362 return -1;
363 }
364#endif
365 return OK;
366}
367
368
369
370/******************************************************
371* Function: zte_mc_relay_pbm_del_one_record
372* Description: the fun to relay PBM send del one record to the mc process
373* Input:
374* Output:
375* Return:
376* Others:
377* Modify Date Version Author Modification
378* 20121025 V1.0 liuyingnan create
379*******************************************************/
380int zte_mc_relay_pbm_del_one_record(zte_pbm_del_multi_records_s_type *pbm_recv_record)
381{
382 int ret_code = 0;
383 T_zGoaheadMsgBuf send_msg;
384
385 memset(&send_msg, 0, sizeof(send_msg));
386
387 /*check the input param*/
388 if (pbm_recv_record == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700389 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_pbm_del_multi_record fun's input is NULL "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700390 return -1;
391 }
392
xf.libdd93d52023-05-12 07:10:14 -0700393 slog(MISC_PRINT, SLOG_DEBUG, "enter the mc_relay_pbm_del_one_record fun "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700394
395 /*set the value*/
396 send_msg.msg_hdr.type = ZTE_PBM_RELAY_TYPE;
397 send_msg.msg_hdr.id = ZTE_MC_PBM_DEL_ONE_RECORD_CMD;
398 send_msg.msg_hdr.result = OK;
399#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
400 /*check the length before memcpy for safe*/
401 if (sizeof(zte_pbm_del_multi_records_s_type) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700402 slog(MISC_PRINT, SLOG_ERR, "the size of pbm_del_multi_records_s_type is more than the msg buf , sizeof(pbm_del_multi_records_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700403 , sizeof(zte_pbm_create_ext_record_s_type));/*lint !e26*/
404 return -1;
405 }
406#endif
407 memcpy(send_msg.msg_data, pbm_recv_record, sizeof(zte_pbm_del_multi_records_s_type));
408
xf.libdd93d52023-05-12 07:10:14 -0700409 slog(MISC_PRINT, SLOG_NORMAL, "send_message PBM del one record start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700410#if 0 // cov M when zte_send_message is commented, ret_code!= OK is unreachable
411 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
xf.libdd93d52023-05-12 07:10:14 -0700412 slog(MISC_PRINT, SLOG_DEBUG, "send_message PBM del one record end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700413
414 if (ret_code != OK) {
415 slog(MISC_PRINT, SLOG_ERR, "mc lib relay pbm del one record msg fail"); /*lint !e26*/
416 return -1;
417 }
418#endif
419 return OK;
420}
421
422/******************************************************
423* Function: zte_mc_relay_pbm_del_multi_record
424* Description: the fun to relay PBM send del multi record to the mc process
425* Input:
426* Output:
427* Return:
428* Others:
429* Modify Date Version Author Modification
430* 20121025 V1.0 liuyingnan create
431*******************************************************/
432int zte_mc_relay_pbm_del_multi_record(zte_pbm_del_multi_records_s_type *pbm_recv_record)
433{
434 int ret_code = 0;
435 T_zGoaheadMsgBuf send_msg;
436
437 memset(&send_msg, 0, sizeof(send_msg));
438
439 /*check the input param*/
440 if (pbm_recv_record == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700441 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_pbm_del_multi_record fun's input is NULL "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700442 return -1;
443 }
444
xf.libdd93d52023-05-12 07:10:14 -0700445 slog(MISC_PRINT, SLOG_DEBUG, "enter the mc_relay_pbm_del_multi_record fun "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700446
447 /*set the value*/
448 send_msg.msg_hdr.type = ZTE_PBM_RELAY_TYPE;
449 send_msg.msg_hdr.id = ZTE_MC_PBM_DEL_MULTI_RECORD_CMD;
450 send_msg.msg_hdr.result = OK;
451#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
452 /*check the length before memcpy for safe*/
453 if (sizeof(zte_pbm_del_multi_records_s_type) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700454 slog(MISC_PRINT, SLOG_ERR, "the size of pbm_del_multi_records_s_type is more than the msg buf , sizeof(pbm_del_multi_records_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700455 , sizeof(zte_pbm_create_ext_record_s_type));/*lint !e26*/
456 return -1;
457 }
458#endif
459 memcpy(send_msg.msg_data, pbm_recv_record, sizeof(zte_pbm_del_multi_records_s_type));
460
461
xf.libdd93d52023-05-12 07:10:14 -0700462 slog(MISC_PRINT, SLOG_NORMAL, "send_message PBM del multi record start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700463#if 0 // cov M when zte_send_message is commented, ret_code!= OK is unreachable
464 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
xf.libdd93d52023-05-12 07:10:14 -0700465 slog(MISC_PRINT, SLOG_DEBUG, "send_message PBM del multi record end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700466
467 if (ret_code != OK) {
468 slog(MISC_PRINT, SLOG_ERR, "mc lib relay pbm del multi record msg fail"); /*lint !e26*/
469 return -1;
470 }
471#endif
472 return OK;
473}
474
475
476/******************************************************
477* Function: zte_mc_relay_pbm_del_all_record
478* Description: the fun to relay PBM send del all record to the mc process
479* Input:
480* Output:
481* Return:
482* Others:
483* Modify Date Version Author Modification
484* 20121025 V1.0 liuyingnan create
485*******************************************************/
486int zte_mc_relay_pbm_del_all_record(zte_pbm_del_multi_records_s_type *pbm_recv_record)
487{
488 int ret_code = 0;
489 T_zGoaheadMsgBuf send_msg;
490
491 memset(&send_msg, 0, sizeof(send_msg));
492
493 /*check the input param*/
494 if (pbm_recv_record == NULL) {
xf.libdd93d52023-05-12 07:10:14 -0700495 slog(MISC_PRINT, SLOG_ERR, "the mc_relay_pbm_del_all_record fun's input is NULL "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700496 return -1;
497 }
498
xf.libdd93d52023-05-12 07:10:14 -0700499 slog(MISC_PRINT, SLOG_DEBUG, "enter the mc_relay_pbm_del_all_record fun "); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700500
501 /*set the value*/
502 send_msg.msg_hdr.type = ZTE_PBM_RELAY_TYPE;
503 send_msg.msg_hdr.id = ZTE_MC_PBM_DEL_ALL_RECORD_CMD;
504 send_msg.msg_hdr.result = OK;
505#if 0 // kw 3 INVARIANT_CONDITION.UNREACH
506 /*check the length before memcpy for safe*/
507 if (sizeof(zte_pbm_del_multi_records_s_type) > ZTE_MODEM_RELAY_MSGBUF_MAX_LEN) { /*lint !e506*/
xf.libdd93d52023-05-12 07:10:14 -0700508 slog(MISC_PRINT, SLOG_ERR, "the size of pbm_del_multi_records_s_type is more than the msg buf , sizeof(pbm_del_multi_records_s_type) = %d!"
lh9ed821d2023-04-07 01:36:19 -0700509 , sizeof(zte_pbm_create_ext_record_s_type));/*lint !e26*/
510 return -1;
511 }
512#endif
513 memcpy(send_msg.msg_data, pbm_recv_record, sizeof(zte_pbm_del_multi_records_s_type));
514
515
xf.libdd93d52023-05-12 07:10:14 -0700516 slog(MISC_PRINT, SLOG_NORMAL, "send_message PBM del all record start!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700517#if 0 // cov M // when zte_send_message is commented, ret_code != OK is unreachable
518 //ret_code = zte_send_message(ZTE_SOCKET_PATH_MAIN_CONTROL, sizeof(send_msg), (char*)&send_msg);
xf.libdd93d52023-05-12 07:10:14 -0700519 slog(MISC_PRINT, SLOG_DEBUG, "send_message PBM del all record end!"); /*lint !e26*/
lh9ed821d2023-04-07 01:36:19 -0700520
521 if (ret_code != OK) {
522 slog(MISC_PRINT, SLOG_ERR, "mc lib relay pbm del all record msg fail"); /*lint !e26*/
523 return -1;
524 }
525#endif
526
527 return OK;
528}
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568