[sr-dev] [kamailio/kamailio] ims_auth: compiler warnings (#658)
Victor Seva
notifications at github.com
Mon Jun 6 11:22:03 CEST 2016
I just notice that cxdx_avp.[c|h] are (almost) duplicated
```
--- modules/ims_auth/cxdx_avp.h 2016-06-06 09:21:19.924637959 +0200
+++ modules/ims_registrar_scscf/cxdx_avp.h 2016-04-26 11:02:03.508105795 +0200
@@ -53,6 +53,7 @@
struct AAA_AVP;
struct sip_msg;
+inline int cxdx_add_call_id(AAAMessage *msg, str data);
/**
* Creates and adds a Destination-Realm AVP.
* @param msg - the Diameter message to add to.
@@ -62,14 +63,6 @@
inline int cxdx_add_destination_realm(AAAMessage *msg, str data);
/**
- * Creates and adds a Destination-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 cxdx_add_destination_host(AAAMessage *msg,str data);
-
-/**
* Creates and adds a Vendor-Specifig-Application-ID AVP.
* @param msg - the Diameter message to add to.
* @param vendor_id - the value of the vendor_id,
```
```
--- modules/ims_auth/cxdx_avp.c 2016-06-06 11:04:40.971522168 +0200
+++ modules/ims_registrar_scscf/cxdx_avp.c 2016-04-26 11:02:03.508105795 +0200
@@ -44,7 +44,6 @@
*/
-
#include "../cdp/cdp_load.h"
#include "../../modules/tm/tm_load.h"
#include "cxdx_avp.h"
@@ -136,47 +135,42 @@
avp = cdpb.AAAFindMatchingAVP(msg,0,avp_code,vendor_id,0);
if (avp==0){
- LM_INFO("%s: Failed finding avp (avp_code = %d, vendor_id = %d)\n",func, avp_code, vendor_id);
+ LM_INFO("%s: Failed finding avp\n",func);
return r;
}
else
return avp->data;
}
-/**
- * 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 cxdx_add_destination_realm(AAAMessage *msg,str data)
+inline int cxdx_add_call_id(AAAMessage *msg, str data)
{
- return
+ return
cxdx_add_avp(msg,data.s,data.len,
- AVP_Destination_Realm,
- AAA_AVP_FLAG_MANDATORY,
- 0,
+ AVP_Call_Id,
+ AAA_AVP_FLAG_VENDOR_SPECIFIC,
+ 50,
AVP_DUPLICATE_DATA,
__FUNCTION__);
}
/**
- * Creates and adds a Destination-Host AVP.
+ * 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 cxdx_add_destination_host(AAAMessage *msg,str data)
+inline int cxdx_add_destination_realm(AAAMessage *msg,str data)
{
return
cxdx_add_avp(msg,data.s,data.len,
- AVP_Destination_Host,
+ AVP_Destination_Realm,
AAA_AVP_FLAG_MANDATORY,
0,
AVP_DUPLICATE_DATA,
__FUNCTION__);
}
+
/**
* Creates and adds a Vendor-Specifig-Application-ID AVP.
* @param msg - the Diameter message to add to.
@@ -658,7 +652,7 @@
avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number,
IMS_vendor_id_3GPP,0);
- if (!avp||avp->data.len!=4) *item_number=0;
+ if (!avp||!avp->data.len==4) *item_number=0;
else *item_number = get_4bytes(avp->data.s);
avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme,
```
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/658#issuecomment-223908702
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160606/95147804/attachment.html>
More information about the sr-dev
mailing list