- include gqpolicy.xml properly!

- print more specific console disgnostics when AVPs don't match because of vendorID being different

svn path=/trunk/; revision=22142
This commit is contained in:
Martin Mathieson 2007-06-20 14:40:40 +00:00
parent abae311a58
commit 6949e0d231
2 changed files with 35 additions and 20 deletions

View File

@ -1740,4 +1740,5 @@ Note: The AVP codes from 1263 to 1299 are reserved for TS 32.299
&imscxdx;
&TGPPSh;
&sip;
&gqpolicy;
</dictionary>

View File

@ -1143,31 +1143,45 @@ diameter_avp_get_name(guint32 avpCode, guint32 vendorId, gboolean *AVPFound)
*AVPFound = TRUE; /* will set to FALSE only if fail to match */
if (vendorId)
vendorName = diameter_vendor_to_str(vendorId, FALSE);
vendorName = diameter_vendor_to_str(vendorId, FALSE);
for (probe=avpListHead; probe; probe=probe->next) {
if (avpCode == probe->code) {
if (vendorId) {
/* g_warning("AvpName: Comparing \"%s\" to \"%s\"", */
/* vendorName?vendorName:"(null)", */
/* probe->vendorName?probe->vendorName:"(null)"); */
/* Now check the vendor name */
if (probe->vendorName && (!strcmp(vendorName, probe->vendorName)))
/* We found it! */
return probe->name;
} else {
/* No Vendor ID -- vendorName should be null */
if (!probe->vendorName)
/* We found it! */
return probe->name;
}
}
if (avpCode == probe->code) {
if (vendorId) {
/* Now check the vendor name */
if (probe->vendorName && (!strcmp(vendorName, probe->vendorName)))
/* We found it! */
return probe->name;
else {
/* Print explanation */
if (!suppress_console_output) {
g_warning("AVP %u: Found vendor name (%s) didn't match definition (%s)",
avpCode,
vendorName ? vendorName : "(null)",
probe->vendorName ? probe->vendorName : "(null)");
}
}
}
else {
/* No Vendor ID -- vendorName should be null */
if (!probe->vendorName)
/* We found it! */
return probe->name;
else {
/* Print explanation */
if (!suppress_console_output) {
g_warning("AVP %u: No vendorId found in AVP, but definition has one (%s)",
avpCode, probe->vendorName ? probe->vendorName : "(null)");
}
}
}
}
}
if ( suppress_console_output == FALSE )
g_warning("Diameter: Unable to find name for AVP 0x%08x, Vendor %u!",
avpCode, vendorId);
g_warning("Diameter: Unable to find name for AVP 0x%08x (%u), Vendor %u!",
avpCode, avpCode, vendorId);
/* If we don't find it, build a name string */
/* If we don't find it, build & return an error name string */
buffer=ep_alloc(64);
g_snprintf(buffer, 64, "Unknown AVP:0x%08x (%d)", avpCode, avpCode);
*AVPFound = FALSE;