@@ -143,6 +143,20 @@ void xml_exit(void)
143143 xml_free_ns ();
144144}
145145
146+ void xml_log_parameter_fault ()
147+ {
148+ struct list_head * ilist ;
149+ struct external_parameter * external_parameter ;
150+
151+ list_for_each (ilist , & external_list_parameter ) {
152+ external_parameter = list_entry (ilist , struct external_parameter , list );
153+ if (external_parameter -> fault_code && external_parameter -> fault_code [0 ]== '9' ) {
154+ log_message (NAME , L_NOTICE , "Fault in the param: %s , Fault code: %s\n" , external_parameter -> name , external_parameter -> fault_code );
155+ }
156+ }
157+
158+ }
159+
146160int xml_check_duplicated_parameter (mxml_node_t * tree )
147161{
148162 mxml_node_t * b , * n = tree ;
@@ -157,7 +171,10 @@ int xml_check_duplicated_parameter(mxml_node_t *tree)
157171 b -> value .text .string &&
158172 b -> parent -> type == MXML_ELEMENT &&
159173 !strcmp (b -> parent -> value .element .name , "Name" )) {
160- if (strcmp (b -> value .text .string , n -> value .text .string ) == 0 ) return 1 ;
174+ if (strcmp (b -> value .text .string , n -> value .text .string ) == 0 ) {
175+ log_message (NAME , L_NOTICE , "Fault in the param: %s , Fault code: 9003 <parameter duplicated>\n" , b -> value .text .string );
176+ return 1 ;
177+ }
161178 }
162179 }
163180 }
@@ -818,7 +835,7 @@ int xml_handle_set_parameter_values(mxml_node_t *body_in,
818835 external_action_simple_execute ("apply" , "value" , param_key );
819836 free (param_key );
820837
821- if (external_action_handle (json_handle_set_parameter_value ))
838+ if (external_action_handle (json_handle_set_parameter ))
822839 goto fault_out ;
823840
824841 list_for_each (ilist , & external_list_parameter ) {
@@ -828,7 +845,7 @@ int xml_handle_set_parameter_values(mxml_node_t *body_in,
828845 goto fault_out ;
829846 }
830847 }
831- external_fetch_set_param_val_resp_status (& status );
848+ external_fetch_set_param_resp_status (& status );
832849 if (!status )
833850 goto fault_out ;
834851
@@ -848,6 +865,7 @@ int xml_handle_set_parameter_values(mxml_node_t *body_in,
848865 return 0 ;
849866
850867fault_out :
868+ xml_log_parameter_fault ();
851869 free (parameter_value );
852870 xml_create_set_parameter_value_fault_message (body_out , code );
853871 free (status );
@@ -945,6 +963,7 @@ int xml_handle_get_parameter_values(mxml_node_t *body_in,
945963 log_message (NAME , L_NOTICE , "send GetParameterValuesResponse to the ACS\n" );
946964 return 0 ;
947965fault_out :
966+ xml_log_parameter_fault ();
948967 xml_create_generic_fault_message (body_out , code );
949968 external_free_list_parameter ();
950969 return 0 ;
@@ -1048,6 +1067,7 @@ int xml_handle_get_parameter_names(mxml_node_t *body_in,
10481067 log_message (NAME , L_NOTICE , "send GetParameterNamesResponse to the ACS\n" );
10491068 return 0 ;
10501069fault_out :
1070+ xml_log_parameter_fault ();
10511071 xml_create_generic_fault_message (body_out , code );
10521072 external_free_list_parameter ();
10531073 return 0 ;
@@ -1143,6 +1163,7 @@ static int xml_handle_get_parameter_attributes(mxml_node_t *body_in,
11431163 log_message (NAME , L_NOTICE , "send GetParameterAttributesResponse to the ACS\n" );
11441164 return 0 ;
11451165fault_out :
1166+ xml_log_parameter_fault ();
11461167 xml_create_generic_fault_message (body_out , code );
11471168 external_free_list_parameter ();
11481169 return 0 ;
@@ -1158,8 +1179,10 @@ static int xml_handle_set_parameter_attributes(mxml_node_t *body_in,
11581179 mxml_node_t * tree_out ) {
11591180
11601181 mxml_node_t * b = body_in , * body_out ;
1161- char * c , * parameter_name , * parameter_notification , * success = NULL , * fault = NULL ;
1182+ char * c , * parameter_name , * parameter_notification , * success = NULL ;
11621183 uint8_t attr_notification_update = 0 ;
1184+ struct external_parameter * external_parameter ;
1185+ struct list_head * ilist ;
11631186 int code = FAULT_9002 ;
11641187
11651188 body_out = mxmlFindElement (tree_out , tree_out , "soap_env:Body" , NULL , NULL , MXML_DESCEND );
@@ -1222,39 +1245,35 @@ static int xml_handle_set_parameter_attributes(mxml_node_t *body_in,
12221245
12231246 external_action_simple_execute ("apply" , "notification" , NULL );
12241247
1225- if (external_action_handle (json_handle_method_status ))
1248+ if (external_action_handle (json_handle_set_parameter ))
12261249 goto fault_out ;
12271250
1228-
1229- external_fetch_method_resp_status ( & success , & fault );
1230-
1231- if ( fault && fault [ 0 ] == '9' ) {
1232- code = xml_get_index_fault ( fault ) ;
1233- goto fault_out ;
1251+ list_for_each ( ilist , & external_list_parameter ) {
1252+ external_parameter = list_entry ( ilist , struct external_parameter , list );
1253+ if ( external_parameter -> fault_code && external_parameter -> fault_code [ 0 ] == '9' ) {
1254+ code = xml_get_index_fault ( external_parameter -> fault_code );
1255+ goto fault_out ;
1256+ }
12341257 }
1235-
1236- if (!success || success [ 0 ] == '\0' ) {
1258+ external_fetch_set_param_resp_status ( & success );
1259+ if (!success )
12371260 goto fault_out ;
1238- }
1239-
12401261
12411262 b = mxmlNewElement (body_out , "cwmp:SetParameterAttributesResponse" );
12421263 if (!b ) goto error ;
12431264
12441265 free (success );
1245- free (fault );
12461266
12471267 log_message (NAME , L_NOTICE , "send SetParameterAttributesResponse to the ACS\n" );
12481268 return 0 ;
12491269
12501270fault_out :
1271+ xml_log_parameter_fault ();
12511272 xml_create_generic_fault_message (body_out , code );
12521273 free (success );
1253- free (fault );
12541274 return 0 ;
12551275error :
12561276 free (success );
1257- free (fault );
12581277 return -1 ;
12591278}
12601279
@@ -1625,6 +1644,7 @@ static int xml_handle_AddObject(mxml_node_t *body_in,
16251644 return 0 ;
16261645
16271646fault_out :
1647+ log_message (NAME , L_NOTICE , "Fault in the param: %s, Fault code: %s\n" , object_name ? object_name : "" , fault_array [code ].code );
16281648 xml_create_generic_fault_message (body_out , code );
16291649 FREE (param_key );
16301650 free (instance );
@@ -1724,6 +1744,7 @@ static int xml_handle_DeleteObject(mxml_node_t *body_in,
17241744 return 0 ;
17251745
17261746fault_out :
1747+ log_message (NAME , L_NOTICE , "Fault in the param: %s, Fault code: %s\n" , object_name ? object_name : "" , fault_array [code ].code );
17271748 xml_create_generic_fault_message (body_out , code );
17281749 FREE (param_key );
17291750 free (status );
@@ -1795,6 +1816,7 @@ int xml_create_set_parameter_value_fault_message(mxml_node_t *body, int code)
17951816 external_parameter = list_entry (external_list_parameter .next , struct external_parameter , list );
17961817
17971818 if (external_parameter -> fault_code && external_parameter -> fault_code [0 ]== '9' ) {
1819+
17981820 index = xml_get_index_fault (external_parameter -> fault_code );
17991821
18001822 b = mxmlNewElement (n , "SetParameterValuesFault" );
0 commit comments