Example #1
0
/**
 * Creates and adds a Vendor-Specific-Application-ID AVP.
 * @param msg - the Diameter message to add to.
 * @param vendor_id - the value of the vendor_id,
 * @param auth_id - the authorization application id
 * @param acct_id - the accounting application id
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_vendor_specific_appid(AAAMessage *msg,unsigned int vendor_id,
	unsigned int auth_id,unsigned int acct_id)
{
	AAA_AVP_LIST list;
	str group;
	char x[4];

	list.head=0;list.tail=0;
		
	set_4bytes(x,vendor_id);
	Rf_add_avp_list(&list,
		x,4,
		AVP_Vendor_Id,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);

	if (auth_id) {
		set_4bytes(x,auth_id);
		Rf_add_avp_list(&list,
			x,4,
			AVP_Auth_Application_Id,
			AAA_AVP_FLAG_MANDATORY,
			0,
			AVP_DUPLICATE_DATA,
			__FUNCTION__);
	}
	if (acct_id) {
		set_4bytes(x,acct_id);
		Rf_add_avp_list(&list,
			x,4,
			AVP_Acct_Application_Id,
			AAA_AVP_FLAG_MANDATORY,
			0,
			AVP_DUPLICATE_DATA,
			__FUNCTION__);
	}	
	
	group =  AAAGroupAVPS(list);
	
	 AAAFreeAVPList(&list);
	
	return 
	Rf_add_avp(msg,group.s,group.len,
		AVP_Vendor_Specific_Application_Id,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_FREE_DATA,
		__FUNCTION__);
}
Example #2
0
/** 
 * Creates and adds Called-Party-Address AVP to an AVP list 
 * @param list - the AVP list to add to.
 * @param data - the value for the AVP payload. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_called_party_address(AAA_AVP_LIST* list, str data)
{
	return
	Rf_add_avp_list(list,
		data.s,data.len,
		AVP_IMS_Called_Party_Address,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}	
Example #3
0
/** 
 * Creates and adds User-Session-Id AVP to an AVP list 
 * @param list - the AVP list to add to.
 * @param data - the value for the AVP payload. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_user_session_id(AAA_AVP_LIST* list, str data)
{
	return
	Rf_add_avp_list(list,
		data.s,data.len,
		AVP_IMS_User_Session_Id,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
Example #4
0
/** 
 * Creates and adds IMS-Charging-Identifier AVP to an AVP list 
 * @param list - the AVP list to add to.
 * @param data - the value for the AVP payload. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_ims_charging_id(AAA_AVP_LIST* list, str data)
{
	return
	Rf_add_avp_list(list,
		data.s,data.len,
		AVP_IMS_IMS_Charging_identifier,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
Example #5
0
/** 
 * Creates and adds Event AVP to an AVP list 
 * @param list - the AVP list to add to.
 * @param data - the value for the AVP payload. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_event(AAA_AVP_LIST* list, str data)
{
	return
	Rf_add_avp_list(list,
		data.s,data.len,
		AVP_IMS_Event,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
Example #6
0
/** 
 * Creates and adds Expires AVP to an AVP list 
 * @param list - the AVP list to add to.
 * @param data - the value for the AVP payload. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_expires(AAA_AVP_LIST* list, unsigned int data)
{
	char x[4];
	set_4bytes(x, data);
	
	
	return
	Rf_add_avp_list(list,
		x,4,
		AVP_IMS_Expires,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
Example #7
0
/** 
 * Creates and adds Node-Functionality AVP to an AVP list. 
 * @param list - the AVP list to add to. 
 * @param data - the value for the AVP payload.
 * @return 1 on success or 0 on error 
 */
inline int Rf_add_node_functionality(AAA_AVP_LIST* list, unsigned int data)
{
	char x[4];
	set_4bytes(x, data);
	
	
	return
	Rf_add_avp_list(list,
		x,4,
		AVP_IMS_Node_Functionality,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
Example #8
0
/** 
 * Creates and adds Event-Type AVP to an AVP list. 
 *
 * @param outl - points at this Event-Type AVP.
 * @param inl - AVPs list containing member AVPs. 
 * @return 1 on successs or 0 on error
 */
inline int Rf_add_event_type(AAA_AVP_LIST* outl, AAA_AVP_LIST* inl)
{
	str group;
	
	group = cdpb.AAAGroupAVPS(*inl);
	cdpb.AAAFreeAVPList(inl);
	
	return 
	Rf_add_avp_list(outl,
		group.s, group.len,
		AVP_IMS_Event_Type,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_FREE_DATA,
		__FUNCTION__);
}