diff options
author | Anders Broman <anders.broman@ericsson.com> | 2005-09-26 05:43:25 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2005-09-26 05:43:25 +0000 |
commit | 25fe588f9f57e4cf5455a8ce7f3e824cfe5b8e14 (patch) | |
tree | 16b4d6e4eaf56e4dd3c4296c4a5b5b65571a4ce5 /epan/dissectors/packet-stun.c | |
parent | fa1647d9a65cead2dc151b4ed8636994bd45bcd8 (diff) |
From Martin Mathieson:
stun - add support for 3 extra Message Attributes as described in draft-ietf-behave-rfc3489bis-00
ymsg
- avoid looking beyond the tvb while looking for content item delimiters (causing most frames to be shown as malformed packet)
- makes content items (and their keys and values) filterable (includes fix to bug 415)
svn path=/trunk/; revision=16005
Diffstat (limited to 'epan/dissectors/packet-stun.c')
-rw-r--r-- | epan/dissectors/packet-stun.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index 5bdf225198..6fd1f95d54 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -23,6 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Please refer to RFC 3489 for protocol detail. + * (supports extra message attributes described in draft-ietf-behave-rfc3489bis-00) */ #ifdef HAVE_CONFIG_H @@ -57,6 +58,9 @@ static int stun_att_unknown = -1; static int stun_att_error_class = -1; static int stun_att_error_number = -1; static int stun_att_error_reason = -1; +static int stun_att_server_string = -1; +static int stun_att_xor_ip = -1; +static int stun_att_xor_port = -1; @@ -80,6 +84,9 @@ static int stun_att_error_reason = -1; #define ERROR_CODE 0x0009 #define UNKNOWN_ATTRIBUTES 0x000a #define REFLECTED_FROM 0x000b +#define XOR_MAPPED_ADDRESS 0x0020 +#define XOR_ONLY 0x0021 +#define SERVER 0x0022 @@ -123,6 +130,9 @@ static const value_string attributes[] = { {MESSAGE_INTEGRITY, "MESSAGE-INTEGRITY"}, {ERROR_CODE, "ERROR-CODE"}, {REFLECTED_FROM, "REFLECTED-FROM"}, + {XOR_MAPPED_ADDRESS, "XOR-MAPPED-ADDRESS"}, + {XOR_ONLY, "XOR_ONLY"}, + {SERVER, "SERVER"}, {0x00, NULL} }; @@ -273,6 +283,22 @@ dissect_stun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } break; + case SERVER: + proto_tree_add_item(att_tree, stun_att_server_string, tvb, offset, att_length, FALSE); + break; + + case XOR_MAPPED_ADDRESS: + if (att_length < 2) + break; + proto_tree_add_item(att_tree, stun_att_family, tvb, offset+1, 1, FALSE); + if (att_length < 4) + break; + proto_tree_add_item(att_tree, stun_att_xor_port, tvb, offset+2, 2, FALSE); + if (att_length < 8) + break; + proto_tree_add_item(att_tree, stun_att_xor_ip, tvb, offset+4, 4, FALSE); + break; + default: break; } @@ -366,6 +392,18 @@ proto_register_stun(void) { "Error Reason Phase","stun.att.error.reason", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL} }, + { &stun_att_xor_ip, + { "IP (XOR-d)", "stun.att.ip-xord", FT_IPv4, + BASE_NONE, NULL, 0x0, "", HFILL } + }, + { &stun_att_xor_port, + { "Port (XOR-d)", "stun.att.port-xord", FT_UINT16, + BASE_DEC, NULL, 0x0, "", HFILL } + }, + { &stun_att_server_string, + { "Server version","stun.att.server", FT_STRING, + BASE_NONE, NULL, 0x0, "", HFILL} + }, }; /* Setup protocol subtree array */ |