Changeset 1250:446683efbb1f in freeDiameter
- Timestamp:
- Jan 13, 2014, 12:01:21 AM (10 years ago)
- Branch:
- default
- Children:
- 1251:bdd7bf840c8d, 1253:3734341ad03b
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/messages.c
r1230 r1250 239 239 struct avp * optavp_cpy = NULL; 240 240 struct avp_hdr *opt_hdr, *optcpy_hdr; 241 struct dict_object * opt_model = NULL; 242 int is_grouped = 0; 241 243 242 244 /* Create the Failed-AVP AVP */ 243 245 CHECK_FCT( fd_msg_avp_new( dict_avp_FAVP, 0, &avp_FAVP ) ); 244 246 247 /* Was this AVP a grouped one? Best effort only here */ 248 if (!fd_msg_model ( optavp, &opt_model ) && (opt_model != NULL)) { 249 struct dict_avp_data dictdata; 250 CHECK_FCT( fd_dict_getval(opt_model, &dictdata) ); 251 if (dictdata.avp_basetype == AVP_TYPE_GROUPED) 252 is_grouped = 1; 253 } 254 245 255 /* Create a new AVP with a copy of the data of the invalid or missing AVP */ 246 256 optavp_cpy = optavp; 247 CHECK_FCT( fd_msg_avp_new( NULL, AVPFL_SET_BLANK_VALUE | AVPFL_SET_RAWDATA_FROM_AVP, &optavp_cpy) ); 248 249 CHECK_FCT( fd_msg_avp_hdr(optavp, &opt_hdr) ); 250 CHECK_FCT( fd_msg_avp_hdr(optavp_cpy, &optcpy_hdr) ); 251 memcpy(optcpy_hdr, opt_hdr, sizeof(struct avp_hdr)); 257 258 if (is_grouped) { 259 CHECK_FCT( fd_msg_avp_new( opt_model, 0, &optavp_cpy) ); 260 } else { 261 CHECK_FCT( fd_msg_avp_new( NULL, AVPFL_SET_BLANK_VALUE | AVPFL_SET_RAWDATA_FROM_AVP, &optavp_cpy) ); 262 263 CHECK_FCT( fd_msg_avp_hdr(optavp, &opt_hdr) ); 264 CHECK_FCT( fd_msg_avp_hdr(optavp_cpy, &optcpy_hdr) ); 265 memcpy(optcpy_hdr, opt_hdr, sizeof(struct avp_hdr)); 266 } 252 267 253 268 /* Add the passed AVP inside it */
Note: See TracChangeset
for help on using the changeset viewer.