From Olivier Jacques:
- Add a configuration option for Diameter version. Currently, the choice is between everything before draft-v16 and RFC3588. - Fix diameter-ip-address parsing depending on the Diameter version (and showing decoding errors accordingly). - Change registration of Diameter from TCP and SCTP port 1812 to TCP and SCTP port 3868 (this is according to RFC3588, section 11.5). svn path=/trunk/; revision=12121
This commit is contained in:
parent
0591bac4d2
commit
7c7c04cc84
1
AUTHORS
1
AUTHORS
|
@ -2285,6 +2285,7 @@ Thomas Palmer <tpalmer [AT] elmore.rr.com>
|
|||
Mårten Svantesson <f95-msv [AT] f.kth.se>
|
||||
Thomas Boehne <TBoehne [AT] ADwin.de>
|
||||
packet steve <packetsteve [AT] hotmail.com>
|
||||
Olivier Jacques <olivier.jacques [AT] hp.com>
|
||||
|
||||
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
|
||||
give his permission to use his version of snprintf.c.
|
||||
|
|
|
@ -96,6 +96,7 @@ static value_string diameter_vendor_specific_vendors[]= {
|
|||
{0, "None"},
|
||||
{5, "ACC"},
|
||||
{9, "Cisco"},
|
||||
{11, "Hewlett Packard"},
|
||||
{42, "Sun Microsystems"},
|
||||
{166, "Shiva"},
|
||||
{307, "Livingston"},
|
||||
|
@ -235,6 +236,34 @@ static value_string diameter_tunnel_medium_type_vals[]= {
|
|||
{15,"E-164-NSAP"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
static value_string diameter_avp_data_addrfamily_vals[]= {
|
||||
{1,"IPv4"},
|
||||
{2,"IPv6"},
|
||||
{3,"NSAP"},
|
||||
{4,"HDLC"},
|
||||
{5,"BBN"},
|
||||
{6,"IEEE-802"},
|
||||
{7,"E-163"},
|
||||
{8,"E-164"},
|
||||
{9,"F-69"},
|
||||
{10,"X-121"},
|
||||
{11,"IPX"},
|
||||
{12,"Appletalk"},
|
||||
{13,"Decnet4"},
|
||||
{14,"Vines"},
|
||||
{15,"E-164-NSAP"},
|
||||
{16,"DNS"},
|
||||
{17,"DistinguishedName"},
|
||||
{18,"AS"},
|
||||
{19,"XTPoIPv4"},
|
||||
{20,"XTPoIPv6"},
|
||||
{21,"XTPNative"},
|
||||
{22,"FibrePortName"},
|
||||
{23,"FibreNodeName"},
|
||||
{24,"GWID"},
|
||||
{0,NULL}
|
||||
};
|
||||
/*
|
||||
*Values for RADIUS Attribute 101, Error-Cause Attribute [RFC3576]:
|
||||
*/
|
||||
|
@ -625,7 +654,7 @@ static struct old_avp_info old_diameter_avps[] = {
|
|||
{ 277, "Auth-Session-State", DIAMETER_ENUMERATED, diameter_auth_session_state_vals},
|
||||
{ 285, "Re-Auth-Request-Type", DIAMETER_ENUMERATED, diameter_re_auth_request_type_vals},
|
||||
{ 293, "Destination-Host", DIAMETER_IDENTITY, (value_string *)NULL},
|
||||
{ 283, "Desintation-Realm", DIAMETER_UTF8STRING, (value_string *)NULL},
|
||||
{ 283, "Destination-Realm", DIAMETER_UTF8STRING, (value_string *)NULL},
|
||||
{ 273, "Disconnect-Cause", DIAMETER_ENUMERATED, diameter_disconnect_cause_vals},
|
||||
{ 281, "Error-Message", DIAMETER_UTF8STRING, (value_string *)NULL},
|
||||
{ 294, "Error-Reporting-Host", DIAMETER_IDENTITY, (value_string *)NULL},
|
||||
|
@ -801,6 +830,17 @@ static value_string diameter_command_code_vals[] = {
|
|||
{0, (char *)NULL}
|
||||
};
|
||||
|
||||
/* stuff for supporting multiple versions */
|
||||
typedef enum {
|
||||
DIAMETER_V16,
|
||||
DIAMETER_RFC
|
||||
} Version_Type;
|
||||
|
||||
static enum_val_t options[] = {
|
||||
{ "draft-16", "Diameter base draft version 16 and below", DIAMETER_V16 },
|
||||
{ "rfc3588", "Diameter base RFC 3588 ", DIAMETER_RFC },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
* http://www.ietf.org/internet-drafts/draft-ietf-aaa-diameter-mobileip-16.txt
|
||||
* http://www.ietf.org/internet-drafts/draft-ietf-aaa-diameter-sip-app-01.txt
|
||||
* http://www.ietf.org/html.charters/aaa-charter.html
|
||||
*/
|
||||
* http://www.iana.org/assignments/address-family-numbers
|
||||
* http://www.iana.org/assignments/enterprise-numbers
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
@ -166,8 +168,8 @@ static ApplicationId *ApplicationIdHead=NULL;
|
|||
|
||||
#define NTP_TIME_DIFF (2208988800UL)
|
||||
|
||||
#define TCP_PORT_DIAMETER 1812
|
||||
#define SCTP_PORT_DIAMETER 1812
|
||||
#define TCP_PORT_DIAMETER 3868
|
||||
#define SCTP_PORT_DIAMETER 3868
|
||||
|
||||
static const true_false_string reserved_set = {
|
||||
"*** Error! Reserved Bit is Set",
|
||||
|
@ -211,6 +213,7 @@ static int hf_diameter_avp_data_uint64 = -1;
|
|||
static int hf_diameter_avp_data_int64 = -1;
|
||||
static int hf_diameter_avp_data_bytes = -1;
|
||||
static int hf_diameter_avp_data_string = -1;
|
||||
static int hf_diameter_avp_data_addrfamily = -1;
|
||||
static int hf_diameter_avp_data_v4addr = -1;
|
||||
static int hf_diameter_avp_data_v6addr = -1;
|
||||
static int hf_diameter_avp_data_time = -1;
|
||||
|
@ -283,6 +286,8 @@ typedef struct _e_avphdr {
|
|||
#define MIN_AVP_SIZE (sizeof(e_avphdr) - sizeof(guint32))
|
||||
#define MIN_DIAMETER_SIZE (sizeof(e_diameterhdr))
|
||||
|
||||
static Version_Type gbl_version = DIAMETER_RFC;
|
||||
|
||||
static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
||||
|
||||
|
||||
|
@ -1567,6 +1572,9 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
|
|||
}
|
||||
break;
|
||||
case DIAMETER_IP_ADDRESS:
|
||||
{
|
||||
switch(gbl_version) {
|
||||
case DIAMETER_V16:
|
||||
if (avpDataLength == 4) {
|
||||
proto_tree_add_item(avpi_tree, hf_diameter_avp_data_v4addr,
|
||||
tvb, offset, avpDataLength, FALSE);
|
||||
|
@ -1577,7 +1585,28 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
|
|||
proto_tree_add_bytes_format(avpi_tree, hf_diameter_avp_data_bytes,
|
||||
tvb, offset, avpDataLength,
|
||||
tvb_get_ptr(tvb, offset, avpDataLength),
|
||||
"Error! Bad Address Length");
|
||||
"Error! Bad Address Length (Address in RFC3588 format?)");
|
||||
}
|
||||
break;
|
||||
case DIAMETER_RFC:
|
||||
/* Indicate the address family */
|
||||
proto_tree_add_item(avpi_tree, hf_diameter_avp_data_addrfamily,
|
||||
tvb, offset, 2, FALSE);
|
||||
if (tvb_get_ntohs(tvb, offset) == 0x0001) {
|
||||
proto_tree_add_item(avpi_tree, hf_diameter_avp_data_v4addr,
|
||||
tvb, offset+2, avpDataLength-2, FALSE);
|
||||
} else if (tvb_get_ntohs(tvb, offset) == 0x0002) {
|
||||
proto_tree_add_item(avpi_tree, hf_diameter_avp_data_v6addr,
|
||||
tvb, offset+2, avpDataLength-2, FALSE);
|
||||
} else {
|
||||
proto_tree_add_bytes_format(avpi_tree, hf_diameter_avp_data_bytes,
|
||||
tvb, offset, avpDataLength,
|
||||
tvb_get_ptr(tvb, offset, avpDataLength),
|
||||
"Error! Can't Parse Address Family %d (Address in draft v16 format?)",
|
||||
(int)tvb_get_ntohs(tvb, offset));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1877,6 +1906,9 @@ proto_register_diameter(void)
|
|||
{ &hf_diameter_avp_data_string,
|
||||
{ "Value","diameter.avp.data.string", FT_STRING, BASE_NONE,
|
||||
NULL, 0x0, "", HFILL }},
|
||||
{ &hf_diameter_avp_data_addrfamily,
|
||||
{ "Address Family","diameter.avp.data.addrfamily", FT_UINT16, BASE_DEC,
|
||||
VALS(diameter_avp_data_addrfamily_vals), 0x0, "", HFILL }},
|
||||
{ &hf_diameter_avp_data_v4addr,
|
||||
{ "IPv4 Address","diameter.avp.data.v4addr", FT_IPv4, BASE_NONE,
|
||||
NULL, 0x0, "", HFILL }},
|
||||
|
@ -1908,6 +1940,9 @@ proto_register_diameter(void)
|
|||
/* Register a configuration option for port */
|
||||
diameter_module = prefs_register_protocol(proto_diameter,
|
||||
proto_reg_handoff_diameter);
|
||||
/* Register a configuration option for Diameter version */
|
||||
prefs_register_enum_preference(diameter_module, "version", "Diameter version", "Standard version used for decoding", (gint *)&gbl_version, options, FALSE);
|
||||
|
||||
prefs_register_uint_preference(diameter_module, "tcp.port",
|
||||
"Diameter TCP Port",
|
||||
"Set the TCP port for Diameter messages",
|
||||
|
|
Loading…
Reference in New Issue