コード例 #1
0
ファイル: rf_avp.c プロジェクト: asyn/openvims
/**
 * Creates and adds a Destination-Realm AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_destination_realm(AAAMessage *msg, str data)
{
	return 
	Rf_add_avp(msg,data.s,data.len,
		AVP_Destination_Realm,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #2
0
ファイル: rf_avp.c プロジェクト: asyn/openvims
/**
 * Create and adds a Service-Context-Id AVP. 
 *
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_service_context_id(AAAMessage *msg, str data)
{
	return
	Rf_add_avp(msg, data.s, data.len,
		AVP_Service_Context_Id,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #3
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * Creates and adds an Accounting Record Number AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_Accounting_Record_Number(AAAMessage *msg, str data)
{
	return 
	Rf_add_avp(msg,data.s,data.len,
		AVP_Accounting_Record_Number,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #4
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
inline int Rf_add_user(AAAMessage *msg, str data)
{
	return
	Rf_add_avp(msg,data.s,data.len,
		AVP_User_Name,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #5
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * Creates and adds a Origin Host AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_origin_host(AAAMessage *msg, str data)
{
	return 
	Rf_add_avp(msg,data.s,data.len,
		AVP_Origin_Host,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #6
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * Creates and adds a Session ID AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */  
inline int Rf_add_Session_Id(AAAMessage *msg, str data)
{
	return 
	Rf_add_avp(msg,data.s,data.len,
		AVP_Session_Id,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #7
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * Creates and adds a Result-Code AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_result_code(AAAMessage *msg,unsigned int data)
{
	char x[4];
	set_4bytes(x,data);
	return 
	Rf_add_avp(msg,x,4,
		AVP_Result_Code,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #8
0
ファイル: rf_avp.c プロジェクト: asyn/openvims
/**
 * Creates and adds a Accounting-Number-Type AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 * 
 * TODO should be added by base protocol
 */
inline int Rf_add_accounting_record_number(AAAMessage* msg, unsigned int data)
{
	char x[4];
	set_4bytes(x,data);
	
	return
	Rf_add_avp(msg, x, 4,
		AVP_Accounting_Record_Number,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
}
コード例 #9
0
ファイル: rf_avp.c プロジェクト: asyn/openvims
/**
 * Creates and adds an Acct-Application-Id AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @return 1 on success or 0 on error
 */
inline int Rf_add_acct_application_id(AAAMessage *msg, unsigned int data)
{
	char x[4];
	set_4bytes(x, data);	

	return
	Rf_add_avp(msg, x, 4,
			AVP_Acct_Application_Id,
			AAA_AVP_FLAG_MANDATORY,
			0,
			AVP_DUPLICATE_DATA,
			__FUNCTION__);
}
コード例 #10
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * Creates and adds a persec_credit AVP.
 * @param msg - the Diameter message to add to.
 * @param data - the value for the AVP payload
 * @returns 1 on success or 0 on error
 */
inline int Rf_add_Credit_persec(AAAMessage *msg, unsigned int data)
{
	char x[4];
	set_4bytes(x,data);
	return 
	Rf_add_avp(msg,x,4,
		AVP_Credit_persec,
		AAA_AVP_FLAG_MANDATORY,
		0,
		AVP_DUPLICATE_DATA,
		__FUNCTION__);
	
}
コード例 #11
0
ファイル: rf_avp.c プロジェクト: WindyCitySDR/uctimscharging
/**
 * 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__);
}
コード例 #12
0
ファイル: rf_avp.c プロジェクト: asyn/openvims
/** 
 * Creates and adds Service-Information AVP to a Diameter msg 
 *
 * @param msg - the Diameter message to add to.
 * @param list - point at a list of AVPs 
 * @returns 1 on success or = on error
 */
inline int Rf_add_service_information(AAAMessage* msg, AAA_AVP_LIST* list)
{
	str group;
	
	group = cdpb.AAAGroupAVPS(*list);
	cdpb.AAAFreeAVPList(list);
	
	return
	Rf_add_avp(msg,group.s,group.len,
		AVP_IMS_Service_Information,
		AAA_AVP_FLAG_MANDATORY,
		IMS_vendor_id_3GPP,
		AVP_FREE_DATA,
		__FUNCTION__);
}