Changeset 112:6a294d977878 in freeDiameter
- Timestamp:
- Dec 8, 2009, 3:24:34 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_test/atst_serv.c
r93 r112 68 68 ans = *msg; 69 69 70 /* Set the Session-Id AVP */71 {72 char * sid;73 CHECK_FCT( fd_sess_getsid ( sess, &sid ) );74 CHECK_FCT( fd_msg_avp_new ( atst_sess_id, 0, &avp ) );75 val.os.data = sid;76 val.os.len = strlen(sid);77 CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );78 CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_FIRST_CHILD, avp ) );79 80 }81 70 /* Set the Test-AVP AVP */ 82 71 { -
freeDiameter/dispatch.c
r104 r112 192 192 193 193 /* Create an answer with the error code and message */ 194 CHECK_FCT_DO( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, &msg, MSGFL_ANSW_ERROR), goto fatal_error );194 CHECK_FCT_DO( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, &msg, 0 ), goto fatal_error ); 195 195 CHECK_FCT_DO( fd_msg_rescode_set(msg, (char *)ec, (char *)em, NULL, 1 ), goto fatal_error ); 196 196 -
freeDiameter/p_dp.c
r80 r112 98 98 /* Now reply with a DPA */ 99 99 CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, msg, 0 ) ); 100 CHECK_FCT( fd_msg_rescode_set( *msg, "DIAMETER_SUCCESS", NULL, NULL, 0 ) ); 101 CHECK_FCT( fd_msg_add_origin ( *msg, 0 ) ); 100 CHECK_FCT( fd_msg_rescode_set( *msg, "DIAMETER_SUCCESS", NULL, NULL, 1 ) ); 102 101 103 102 /* Move to CLOSING state to failover outgoing messages (and avoid failing the DPA...) */ -
include/freeDiameter/libfreeDiameter.h
r90 r112 1723 1723 #define MSGFL_ALLOC_ETEID 0x01 /* When creating a message, a new end-to-end ID is allocated and set in the message */ 1724 1724 #define MSGFL_ANSW_ERROR 0x02 /* When creating an answer message, set the 'E' bit and use the generic error ABNF instead of command-specific ABNF */ 1725 #define MSGFL_MAX MSGFL_ANSW_ERROR /* The biggest valid flag value */ 1725 #define MSGFL_ANSW_NOSID 0x04 /* When creating an answer message, do not add the Session-Id even if present in request */ 1726 #define MSGFL_MAX MSGFL_ANSW_NOSID /* The biggest valid flag value */ 1726 1727 1727 1728 /**************************************************/ -
libfreeDiameter/messages.c
r100 r112 287 287 struct dict_object * model = NULL; 288 288 struct msg *qry, *ans; 289 struct session * sess = NULL; 289 290 290 291 TRACE_ENTRY("%p %x", msg, flags); … … 294 295 qry = *msg; 295 296 CHECK_PARAMS( CHECK_MSG(qry) && (qry->msg_public.msg_flags & CMD_FLAG_REQUEST) ); 297 298 if (! (flags & MSGFL_ANSW_NOSID)) { 299 /* Get the session of the message */ 300 CHECK_FCT_DO( fd_msg_sess_get(dict, qry, &sess, NULL), /* ignore an error */ ); 301 } 296 302 297 303 /* Find the model for the answer */ … … 316 322 ans->msg_public.msg_hbhid = qry->msg_public.msg_hbhid; 317 323 324 /* Add the Session-Id AVP if session is known */ 325 if (sess && dict) { 326 struct dict_object * sess_id_avp; 327 char * sid; 328 struct avp * avp; 329 union avp_value val; 330 331 CHECK_FCT( fd_dict_search( dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &sess_id_avp, ENOENT) ); 332 CHECK_FCT( fd_sess_getsid ( sess, &sid ) ); 333 CHECK_FCT( fd_msg_avp_new ( sess_id_avp, 0, &avp ) ); 334 val.os.data = sid; 335 val.os.len = strlen(sid); 336 CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) ); 337 CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_FIRST_CHILD, avp ) ); 338 } 339 318 340 /* associate with query */ 319 /* may do CHECK_FCT( msg_answ_associate( *msg, (msg_t *)qry ) ); but this is quicker */320 341 ans->msg_query = qry; 321 342
Note: See TracChangeset
for help on using the changeset viewer.