Mercurial > hg > freeDiameter
comparison extensions/app_radgw/rgwx_acct.c @ 535:72c511043f05
A few bug fixes on the RADIUS/Diameter gateway.
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Thu, 09 Sep 2010 14:17:54 +0900 |
parents | 4cb8f63a0f67 |
children | f95cfc35d960 |
comparison
equal
deleted
inserted
replaced
534:6af365b6f955 | 535:72c511043f05 |
---|---|
487 | 487 |
488 /* Create the Session-Id AVP if needed */ | 488 /* Create the Session-Id AVP if needed */ |
489 if (!*session) { | 489 if (!*session) { |
490 CHECK_FCT( fd_sess_fromsid ( (char *)/* cast should be removed later */si, si_len, session, NULL) ); | 490 CHECK_FCT( fd_sess_fromsid ( (char *)/* cast should be removed later */si, si_len, session, NULL) ); |
491 | 491 |
492 TRACE_DEBUG(FULL, "[auth.rgwx] Translating new accounting message for session '%.*s'...", si_len, si); | 492 TRACE_DEBUG(FULL, "[acct.rgwx] Translating new accounting message for session '%.*s'...", si_len, si); |
493 | 493 |
494 /* Add the Session-Id AVP as first AVP */ | 494 /* Add the Session-Id AVP as first AVP */ |
495 CHECK_FCT( fd_msg_avp_new ( cs->dict.Session_Id, 0, &avp ) ); | 495 CHECK_FCT( fd_msg_avp_new ( cs->dict.Session_Id, 0, &avp ) ); |
496 value.os.data = (unsigned char *)si; | 496 value.os.data = (unsigned char *)si; |
497 value.os.len = si_len; | 497 value.os.len = si_len; |
1259 case ER_DIAMETER_LIMITED_SUCCESS: | 1259 case ER_DIAMETER_LIMITED_SUCCESS: |
1260 (*rad_fw)->hdr->code = RADIUS_CODE_ACCOUNTING_RESPONSE; | 1260 (*rad_fw)->hdr->code = RADIUS_CODE_ACCOUNTING_RESPONSE; |
1261 break; | 1261 break; |
1262 | 1262 |
1263 default: | 1263 default: |
1264 fd_log_debug("[auth.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, not translating into Accounting-Response\n", | 1264 fd_log_debug("[acct.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, not translating into Accounting-Response\n", |
1265 ahdr->avp_value->u32, | 1265 ahdr->avp_value->u32, |
1266 oh->avp_value->os.len, oh->avp_value->os.data, | 1266 oh->avp_value->os.len, oh->avp_value->os.data, |
1267 sid->avp_value->os.len, sid->avp_value->os.data); | 1267 sid->avp_value->os.len, sid->avp_value->os.data); |
1268 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Error_Message, &avp) ); | 1268 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Error_Message, &avp) ); |
1269 if (avp) { | 1269 if (avp) { |
1270 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); | 1270 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); |
1271 fd_log_debug("[auth.rgwx] Error-Message content: '%.*s'\n", | 1271 fd_log_debug("[acct.rgwx] Error-Message content: '%.*s'\n", |
1272 ahdr->avp_value->os.len, ahdr->avp_value->os.data); | 1272 ahdr->avp_value->os.len, ahdr->avp_value->os.data); |
1273 } | 1273 } |
1274 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Error_Reporting_Host, &avp) ); | 1274 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Error_Reporting_Host, &avp) ); |
1275 if (avp) { | 1275 if (avp) { |
1276 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); | 1276 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); |
1277 fd_log_debug("[auth.rgwx] Error-Reporting-Host: '%.*s'\n", | 1277 fd_log_debug("[acct.rgwx] Error-Reporting-Host: '%.*s'\n", |
1278 ahdr->avp_value->os.len, ahdr->avp_value->os.data); | 1278 ahdr->avp_value->os.len, ahdr->avp_value->os.data); |
1279 } | 1279 } |
1280 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Failed_AVP, &avp) ); | 1280 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Failed_AVP, &avp) ); |
1281 if (avp) { | 1281 if (avp) { |
1282 fd_log_debug("[auth.rgwx] Failed-AVP was included in the message.\n"); | 1282 fd_log_debug("[acct.rgwx] Failed-AVP was included in the message.\n"); |
1283 /* Dump its content ? */ | 1283 /* Dump its content ? */ |
1284 } | 1284 } |
1285 return -1; | 1285 return -1; |
1286 } | 1286 } |
1287 /* Remove this Result-Code avp */ | 1287 /* Remove this Result-Code avp */ |