Mercurial > hg > freeDiameter
comparison extensions/app_radgw/rgwx_acct.c @ 530:825a2992e3b9
Improved duplicate detection in RADIUS/Diameter gw. It will be changed again soon
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 06 Sep 2010 14:28:53 +0900 |
parents | 6fe3e5cf9fb2 |
children | 4cb8f63a0f67 |
comparison
equal
deleted
inserted
replaced
529:be646053706b | 530:825a2992e3b9 |
---|---|
824 CHECK_FCT( fd_msg_avp_new ( cs->dict.Accounting_Record_Type, 0, &avp ) ); | 824 CHECK_FCT( fd_msg_avp_new ( cs->dict.Accounting_Record_Type, 0, &avp ) ); |
825 CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) ); | 825 CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) ); |
826 CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) ); | 826 CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) ); |
827 | 827 |
828 /* While here, we also add the Accouting-Record-Number AVP. | 828 /* While here, we also add the Accouting-Record-Number AVP. |
829 We don't have a dedicated counter nor a state, so we just use the Diameter message End-to-end id here, which fits the conditions on the value. */ | 829 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 |
830 and identifies this record within one session. As Session-Id AVPs | |
831 are globally unique, the combination of Session-Id and Accounting- | |
832 Record-Number AVPs is also globally unique, and can be used in | |
833 matching accounting records with confirmations. An easy way to | |
834 produce unique numbers is to set the value to 0 for records of type | |
835 EVENT_RECORD and START_RECORD, and set the value to 1 for the first | |
836 INTERIM_RECORD, 2 for the second, and so on until the value for | |
837 STOP_RECORD is one more than for the last INTERIM_RECORD. | |
838 | |
839 -- we actually use the end-to-end id of the message here, which remains constant | |
840 if we send a duplicate, so it has the same properties as the suggested algorithm. | |
841 Anyway, it assumes that we are not converting twice the same RADIUS message. | |
842 . */ | |
830 CHECK_FCT( fd_msg_avp_new ( cs->dict.Accounting_Record_Number, 0, &avp ) ); | 843 CHECK_FCT( fd_msg_avp_new ( cs->dict.Accounting_Record_Number, 0, &avp ) ); |
831 value.u32 = e2eid; | 844 value.u32 = e2eid; |
832 CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) ); | 845 CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) ); |
833 CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) ); | 846 CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) ); |
834 | 847 |