diff options
author | AndersBroman <anders.broman@ericsson.com> | 2017-12-19 09:47:21 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-12-19 12:16:39 +0000 |
commit | 5b596fa871b58948dacd18859dad61e692ab973e (patch) | |
tree | 193af2678ff9c052453981b0ee6c6ff314a814ee | |
parent | 4db038aa28023867dcdae403d79b0a0b5506e991 (diff) |
[SIP] Add dissection of oc-seq as time stamp.
Change-Id: I0273f8bff7693a7dc7416932649c083c360bc098
Reviewed-on: https://code.wireshark.org/review/24890
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-sip.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 06e6e077ec..f1cbd28abe 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -200,6 +200,7 @@ static gint hf_sip_via_oc_val = -1; static gint hf_sip_via_oc_algo = -1; static gint hf_sip_via_oc_validity = -1; static gint hf_sip_via_oc_seq = -1; +static gint hf_sip_oc_seq_timestamp = -1; static gint hf_sip_rack_rseq_no = -1; static gint hf_sip_rack_cseq_no = -1; @@ -2754,15 +2755,15 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o if (equals_found) { proto_tree_add_item(tree, *(via_parameter->hf_item), tvb, - parameter_name_end+1, current_offset-parameter_name_end-1, - ENC_UTF_8|ENC_NA); + parameter_name_end + 1, current_offset - parameter_name_end - 1, + ENC_UTF_8 | ENC_NA); - if (sip_via_branch_handle && g_ascii_strcasecmp (param_name, "branch") == 0) + if (sip_via_branch_handle && g_ascii_strcasecmp(param_name, "branch") == 0) { tvbuff_t *next_tvb; next_tvb = tvb_new_subset_length_caplen(tvb, parameter_name_end + 1, current_offset - parameter_name_end - 1, current_offset - parameter_name_end - 1); - call_dissector (sip_via_branch_handle, next_tvb, pinfo, tree); + call_dissector(sip_via_branch_handle, next_tvb, pinfo, tree); } else if (g_ascii_strcasecmp(param_name, "oc") == 0) { proto_item *ti; @@ -2773,6 +2774,24 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o (guint32)strtoul(value, NULL, 10)); PROTO_ITEM_SET_GENERATED(ti); } + else if (g_ascii_strcasecmp(param_name, "oc-seq") == 0) { + proto_item *ti; + nstime_t ts; + int dec_p_off = tvb_find_guint8(tvb, parameter_name_end + 1, - 1, '.'); + char *value; + + if(dec_p_off > 0){ + value = tvb_get_string_enc(wmem_packet_scope(), tvb, + parameter_name_end + 1, dec_p_off - parameter_name_end, ENC_UTF_8 | ENC_NA); + ts.secs = (guint32)strtoul(value, NULL, 10); + value = tvb_get_string_enc(wmem_packet_scope(), tvb, + dec_p_off + 1, current_offset - parameter_name_end - 1, ENC_UTF_8 | ENC_NA); + ts.nsecs = (guint32)strtoul(value, NULL, 10) * 1000; + ti = proto_tree_add_time(tree, hf_sip_oc_seq_timestamp, tvb, + parameter_name_end + 1, current_offset - parameter_name_end - 1, &ts); + PROTO_ITEM_SET_GENERATED(ti); + } + } } else { @@ -6851,6 +6870,12 @@ void proto_register_sip(void) FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_sip_oc_seq_timestamp, + { "Overload Control Sequence Time Stamp", + "sip.Via.oc_seq.ts", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, + NULL, HFILL } + }, { &hf_sip_via_oc_algo, { "Overload Control Algorithm", "sip.Via.oc_algo", FT_STRING, BASE_NONE, NULL, 0x0, |