comparison libfreeDiameter/messages.c @ 638:9448cba86673

Improved usability of dbg_interactive
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 17 Dec 2010 18:41:19 +0900
parents 22e8fac3b2d6
children cfc8da9264f4
comparison
equal deleted inserted replaced
637:22e8fac3b2d6 638:9448cba86673
137 137
138 #define VALIDATE_OBJ(_x) ( (CHECK_MSG(_x)) || (CHECK_AVP(_x)) ) 138 #define VALIDATE_OBJ(_x) ( (CHECK_MSG(_x)) || (CHECK_AVP(_x)) )
139 139
140 140
141 /* Macro to validate a MSGFL_ value */ 141 /* Macro to validate a MSGFL_ value */
142 #define CHECK_AVPFL(_fl) ( ((_fl) & (- (AVPFL_MAX << 1) )) == 0 )
142 #define CHECK_MSGFL(_fl) ( ((_fl) & (- (MSGFL_MAX << 1) )) == 0 ) 143 #define CHECK_MSGFL(_fl) ( ((_fl) & (- (MSGFL_MAX << 1) )) == 0 )
143 144
144 145
145 /* initial sizes of AVP from their types, in bytes. */ 146 /* initial sizes of AVP from their types, in bytes. */
146 static int avp_value_sizes[] = { 147 static int avp_value_sizes[] = {
197 struct avp *new = NULL; 198 struct avp *new = NULL;
198 199
199 TRACE_ENTRY("%p %x %p", model, flags, avp); 200 TRACE_ENTRY("%p %x %p", model, flags, avp);
200 201
201 /* Check the parameters */ 202 /* Check the parameters */
202 CHECK_PARAMS( avp && CHECK_MSGFL(flags) ); 203 CHECK_PARAMS( avp && CHECK_AVPFL(flags) );
203 204
204 if (model) { 205 if (model) {
205 enum dict_object_type dicttype; 206 enum dict_object_type dicttype;
206 CHECK_PARAMS( (fd_dict_gettype(model, &dicttype) == 0) && (dicttype == DICT_AVP) ); 207 CHECK_PARAMS( (fd_dict_gettype(model, &dicttype) == 0) && (dicttype == DICT_AVP) );
207 } 208 }
220 new->avp_model = model; 221 new->avp_model = model;
221 new->avp_public.avp_code = dictdata.avp_code; 222 new->avp_public.avp_code = dictdata.avp_code;
222 new->avp_public.avp_flags = dictdata.avp_flag_val; 223 new->avp_public.avp_flags = dictdata.avp_flag_val;
223 new->avp_public.avp_len = GETINITIALSIZE(dictdata.avp_basetype, dictdata.avp_flag_val ); 224 new->avp_public.avp_len = GETINITIALSIZE(dictdata.avp_basetype, dictdata.avp_flag_val );
224 new->avp_public.avp_vendor = dictdata.avp_vendor; 225 new->avp_public.avp_vendor = dictdata.avp_vendor;
226 }
227
228 if (flags & AVPFL_SET_BLANK_VALUE) {
229 new->avp_public.avp_value = &new->avp_storage;
225 } 230 }
226 231
227 /* The new object is ready, return */ 232 /* The new object is ready, return */
228 *avp = new; 233 *avp = new;
229 return 0; 234 return 0;
"Welcome to our mercurial repository"