diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-09-04 19:12:38 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-09-04 19:12:38 +0000 |
commit | 7826e4db4a53b066882a67871f17126b97f00923 (patch) | |
tree | dac62a0d1dab173f7e30d7b590f41d4f542f143a /packet-wsp.c | |
parent | d4c497557154b77ef54644394c8a31ef2464a6e3 (diff) |
From Olivier Biot: decode the Push-Flag WSP header.
svn path=/trunk/; revision=8376
Diffstat (limited to 'packet-wsp.c')
-rw-r--r-- | packet-wsp.c | 87 |
1 files changed, 86 insertions, 1 deletions
diff --git a/packet-wsp.c b/packet-wsp.c index 6cdf046a2a..09b3949a71 100644 --- a/packet-wsp.c +++ b/packet-wsp.c @@ -2,7 +2,7 @@ * * Routines to dissect WSP component of WAP traffic. * - * $Id: packet-wsp.c,v 1.75 2003/09/02 22:47:57 guy Exp $ + * $Id: packet-wsp.c,v 1.76 2003/09/04 19:12:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -151,6 +151,11 @@ static int hf_wsp_header_via = HF_EMPTY; static int hf_wsp_header_wap_application_id = HF_EMPTY; static int hf_wsp_header_wap_application_id_str = HF_EMPTY; +/* Push-specific WSP headers */ +static int hf_wsp_header_push_flag = HF_EMPTY; +static int hf_wsp_header_push_flag_auth = HF_EMPTY; +static int hf_wsp_header_push_flag_trust = HF_EMPTY; +static int hf_wsp_header_push_flag_last = HF_EMPTY; /* Openwave-specific WSP headers */ static int hf_wsp_header_openwave_proxy_push_addr = HF_EMPTY; @@ -215,6 +220,7 @@ static gint ett_redirect_afl = ETT_EMPTY; static gint ett_multiparts = ETT_EMPTY; static gint ett_mpartlist = ETT_EMPTY; static gint ett_header_credentials = ETT_EMPTY; +static gint ett_push_flags = ETT_EMPTY; /* Handle for WSP-over-UDP dissector */ static dissector_handle_t wsp_fromudp_handle; @@ -971,6 +977,12 @@ static const true_false_string yes_no_truth = { "No" }; +static const value_string vals_false_true[] = { + { 0, "False" }, + { 1, "True" }, + { 0, NULL }, +}; + /* * Windows appears to define DELETE. */ @@ -1064,6 +1076,9 @@ static void add_credentials_value_header (proto_tree *tree, tvbuff_t *header_buff, int headerLen, tvbuff_t *value_buff, value_type_t valueType, int valueLen, int hf_main, int hf_scheme, int hf_basic_user_id, int hf_basic_password); +static void add_push_flag_header (proto_tree *tree, + tvbuff_t *header_buff, int headerLen, tvbuff_t *value_buff, + value_type_t valueType, int valueLen); static void add_capabilities (proto_tree *tree, tvbuff_t *tvb, int type); static void add_capability_vals(tvbuff_t *, gboolean, int, guint, guint, char *, size_t); static value_type_t get_value_type_len (tvbuff_t *, int, guint *, int *, int *); @@ -1948,6 +1963,11 @@ add_well_known_header (proto_tree *tree, tvbuff_t *tvb, int offset, value_buff, valueType, valueLen, hf_wsp_header_content_ID, headerType); break; + + case FN_PUSH_FLAG: /* Push-Flag */ + add_push_flag_header (tree, header_buff, headerLen, + value_buff, valueType, valueLen); + break; case FN_AUTHORIZATION: /* Authorization */ add_credentials_value_header (tree, header_buff, headerLen, @@ -3104,6 +3124,42 @@ add_credentials_value_header (proto_tree *tree, tvbuff_t *header_buff, return; } + +static void +add_push_flag_header (proto_tree *tree, tvbuff_t *header_buff, + int headerLen, tvbuff_t *value_buff, value_type_t valueType, + int valueLen) +{ + proto_item *ti = NULL; + proto_tree *subtree = NULL; + + if (valueType == VALUE_IN_LEN) { + valueLen &= 0x7F; /* Clear highest bit */ + ti = proto_tree_add_uint (tree, hf_wsp_header_push_flag, + header_buff, 0, headerLen, valueLen); + subtree = proto_item_add_subtree (ti, ett_push_flags); + proto_tree_add_uint (subtree, hf_wsp_header_push_flag_auth, + value_buff, 1, 1, valueLen); + proto_tree_add_uint (subtree, hf_wsp_header_push_flag_trust, + value_buff, 1, 1, valueLen); + proto_tree_add_uint (subtree, hf_wsp_header_push_flag_last, + value_buff, 1, 1, valueLen); + if (valueLen & 0x01) + proto_item_append_text (ti, " (Initiator URI authenticated)"); + if (valueLen & 0x02) + proto_item_append_text (ti, " (Content trusted)"); + if (valueLen & 0x04) + proto_item_append_text (ti, " (Last push message)"); + if (valueLen & 0x78) + proto_item_append_text (ti, " - Reserved flags set"); + } else { + proto_tree_add_text (tree, header_buff, 0, headerLen, + "Push-Flag: (Invalid header value format)"); + } + return; +} + + static void add_capabilities (proto_tree *tree, tvbuff_t *tvb, int type) { @@ -4920,6 +4976,34 @@ proto_register_wsp(void) "Profile", HFILL } }, + { &hf_wsp_header_push_flag, + { "Push-Flag", + "wsp.header.push_flag", + FT_UINT8, BASE_HEX, NULL, 0x00, + "Push-Flag (OTA-WSP header)", HFILL + } + }, + { &hf_wsp_header_push_flag_auth, + { "Initiator URI is authenticated", + "wsp.header.push_flag.authenticated", + FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x01, + "The X-Wap-Initiator-URI has been authenticated.", HFILL + } + }, + { &hf_wsp_header_push_flag_trust, + { "Content is trusted", + "wsp.header.push_flag.trusted", + FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x02, + "The push content is trusted.", HFILL + } + }, + { &hf_wsp_header_push_flag_last, + { "Last push message", + "wsp.header.push_flag.last", + FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x04, + "Indicates whether this is the last push message.", HFILL + } + }, { &hf_wsp_header_server, { "Server", "wsp.header.server", @@ -5215,6 +5299,7 @@ proto_register_wsp(void) &ett_multiparts, &ett_mpartlist, &ett_header_credentials, + &ett_push_flags, }; /* Register the protocol name and description */ |