diff options
Diffstat (limited to 'epan')
44 files changed, 222 insertions, 181 deletions
diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c index 4b7d0d7f76..ebe46b3174 100644 --- a/epan/dissectors/packet-adwin-config.c +++ b/epan/dissectors/packet-adwin-config.c @@ -355,11 +355,11 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, offset += 4; tmp_time.secs = tvb_get_ntohl(tvb, offset); proto_tree_add_text(adwin_tree, tvb, offset, 4, - "File time: %s", abs_time_to_ep_str(&tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); + "File time: %s", abs_time_to_str(wmem_packet_scope(), &tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); offset += 4; tmp_time.secs = tvb_get_ntohl(tvb, offset); proto_tree_add_text(adwin_tree, tvb, offset, 4, - "Update time: %s", abs_time_to_ep_str(&tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); + "Update time: %s", abs_time_to_str(wmem_packet_scope(), &tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); offset += 4; proto_tree_add_item(adwin_tree, hf_adwin_config_unused, tvb, offset, 128, ENC_NA); offset += 128; diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c index ef42d5f417..79cfcddf39 100644 --- a/epan/dissectors/packet-agentx.c +++ b/epan/dissectors/packet-agentx.c @@ -478,7 +478,7 @@ dissect_response_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint NORLEL(flags, r_uptime, tvb, offset); proto_tree_add_uint_format(subtree, hf_resp_uptime, tvb, offset, 4, r_uptime, - "sysUptime: %s", time_msecs_to_ep_str(r_uptime)); + "sysUptime: %s", time_msecs_to_str(wmem_packet_scope(), r_uptime)); proto_tree_add_item(subtree, hf_resp_error, tvb, offset + 4, 2, encoding); proto_tree_add_item(subtree, hf_resp_index, tvb, offset + 6, 2, encoding); offset += 8; diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index 328421dd51..54f3f520f0 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -1413,7 +1413,7 @@ bootp_handle_basic_types(packet_info *pinfo, proto_tree *tree, proto_item *item, if (hf != NULL) { time_s_secs = (gint32) tvb_get_ntohl(tvb, offset); proto_tree_add_int_format_value(tree, *hf, - tvb, offset, 4, time_s_secs, "(%ds) %s", time_s_secs, time_secs_to_ep_str(time_s_secs)); + tvb, offset, 4, time_s_secs, "(%ds) %s", time_s_secs, time_secs_to_str(wmem_packet_scope(), time_s_secs)); } else if (hf_default->time_in_s_secs != NULL) proto_tree_add_item(tree, *hf_default->time_in_s_secs, tvb, offset, 4, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-ccsds.c b/epan/dissectors/packet-ccsds.c index 13022c1e4d..bb11334b57 100644 --- a/epan/dissectors/packet-ccsds.c +++ b/epan/dissectors/packet-ccsds.c @@ -290,7 +290,7 @@ static const char* embedded_time_to_string ( int coarse_time, int fine_time ) fraction = ( multiplier * ( (int)fine_time & 0xff ) ) / 256; t.nsecs = fraction*1000000; /* msecs to nsecs */ - return abs_time_to_ep_str(&t, ABSOLUTE_TIME_DOY_UTC, TRUE); + return abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_DOY_UTC, TRUE); } diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c index 4ef7d0b78f..040384aefd 100644 --- a/epan/dissectors/packet-collectd.c +++ b/epan/dissectors/packet-collectd.c @@ -486,7 +486,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf, gchar *strtime; nstime = collectd_time_to_nstime (*ret_value); - strtime = abs_time_to_ep_str (&nstime, ABSOLUTE_TIME_LOCAL, /* show_zone = */ TRUE); + strtime = abs_time_to_str (wmem_packet_scope(), &nstime, ABSOLUTE_TIME_LOCAL, /* show_zone = */ TRUE); pi = proto_tree_add_text (tree_root, tvb, offset, length, "collectd %s segment: %s", val_to_str_const (type, part_names, "UNKNOWN"), @@ -498,7 +498,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf, gchar *strtime; nstime = collectd_time_to_nstime (*ret_value); - strtime = rel_time_to_ep_str (&nstime); + strtime = rel_time_to_str (wmem_packet_scope(), &nstime); pi = proto_tree_add_text (tree_root, tvb, offset, length, "collectd %s segment: %s", val_to_str_const (type, part_names, "UNKNOWN"), diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c index 1ff41b7791..b02eb2db66 100644 --- a/epan/dissectors/packet-dhcp-failover.c +++ b/epan/dissectors/packet-dhcp-failover.c @@ -454,7 +454,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da timex.nsecs = 0; proto_tree_add_time_format_value(dhcpfo_tree, hf_dhcpfo_time, tvb, offset, 4, &timex, "%s", - abs_time_secs_to_ep_str(timex.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(wmem_packet_scope(), timex.secs, ABSOLUTE_TIME_LOCAL, TRUE)); } offset += 4; @@ -650,7 +650,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da lease_expiration_time = tvb_get_ntohl(tvb, offset); lease_expiration_time_str = - abs_time_secs_to_ep_str(lease_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(wmem_packet_scope(), lease_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", lease_expiration_time_str); @@ -672,7 +672,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da tvb_get_ntohl(tvb, offset); potential_expiration_time_str = - abs_time_secs_to_ep_str(potential_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(wmem_packet_scope(), potential_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", potential_expiration_time_str); @@ -694,7 +694,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da tvb_get_ntohl(tvb, offset); grace_expiration_time_str = - abs_time_secs_to_ep_str(grace_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(wmem_packet_scope(), grace_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", grace_expiration_time_str); @@ -715,7 +715,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da client_last_transaction_time = tvb_get_ntohl(tvb, offset); client_last_transaction_time_str = - abs_time_secs_to_ep_str(client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(wmem_packet_scope(), client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", client_last_transaction_time_str); @@ -725,7 +725,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da offset, option_length, client_last_transaction_time, "%s", - abs_time_secs_to_ep_str(client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(wmem_packet_scope(), client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE)); break; case DHCP_FO_PD_START_TIME_OF_STATE: @@ -736,7 +736,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da start_time_of_state = tvb_get_ntohl(tvb, offset); start_time_of_state_str = - abs_time_secs_to_ep_str(start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(wmem_packet_scope(), start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", start_time_of_state_str); @@ -746,7 +746,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da offset, option_length, start_time_of_state, "%s", - abs_time_secs_to_ep_str(start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(wmem_packet_scope(), start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE)); break; case DHCP_FO_PD_SERVERSTATE: diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index e685c37842..7c106d2db6 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -2921,7 +2921,7 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, "%s", (subm_time & 0x7FFF) >= 0x7FF8 ? "Reserved" : - abs_time_secs_to_ep_str (dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE)); field_tree = proto_item_add_subtree (tf, ett_envelope_subm_time); proto_tree_add_item (field_tree, hf_envelope_time_diff_present, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item (field_tree, hf_envelope_subm_time_value, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -2939,7 +2939,7 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, if (secs == DMP_TIME_RESERVED) { proto_item_append_text (tf, "Reserved (0x%2.2x)", time_diff); } else { - proto_item_append_text (tf, "%s", time_secs_to_ep_str (secs)); + proto_item_append_text (tf, "%s", time_secs_to_str(wmem_packet_scope(), secs)); } offset += 1; } @@ -3251,9 +3251,9 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo, proto_item_append_text (tf, "Reserved (0x%2.2x)", report); proto_item_append_text (ei, " (Reserved)"); } else { - proto_item_append_text (tf, "%s (%s)", time_secs_to_ep_str (secs), - abs_time_secs_to_ep_str (dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); - proto_item_append_text (ei, " (%s from submission time)", time_secs_to_ep_str (secs)); + proto_item_append_text (tf, "%s (%s)", time_secs_to_str(wmem_packet_scope(), secs), + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text (ei, " (%s from submission time)", time_secs_to_str(wmem_packet_scope(), secs)); } } else { dmp.ndr = TRUE; @@ -3365,9 +3365,9 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, proto_item_append_text (tf, "Reserved (0x%2.2x)", rec_time); proto_item_append_text (ei, " (Reserved)"); } else { - proto_item_append_text (tf, "%s (%s)", time_secs_to_ep_str (secs), - abs_time_secs_to_ep_str (dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); - proto_item_append_text (ei, " (%s from submission time)", time_secs_to_ep_str (secs)); + proto_item_append_text (tf, "%s (%s)", time_secs_to_str(wmem_packet_scope(), secs), + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text (ei, " (%s from submission time)", time_secs_to_str(wmem_packet_scope(), secs)); } offset += 1; @@ -3766,9 +3766,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, proto_item_append_text (tf, "Reserved (0x%2.2x)", exp_time); proto_item_append_text (ei, " (Reserved)"); } else { - proto_item_append_text (tf, "%s (%s)", time_secs_to_ep_str (secs), - abs_time_secs_to_ep_str (dmp.subm_time + secs, ABSOLUTE_TIME_LOCAL, TRUE)); - proto_item_append_text (ei, " (%s from submission time)", time_secs_to_ep_str (secs)); + proto_item_append_text (tf, "%s (%s)", time_secs_to_str(wmem_packet_scope(), secs), + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time + secs, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text (ei, " (%s from submission time)", time_secs_to_str(wmem_packet_scope(), secs)); } offset += 1; } @@ -3788,13 +3788,13 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, proto_item_append_text (tf, "0 minutes in the %s (%s)", (dtg & 0x80) ? dtg_sign.true_string : dtg_sign.false_string, - abs_time_secs_to_ep_str (dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE)); } else { - proto_item_append_text (tf, "%s in the %s (%s)", time_secs_to_ep_str(secs), + proto_item_append_text (tf, "%s in the %s (%s)", time_secs_to_str(wmem_packet_scope(), secs), (dtg & 0x80) ? dtg_sign.true_string : dtg_sign.false_string, (dtg & 0x80) ? - abs_time_secs_to_ep_str (dmp.subm_time + secs, ABSOLUTE_TIME_LOCAL, TRUE) : - abs_time_secs_to_ep_str (dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time + secs, ABSOLUTE_TIME_LOCAL, TRUE) : + abs_time_secs_to_str (wmem_packet_scope(), dmp.subm_time - secs, ABSOLUTE_TIME_LOCAL, TRUE)); } offset += 1; } diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 9ad8787d68..2b2428be18 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -2087,7 +2087,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_bit = (al_ptflags & AL_OBJ_BI_FLAG7) >> 7; /* bit shift 1xxxxxxx -> xxxxxxx1 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_bit, abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2108,7 +2108,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_2bit = (al_ptflags >> 6) & 3; /* bit shift 11xxxxxx -> 00000011 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_2bit, abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_2bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2132,7 +2132,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_bit = (al_ptflags & AL_OBJ_BI_FLAG7) >> 7; /* bit shift 1xxxxxxx -> xxxxxxx1 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_bit, abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2370,7 +2370,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_FDCTRC_32T: case AL_OBJ_FDCTRC_16T: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; @@ -2486,7 +2486,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_AIFC_FLTT: case AL_OBJ_AIFC_DBLT: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; @@ -2566,7 +2566,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_AOC_FLTT: case AL_OBJ_AOC_DBLT: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_ep_str(&al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 82c9c8554e..7eff3e326d 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -1792,19 +1792,19 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, cur_offset += 4; ti_soa = proto_tree_add_item(rr_tree, hf_dns_soa_refresh_interval, tvb, cur_offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti_soa, " (%s)", time_secs_to_ep_str(tvb_get_ntohl(tvb, cur_offset))); + proto_item_append_text(ti_soa, " (%s)", time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, cur_offset))); cur_offset += 4; ti_soa = proto_tree_add_item(rr_tree, hf_dns_soa_retry_interval, tvb, cur_offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti_soa, " (%s)", time_secs_to_ep_str(tvb_get_ntohl(tvb, cur_offset))); + proto_item_append_text(ti_soa, " (%s)", time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, cur_offset))); cur_offset += 4; ti_soa = proto_tree_add_item(rr_tree, hf_dns_soa_expire_limit, tvb, cur_offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti_soa, " (%s)", time_secs_to_ep_str(tvb_get_ntohl(tvb, cur_offset))); + proto_item_append_text(ti_soa, " (%s)", time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, cur_offset))); cur_offset += 4; ti_soa = proto_tree_add_item(rr_tree, hf_dns_soa_minimum_ttl, tvb, cur_offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti_soa, " (%s)", time_secs_to_ep_str(tvb_get_ntohl(tvb, cur_offset))); + proto_item_append_text(ti_soa, " (%s)", time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, cur_offset))); } break; @@ -2867,7 +2867,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, rr_len -= 1; ti = proto_tree_add_item(rr_tree, hf_dns_rrsig_original_ttl, tvb, cur_offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s)", time_secs_to_ep_str(tvb_get_ntohl(tvb, cur_offset))); + proto_item_append_text(ti, " (%s)", time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, cur_offset))); cur_offset += 4; rr_len -= 4; diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 0a171bec31..a4448c8500 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -3019,7 +3019,7 @@ dissect_dvbci_payload_dt(guint32 tag, gint len_field, } else { col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, - "update every %s", rel_time_to_ep_str(&resp_intv)); + "update every %s", rel_time_to_str(wmem_packet_scope(), &resp_intv)); } } else if (tag==T_DATE_TIME) { @@ -3039,7 +3039,7 @@ dissect_dvbci_payload_dt(guint32 tag, gint len_field, proto_tree_add_time(tree, hf_dvbci_utc_time, tvb, offset, time_field_len, &utc_time); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s UTC", - abs_time_to_ep_str(&utc_time, ABSOLUTE_TIME_UTC, FALSE)); + abs_time_to_str(wmem_packet_scope(), &utc_time, ABSOLUTE_TIME_UTC, FALSE)); offset += time_field_len; if (len_field==7) { diff --git a/epan/dissectors/packet-goose.c b/epan/dissectors/packet-goose.c index 6336b31a26..8f922f8f79 100644 --- a/epan/dissectors/packet-goose.c +++ b/epan/dissectors/packet-goose.c @@ -502,7 +502,7 @@ dissect_goose_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ ts.secs = seconds; ts.nsecs = nanoseconds; - ptime = abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, TRUE); + ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE); if(hf_index >= 0) { diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 4fbf706c8e..ac9e91e4e5 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -974,7 +974,7 @@ de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint tv.nsecs = 0; proto_tree_add_time_format_value(tree, hf_gsm_a_dtap_time_zone_time, tvb, curr_offset, 6, - &tv, "%s", abs_time_to_ep_str(&tv, ABSOLUTE_TIME_LOCAL, FALSE)); + &tv, "%s", abs_time_to_str(wmem_packet_scope(), &tv, ABSOLUTE_TIME_LOCAL, FALSE)); curr_offset += 6; /* 3GPP TS 23.040 version 6.6.0 Release 6 diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 2cef13f582..1f7b8bbc62 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -1465,7 +1465,7 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data) "Address entry size: %u", addr_entry_size); proto_tree_add_text(icmp_tree, tvb, 6, 2, "Lifetime: %s", - time_secs_to_ep_str(tvb_get_ntohs + time_secs_to_str(wmem_packet_scope(), tvb_get_ntohs (tvb, 6))); break; @@ -1692,17 +1692,17 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data) get_best_guess_mstimeofday(tvb, 8, frame_ts); proto_tree_add_text(icmp_tree, tvb, 8, 4, "Originate timestamp: %s after midnight UTC", - time_msecs_to_ep_str(orig_ts)); + time_msecs_to_str(wmem_packet_scope(), orig_ts)); proto_tree_add_text(icmp_tree, tvb, 12, 4, "Receive timestamp: %s after midnight UTC", - time_msecs_to_ep_str - (get_best_guess_mstimeofday + time_msecs_to_str + (wmem_packet_scope(), get_best_guess_mstimeofday (tvb, 12, orig_ts))); proto_tree_add_text(icmp_tree, tvb, 16, 4, "Transmit timestamp: %s after midnight UTC", - time_msecs_to_ep_str - (get_best_guess_mstimeofday + time_msecs_to_str + (wmem_packet_scope(), get_best_guess_mstimeofday (tvb, 16, orig_ts))); } break; diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c index 8ad31a67d4..dc9b28260a 100644 --- a/epan/dissectors/packet-icq.c +++ b/epan/dissectors/packet-icq.c @@ -724,7 +724,7 @@ icqv5_cmd_login(proto_tree* tree, tvbuff_t *tvb, int offset) if (tree) { theTime = tvb_get_letohl(tvb, offset + CMD_LOGIN_TIME); - aTime = abs_time_secs_to_ep_str(theTime, ABSOLUTE_TIME_LOCAL, TRUE); + aTime = abs_time_secs_to_str(wmem_packet_scope(), theTime, ABSOLUTE_TIME_LOCAL, TRUE); proto_tree_add_text(subtree, tvb, offset + CMD_LOGIN_TIME, 4, "Time: %ld = %s", (long)theTime, aTime); port = tvb_get_letohl(tvb, offset + CMD_LOGIN_PORT); diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index c3c9b3a9f2..2a104e27e8 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -1083,7 +1083,7 @@ ipmi_add_timestamp(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset) time_secs_to_ep_str_unsigned(ts)); } else { proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4, - ts, "%s", abs_time_secs_to_ep_str(ts, ABSOLUTE_TIME_UTC, TRUE)); + ts, "%s", abs_time_secs_to_str(wmem_packet_scope(), ts, ABSOLUTE_TIME_UTC, TRUE)); } } diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c index 80b38bfc2c..b02ac279fb 100644 --- a/epan/dissectors/packet-ipp.c +++ b/epan/dissectors/packet-ipp.c @@ -504,7 +504,7 @@ add_integer_tree(proto_tree *tree, tvbuff_t *tvb, int offset, 1 + 2 + name_length + 2 + value_length, "%s: %s", format_text(name_val, name_length), - abs_time_secs_to_ep_str(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2), + abs_time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2), ABSOLUTE_TIME_LOCAL, TRUE)); diff --git a/epan/dissectors/packet-kismet.c b/epan/dissectors/packet-kismet.c index c711379e0f..5978d75c3c 100644 --- a/epan/dissectors/packet-kismet.c +++ b/epan/dissectors/packet-kismet.c @@ -244,7 +244,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da /* * Format ascii representaion of time */ - ptr = abs_time_secs_to_ep_str(t, ABSOLUTE_TIME_LOCAL, TRUE); + ptr = abs_time_secs_to_str(wmem_packet_scope(), t, ABSOLUTE_TIME_LOCAL, TRUE); proto_tree_add_text(reqresp_tree, tvb, offset, tokenlen, "Time: %s", ptr); } diff --git a/epan/dissectors/packet-lte-rrc.c b/epan/dissectors/packet-lte-rrc.c index fad45bd176..902ea13b6d 100644 --- a/epan/dissectors/packet-lte-rrc.c +++ b/epan/dissectors/packet-lte-rrc.c @@ -8546,8 +8546,8 @@ dissect_lte_rrc_T_synchronousSystemTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ bits = tvb_get_bits64(sync_system_time_tvb, 0, 39, ENC_BIG_ENDIAN); ts.secs = (time_t)(bits/100) + 315964800; /* CDMA2000 epoch is 00:00:00 (midnight) UTC on 1980-01-06 */ ts.nsecs = (int)(bits%100)*10000000; - proto_tree_add_text(subtree, sync_system_time_tvb, 0, -1, "CDMA time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, FALSE)); - proto_tree_add_text(subtree, sync_system_time_tvb, 0, -1, "Local time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_text(subtree, sync_system_time_tvb, 0, -1, "CDMA time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, FALSE)); + proto_tree_add_text(subtree, sync_system_time_tvb, 0, -1, "Local time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_LOCAL, TRUE)); } return offset; @@ -8571,8 +8571,8 @@ dissect_lte_rrc_T_asynchronousSystemTime(tvbuff_t *tvb _U_, int offset _U_, asn1 bits = tvb_get_bits64(async_system_time_tvb, 0, 49, ENC_BIG_ENDIAN); ts.secs = (time_t)((bits*8)/1228800) + 315964800; /* CDMA2000 epoch is 00:00:00 (midnight) UTC on 1980-01-06 */ ts.nsecs = (int)(((bits%153600)*8*1000000000)/1228800); - proto_tree_add_text(subtree, async_system_time_tvb, 0, -1, "CDMA time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, FALSE)); - proto_tree_add_text(subtree, async_system_time_tvb, 0, -1, "Local time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_text(subtree, async_system_time_tvb, 0, -1, "CDMA time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, FALSE)); + proto_tree_add_text(subtree, async_system_time_tvb, 0, -1, "Local time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_LOCAL, TRUE)); } return offset; @@ -10249,9 +10249,9 @@ dissect_lte_rrc_T_timeInfoUTC_r11(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t ts.secs = (time_t)(timeInfo/100)-2208988800U; /* epoch is 00:00:00 (midnight) UTC on 1900-01-01 */ ts.nsecs = (int)(timeInfo%100)*10000000; proto_tree_add_text(subtree, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, - "UTC time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, FALSE)); + "UTC time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_text(subtree, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, - "Local time: %s", abs_time_to_ep_str(&ts, ABSOLUTE_TIME_LOCAL, TRUE)); + "Local time: %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_LOCAL, TRUE)); return offset; } diff --git a/epan/dissectors/packet-mms.c b/epan/dissectors/packet-mms.c index fa1a756cfb..22070c6211 100644 --- a/epan/dissectors/packet-mms.c +++ b/epan/dissectors/packet-mms.c @@ -1845,7 +1845,7 @@ dissect_mms_TimeOfDay(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ if(len == 4) { milliseconds = tvb_get_ntohl(tvb, offset); - ptime = time_msecs_to_ep_str(milliseconds); + ptime = time_msecs_to_str(wmem_packet_scope(), milliseconds); if(hf_index >= 0) { @@ -1865,7 +1865,7 @@ dissect_mms_TimeOfDay(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ ts.secs = (days + 5113) * 86400 + milliseconds / 1000; ts.nsecs = (milliseconds % 1000) * 1000000U; - ptime = abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, TRUE); + ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE); if(hf_index >= 0) { proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime); @@ -1941,7 +1941,7 @@ dissect_mms_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ ts.secs = seconds; ts.nsecs = nanoseconds; - ptime = abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, TRUE); + ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE); if(hf_index >= 0) { diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c index 670bfe6dd2..482acf3fd7 100644 --- a/epan/dissectors/packet-mmse.c +++ b/epan/dissectors/packet-mmse.c @@ -1199,7 +1199,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, &count2); tmptime.secs = tval; tmptime.nsecs = 0; - strval = abs_time_to_ep_str(&tmptime, ABSOLUTE_TIME_LOCAL, + strval = abs_time_to_str(wmem_packet_scope(), &tmptime, ABSOLUTE_TIME_LOCAL, TRUE); /* Now render the fields */ tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c index 915177cf7d..0e7f1ae5fe 100644 --- a/epan/dissectors/packet-nbns.c +++ b/epan/dissectors/packet-nbns.c @@ -305,7 +305,7 @@ add_rr_to_tree(proto_item *trr, int rr_type, tvbuff_t *tvb, int offset, proto_tree_add_text(rr_tree, tvb, offset, 2, "Class: %s", class_description); offset += 2; proto_tree_add_text(rr_tree, tvb, offset, 4, "Time to live: %s", - time_secs_to_ep_str(ttl)); + time_secs_to_str(wmem_packet_scope(), ttl)); offset += 4; proto_tree_add_text(rr_tree, tvb, offset, 2, "Data length: %u", data_len); return rr_tree; diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index ab145d2c10..7fdc4fe714 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -3401,7 +3401,8 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val voffset = voffset+4; ns.secs = tvb_get_letohl(tvb, voffset); ns.nsecs = 0; - proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, + &ns, "Timestamp: %s", abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); voffset = voffset + 4; rnum = tvb_get_letohs(tvb, voffset); /* replica number */ proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset, @@ -3435,7 +3436,8 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val voffset += 4; /* This is the length of the time data no need to decode, always 4 bytes */ ns.secs = tvb_get_letohl(tvb, voffset); ns.nsecs = 0; - proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, &ns, "Time: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, + &ns, "Time: %s", abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); voffset = voffset + 4; break; case 0x00000019: /* Typed Name */ @@ -3646,7 +3648,8 @@ print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(nestree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset, @@ -3728,7 +3731,8 @@ print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(nestree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset, @@ -3868,7 +3872,8 @@ print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(nestree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset, @@ -3920,7 +3925,8 @@ print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(sub2tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(sub2tree, hf_nds_replica_num, tvb, ioffset, @@ -4442,14 +4448,16 @@ process_entry_info(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values) ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Time: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Time: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; } if (iter_flags & DSI_MODIFICATION_TIMESTAMP) { /* Modification Timestamp */ ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(it_tree, hf_nds_replica_num, tvb, ioffset, @@ -4464,7 +4472,8 @@ process_entry_info(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values) ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Creation Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Creation Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(it_tree, hf_nds_replica_num, tvb, ioffset, @@ -5134,7 +5143,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(atree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset, @@ -5222,7 +5232,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Creation Time: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Creation Time: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, @@ -5360,7 +5371,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, @@ -5794,14 +5806,16 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Time: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Time: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; break; case 0x0000020: /* Modification Timestamp */ ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, @@ -5816,7 +5830,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Creation Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Creation Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, @@ -5901,7 +5916,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Purge Time: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Purge Time: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; break; case 0x00020000: /* Dereference Base Class */ @@ -6167,7 +6183,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(sub1tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Creation Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Creation Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset, @@ -6180,7 +6197,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(sub1tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Modification Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Modification Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset = ioffset + 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset, @@ -6396,7 +6414,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Creation Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Creation Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset += 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, @@ -6428,7 +6447,8 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */ ns.nsecs = 0; proto_tree_add_time_format(sub2tree, hf_es_seconds, tvb, ioffset, - 4, &ns, "Timestamp: %s", abs_time_secs_to_ep_str(ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + 4, &ns, "Timestamp: %s", + abs_time_secs_to_str(wmem_packet_scope(), ns.secs, ABSOLUTE_TIME_LOCAL, TRUE)); ioffset += 4; replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ proto_tree_add_item(sub2tree, hf_nds_replica_num, tvb, ioffset, diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c index 4874d66be5..7a577d72a1 100644 --- a/epan/dissectors/packet-pktc.c +++ b/epan/dissectors/packet-pktc.c @@ -384,7 +384,7 @@ dissect_pktc_ap_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int o proto_tree_add_uint_format(tree, hf_pktc_sec_param_lifetime, tvb, offset, 4, tvb_get_ntohl(tvb, offset), "%s: %s", proto_registrar_get_name(hf_pktc_sec_param_lifetime), - time_secs_to_ep_str(tvb_get_ntohl(tvb, offset))); + time_secs_to_str(wmem_packet_scope(), tvb_get_ntohl(tvb, offset))); offset+=4; /* grace period */ diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 0653b9b6a2..8eafc8090b 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -822,7 +822,7 @@ void radius_date(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U_ time_ptr.nsecs = 0; proto_tree_add_time(tree, a->hf, tvb, offset, len, &time_ptr); - proto_item_append_text(avp_item, "%s", abs_time_to_ep_str(&time_ptr, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text(avp_item, "%s", abs_time_to_str(wmem_packet_scope(), &time_ptr, ABSOLUTE_TIME_LOCAL, TRUE)); } /* diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c index 0bde57ae42..faa899aa8c 100644 --- a/epan/dissectors/packet-rtmpt.c +++ b/epan/dissectors/packet-rtmpt.c @@ -1071,9 +1071,9 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean * t.nsecs = (int)((iDoubleValue - 1000*(double)t.secs) * 1000000); proto_tree_add_time(val_tree, hf_amf_date, tvb, iValueOffset, 8, &t); iValueOffset += 8; - proto_item_append_text(ti, " %s", abs_time_to_ep_str(&t, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text(ti, " %s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); if (parent_ti != NULL) - proto_item_append_text(parent_ti, " %s", abs_time_to_ep_str(&t, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text(parent_ti, " %s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); /* time-zone */ iValueOffset += 2; break; @@ -1296,9 +1296,9 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item t.nsecs = (int)((iDoubleValue - 1000*(double)t.secs) * 1000000); proto_tree_add_time(val_tree, hf_amf_date, tvb, iValueOffset, 8, &t); iValueOffset += 8; - proto_item_append_text(ti, "%s", abs_time_to_ep_str(&t, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text(ti, "%s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); if (parent_ti != NULL) - proto_item_append_text(parent_ti, "%s", abs_time_to_ep_str(&t, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_item_append_text(parent_ti, "%s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); } else { /* the upper 28 bits of the integer value are an object reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c index 2225904ef8..6158e14ef5 100644 --- a/epan/dissectors/packet-selfm.c +++ b/epan/dissectors/packet-selfm.c @@ -1975,7 +1975,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o proto_tree_add_item(fastser_tree, hf_selfm_fastser_unsresp_doy, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastser_tree, hf_selfm_fastser_unsresp_year, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastser_tree, hf_selfm_fastser_unsresp_todms, tvb, offset+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_text(fastser_tree, tvb, offset+4, 4, "Time of Day (decoded): %s", time_msecs_to_ep_str(tod_ms)); + proto_tree_add_text(fastser_tree, tvb, offset+4, 4, "Time of Day (decoded): %s", time_msecs_to_str(wmem_packet_scope(), tod_ms)); offset += 8; /* Build element tree */ @@ -2016,7 +2016,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o proto_tree_add_item(fastser_element_tree, hf_selfm_fastser_unsresp_elmt_idx, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastser_element_tree, hf_selfm_fastser_unsresp_elmt_ts_ofs, tvb, offset+1, 3, ENC_NA); proto_tree_add_text(fastser_element_tree, tvb, offset+1, 3, - "SER Element Timestamp Offset (decoded): %s", time_msecs_to_ep_str(tod_ms + (elmt_ts_offset/1000))); + "SER Element Timestamp Offset (decoded): %s", time_msecs_to_str(wmem_packet_scope(), tod_ms + (elmt_ts_offset/1000))); proto_tree_add_uint(fastser_element_tree, hf_selfm_fastser_unsresp_elmt_status, tvb, elmt_status32_ofs, 4, elmt_status); offset += 4; diff --git a/epan/dissectors/packet-smb-browse.c b/epan/dissectors/packet-smb-browse.c index 4c556ed0af..2d5b1162ce 100644 --- a/epan/dissectors/packet-smb-browse.c +++ b/epan/dissectors/packet-smb-browse.c @@ -617,7 +617,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr proto_tree_add_uint_format_value(tree, hf_periodicity, tvb, offset, 4, periodicity, "%s", - time_msecs_to_ep_str(periodicity)); + time_msecs_to_str(wmem_packet_scope(), periodicity)); offset += 4; /* server name */ @@ -718,7 +718,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr proto_tree_add_uint_format_value(tree, hf_server_uptime, tvb, offset, 4, uptime, "%s", - time_msecs_to_ep_str(uptime)); + time_msecs_to_str(wmem_packet_scope(), uptime)); offset += 4; /* next 4 bytes must be zero */ @@ -876,7 +876,7 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr proto_tree_add_uint_format_value(tree, hf_periodicity, tvb, offset, 2, periodicity, "%s", - time_msecs_to_ep_str(periodicity)); + time_msecs_to_str(wmem_packet_scope(), periodicity)); offset += 2; /* server name */ diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c index 2a3a5a45cf..cf70014f40 100644 --- a/epan/dissectors/packet-smb-pipe.c +++ b/epan/dissectors/packet-smb-pipe.c @@ -512,7 +512,7 @@ add_reltime(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, nstime.nsecs = 0; proto_tree_add_time_format_value(tree, hf_index, tvb, offset, 4, &nstime, "%s", - time_secs_to_ep_str( (gint32) nstime.secs)); + time_secs_to_str(wmem_packet_scope(), (gint32) nstime.secs)); offset += 4; return offset; } @@ -646,11 +646,11 @@ add_tzoffset(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, if (tzoffset < 0) { proto_tree_add_int_format_value(tree, hf_tzoffset, tvb, offset, 2, tzoffset, "%s east of UTC", - time_secs_to_ep_str(-tzoffset*60)); + time_secs_to_str(wmem_packet_scope(), -tzoffset*60)); } else if (tzoffset > 0) { proto_tree_add_int_format_value(tree, hf_tzoffset, tvb, offset, 2, tzoffset, "%s west of UTC", - time_secs_to_ep_str(tzoffset*60)); + time_secs_to_str(wmem_packet_scope(), tzoffset*60)); } else { proto_tree_add_int_format_value(tree, hf_tzoffset, tvb, offset, 2, tzoffset, "at UTC"); diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index d986fc80df..05fabfa236 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -4979,7 +4979,7 @@ smbext20_timeout_msecs_to_str(gint32 timeout) return buf; } - return time_msecs_to_ep_str(timeout); + return time_msecs_to_str(wmem_packet_scope(), timeout); } static int diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index c13b070945..d8f6f14f77 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -1327,7 +1327,7 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len) ts.nsecs = 0; proto_tree_add_time_format_value(tree, hf_snmp_engineid_time, tvb, offset+4, 4, &ts, "%s", - abs_time_secs_to_ep_str(seconds, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(wmem_packet_scope(), seconds, ABSOLUTE_TIME_LOCAL, TRUE)); offset+=8; len_remain=0; } diff --git a/epan/dissectors/packet-sv.c b/epan/dissectors/packet-sv.c index bf24e69540..6fa8e87df3 100644 --- a/epan/dissectors/packet-sv.c +++ b/epan/dissectors/packet-sv.c @@ -304,7 +304,7 @@ dissect_sv_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, ts.secs = seconds; ts.nsecs = nanoseconds; - ptime = abs_time_to_ep_str(&ts, ABSOLUTE_TIME_UTC, TRUE); + ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE); if(hf_index >= 0) { diff --git a/epan/dissectors/packet-time.c b/epan/dissectors/packet-time.c index 25549ffaf0..a8e7afcfb8 100644 --- a/epan/dissectors/packet-time.c +++ b/epan/dissectors/packet-time.c @@ -75,7 +75,7 @@ dissect_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint32 delta_seconds = tvb_get_ntohl(tvb, 0); proto_tree_add_uint_format(time_tree, hf_time_time, tvb, 0, 4, delta_seconds, "%s", - abs_time_secs_to_ep_str(delta_seconds-2208988800U, + abs_time_secs_to_str(wmem_packet_scope(), delta_seconds-2208988800U, (absolute_time_display_e)time_display_type, TRUE)); } } diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c index 2185514704..d3ffa73cc1 100644 --- a/epan/dissectors/packet-vcdu.c +++ b/epan/dissectors/packet-vcdu.c @@ -244,7 +244,7 @@ smex_time_to_string (int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, t.secs = (pb5_days_since_midnight_9_10_oct_1995 * 86400) + pb5_seconds + utcdiff; t.nsecs = pb5_milliseconds*1000000; /* msecs to nsecs */ - return abs_time_to_ep_str(&t, ABSOLUTE_TIME_DOY_UTC, TRUE); + return abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_DOY_UTC, TRUE); } diff --git a/epan/dissectors/packet-who.c b/epan/dissectors/packet-who.c index d1c604bb5e..ba9983a970 100644 --- a/epan/dissectors/packet-who.c +++ b/epan/dissectors/packet-who.c @@ -213,7 +213,7 @@ dissect_whoent(tvbuff_t *tvb, int offset, proto_tree *tree) idle_secs = tvb_get_ntohl(tvb, line_offset); proto_tree_add_uint_format(whoent_tree, hf_who_idle, tvb, line_offset, 4, idle_secs, "Idle: %s", - time_secs_to_ep_str(idle_secs)); + time_secs_to_str(wmem_packet_scope(), idle_secs)); line_offset += 4; whoent_num++; diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c index 18cb45a38d..ad8492bcba 100644 --- a/epan/dissectors/packet-wsp.c +++ b/epan/dissectors/packet-wsp.c @@ -1809,7 +1809,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo) tvb, hdr_start, hdr_len + val_len, "Requesting Time Of Day"); } else { - val_str = abs_time_secs_to_ep_str(val, ABSOLUTE_TIME_LOCAL, TRUE); + val_str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); ti = proto_tree_add_string (wsp_headers, hf_hdr_x_wap_tod, tvb, hdr_start, hdr_len + val_len, val_str); @@ -2854,12 +2854,12 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i if (val_id <= 4) { /* Length field already parsed by macro! */ \ get_date_value(val, tvb, off, len, ok); \ if (ok) { \ - str = abs_time_secs_to_ep_str(val, ABSOLUTE_TIME_LOCAL, TRUE); \ + str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); \ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \ ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \ tvb, hdr_start, offset - hdr_start, str); \ /* BEHOLD: do NOT try to free str, as \ - * abs_time_secs_to_ep_str() returns wmem_allocated data */ \ + * abs_time_secs_to_str(wmem_packet_scope(), ) returns wmem_allocated data */ \ } \ } \ wkh_4_End(hf_hdr_ ## underscored); \ @@ -2889,12 +2889,12 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i if (val_id <= 4) { /* Length field already parsed by macro! */ \ get_date_value(val, tvb, off, len, ok); \ if (ok) { \ - str = abs_time_secs_to_ep_str(val, ABSOLUTE_TIME_LOCAL, TRUE); \ + str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); \ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \ ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \ tvb, hdr_start, offset - hdr_start, str); \ /* BEHOLD: do NOT try to free str, as \ - * abs_time_secs_to_ep_str() returns wmem_allocated data */ \ + * abs_time_secs_to_str(wmem_packet_scope(), ) returns wmem_allocated data */ \ } \ } \ wkh_4_End(hf_hdr_ ## underscored); \ @@ -2942,7 +2942,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i tvb, hdr_start, offset - hdr_start, \ "Requesting Time Of Day"); \ } else { \ - str = abs_time_secs_to_ep_str(val, ABSOLUTE_TIME_LOCAL, TRUE); \ + str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); \ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \ ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \ tvb, hdr_start, offset - hdr_start, str); \ @@ -3590,11 +3590,11 @@ wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i get_date_value(val, tvb, off, len, ok); if (ok) { /* Valid warn-text string */ off += len; - val_str = abs_time_secs_to_ep_str(val, ABSOLUTE_TIME_LOCAL, TRUE); + val_str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); str = wmem_strdup_printf(wmem_packet_scope(), "; date=%s", val_str); proto_item_append_string(ti, str); /* BEHOLD: do NOT try to free str, as \ - * abs_time_secs_to_ep_str() returns wmem_allocated data */ \ + * abs_time_secs_to_str(wmem_packet_scope(), ) returns wmem_allocated data */ \ } } } diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c index b06bbde7fe..458e20b189 100644 --- a/epan/dissectors/packet-zbee-zcl-general.c +++ b/epan/dissectors/packet-zbee-zcl-general.c @@ -1945,7 +1945,7 @@ decode_zcl_ota_curr_time(gchar *s, guint32 value) if (value == ZBEE_ZCL_OTA_TIME_NOW) g_snprintf(s, ITEM_LABEL_LENGTH, "Now"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_ep_str(value, ABSOLUTE_TIME_LOCAL, 1)); + g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_str(wmem_packet_scope(), value, ABSOLUTE_TIME_LOCAL, 1)); return; } /*decode_zcl_ota_curr_time*/ @@ -1967,7 +1967,7 @@ decode_zcl_ota_req_time(gchar *s, guint32 value) g_snprintf(s, ITEM_LABEL_LENGTH, "Wrong Value"); else /* offset from now */ - g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", time_secs_to_ep_str(value)); + g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", time_secs_to_str(wmem_packet_scope(), value)); return; } /*decode_zcl_ota_req_time*/ @@ -1989,7 +1989,7 @@ decode_zcl_ota_upgr_time(gchar *s, guint32 value) g_snprintf(s, ITEM_LABEL_LENGTH, "Wait for upgrade command"); else /* offset from now */ - g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", time_secs_to_ep_str(value)); + g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", time_secs_to_str(wmem_packet_scope(), value)); return; } /*decode_zcl_ota_upgr_time*/ diff --git a/epan/dissectors/packet-zbee-zcl-ha.c b/epan/dissectors/packet-zbee-zcl-ha.c index 804b88de1d..a8a2f30154 100644 --- a/epan/dissectors/packet-zbee-zcl-ha.c +++ b/epan/dissectors/packet-zbee-zcl-ha.c @@ -1480,7 +1480,7 @@ decode_zcl_appl_stats_utc_time(gchar *s, guint32 value) g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid UTC Time"); else { value += ZBEE_ZCL_NSTIME_UTC_OFFSET; - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_ep_str (value, ABSOLUTE_TIME_LOCAL, TRUE)); + g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_str (wmem_packet_scope(), value, ABSOLUTE_TIME_LOCAL, TRUE)); } } /* decode_zcl_appl_stats_utc_time */ diff --git a/epan/dissectors/packet-zbee-zcl-se.c b/epan/dissectors/packet-zbee-zcl-se.c index f1d7f055a7..cdb0f941f7 100644 --- a/epan/dissectors/packet-zbee-zcl-se.c +++ b/epan/dissectors/packet-zbee-zcl-se.c @@ -404,7 +404,7 @@ decode_zcl_msg_start_time(gchar *s, guint32 value) g_snprintf(s, ITEM_LABEL_LENGTH, "Now"); else { value += ZBEE_ZCL_NSTIME_UTC_OFFSET; - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_ep_str (value, ABSOLUTE_TIME_LOCAL, TRUE)); + g_snprintf(s, ITEM_LABEL_LENGTH, "%s", abs_time_secs_to_str (wmem_packet_scope(), value, ABSOLUTE_TIME_LOCAL, TRUE)); } } /* decode_zcl_msg_start_time */ diff --git a/epan/ftypes/ftype-time.c b/epan/ftypes/ftype-time.c index 1ba72a0051..67a669da64 100644 --- a/epan/ftypes/ftype-time.c +++ b/epan/ftypes/ftype-time.c @@ -327,18 +327,25 @@ static int absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_) { gchar *rep; + int ret; - rep = abs_time_to_ep_str(&fv->value.time, ABSOLUTE_TIME_LOCAL, + rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL, rtype == FTREPR_DISPLAY); - return (int)strlen(rep) + 2; /* 2 for opening and closing quotes */ + + ret = (int)strlen(rep) + 2; /* 2 for opening and closing quotes */ + + wmem_free(NULL, rep); + + return ret; } static void absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) { - sprintf(buf, "\"%s\"", - abs_time_to_ep_str(&fv->value.time, ABSOLUTE_TIME_LOCAL, - rtype == FTREPR_DISPLAY)); + gchar *rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL, + rtype == FTREPR_DISPLAY); + sprintf(buf, "\"%s\"", rep); + wmem_free(NULL, rep); } static int diff --git a/epan/print.c b/epan/print.c index 504fc2a891..ea1cbae114 100644 --- a/epan/print.c +++ b/epan/print.c @@ -534,6 +534,7 @@ print_pdml_geninfo(proto_tree *tree, FILE *fh) nstime_t *timestamp; GPtrArray *finfo_array; field_info *frame_finfo; + gchar *tmp; /* Get frame protocol's finfo. */ finfo_array = proto_find_finfo(tree, proto_frame); @@ -595,10 +596,14 @@ print_pdml_geninfo(proto_tree *tree, FILE *fh) " <field name=\"caplen\" pos=\"0\" show=\"%u\" showname=\"Captured Length\" value=\"%x\" size=\"%u\"/>\n", caplen, caplen, frame_finfo->length); + tmp = abs_time_to_str(NULL, timestamp, ABSOLUTE_TIME_LOCAL, TRUE); + /* Print geninfo.timestamp */ fprintf(fh, " <field name=\"timestamp\" pos=\"0\" show=\"%s\" showname=\"Captured Time\" value=\"%d.%09d\" size=\"%u\"/>\n", - abs_time_to_ep_str(timestamp, ABSOLUTE_TIME_LOCAL, TRUE), (int) timestamp->secs, timestamp->nsecs, frame_finfo->length); + tmp, (int) timestamp->secs, timestamp->nsecs, frame_finfo->length); + + wmem_free(NULL, tmp); /* Print geninfo end */ fprintf(fh, diff --git a/epan/proto.c b/epan/proto.c index 304f15126c..6f4baa33a8 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -4172,7 +4172,7 @@ proto_custom_set(proto_tree* tree, const int field_id, gint occurrence, case FT_ABSOLUTE_TIME: offset_r += protoo_strlcpy(result+offset_r, - abs_time_to_ep_str((const nstime_t *)fvalue_get(&finfo->value), + abs_time_to_str(wmem_packet_scope(), (const nstime_t *)fvalue_get(&finfo->value), (absolute_time_display_e)hfinfo->display, TRUE), size-offset_r); break; @@ -5829,7 +5829,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str) case FT_ABSOLUTE_TIME: label_fill(label_str, 0, hfinfo, - abs_time_to_ep_str((const nstime_t *)fvalue_get(&fi->value), + abs_time_to_str(wmem_packet_scope(), (const nstime_t *)fvalue_get(&fi->value), (absolute_time_display_e)hfinfo->display, TRUE)); break; diff --git a/epan/to_str.c b/epan/to_str.c index 49524c7c9f..349105a076 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -359,15 +359,15 @@ guint32_to_str_buf(guint32 u, gchar *buf, int buf_len) { * If time is negative, add a '-' to all non-null components. */ static void -time_secs_to_ep_str_buf(gint32 time_val, const guint32 frac, const gboolean is_nsecs, - emem_strbuf_t *buf) +time_secs_to_str_buf(gint32 time_val, const guint32 frac, const gboolean is_nsecs, + wmem_strbuf_t *buf) { int hours, mins, secs; const gchar *msign = ""; gboolean do_comma = FALSE; if(time_val == G_MININT32) { /* That Which Shall Not Be Negated */ - ep_strbuf_append_printf(buf, "Unable to cope with time value %d", time_val); + wmem_strbuf_append_printf(buf, "Unable to cope with time value %d", time_val); return; } @@ -384,45 +384,45 @@ time_secs_to_ep_str_buf(gint32 time_val, const guint32 frac, const gboolean is_n time_val /= 24; if (time_val != 0) { - ep_strbuf_append_printf(buf, "%s%u day%s", msign, time_val, PLURALIZE(time_val)); + wmem_strbuf_append_printf(buf, "%s%u day%s", msign, time_val, PLURALIZE(time_val)); do_comma = TRUE; msign=""; } if (hours != 0) { - ep_strbuf_append_printf(buf, "%s%s%u hour%s", COMMA(do_comma), msign, hours, PLURALIZE(hours)); + wmem_strbuf_append_printf(buf, "%s%s%u hour%s", COMMA(do_comma), msign, hours, PLURALIZE(hours)); do_comma = TRUE; msign=""; } if (mins != 0) { - ep_strbuf_append_printf(buf, "%s%s%u minute%s", COMMA(do_comma), msign, mins, PLURALIZE(mins)); + wmem_strbuf_append_printf(buf, "%s%s%u minute%s", COMMA(do_comma), msign, mins, PLURALIZE(mins)); do_comma = TRUE; msign=""; } if (secs != 0 || frac != 0) { if (frac != 0) { if (is_nsecs) - ep_strbuf_append_printf(buf, "%s%s%u.%09u seconds", COMMA(do_comma), msign, secs, frac); + wmem_strbuf_append_printf(buf, "%s%s%u.%09u seconds", COMMA(do_comma), msign, secs, frac); else - ep_strbuf_append_printf(buf, "%s%s%u.%03u seconds", COMMA(do_comma), msign, secs, frac); + wmem_strbuf_append_printf(buf, "%s%s%u.%03u seconds", COMMA(do_comma), msign, secs, frac); } else - ep_strbuf_append_printf(buf, "%s%s%u second%s", COMMA(do_comma), msign, secs, PLURALIZE(secs)); + wmem_strbuf_append_printf(buf, "%s%s%u second%s", COMMA(do_comma), msign, secs, PLURALIZE(secs)); } } gchar * -time_secs_to_ep_str(const gint32 time_val) +time_secs_to_str(wmem_allocator_t *scope, const gint32 time_val) { - emem_strbuf_t *buf; - - buf=ep_strbuf_sized_new(TIME_SECS_LEN+1, TIME_SECS_LEN+1); + wmem_strbuf_t *buf; if (time_val == 0) { - ep_strbuf_append(buf, "0 seconds"); - return buf->str; + return wmem_strdup(scope, "0 seconds"); } - time_secs_to_ep_str_buf(time_val, 0, FALSE, buf); - return buf->str; + buf = wmem_strbuf_sized_new(scope, TIME_SECS_LEN+1, TIME_SECS_LEN+1); + + time_secs_to_str_buf(time_val, 0, FALSE, buf); + + return wmem_strbuf_finalize(buf); } static void @@ -480,19 +480,18 @@ time_secs_to_ep_str_unsigned(const guint32 time_val) gchar * -time_msecs_to_ep_str(gint32 time_val) +time_msecs_to_str(wmem_allocator_t *scope, gint32 time_val) { - emem_strbuf_t *buf; + wmem_strbuf_t *buf; int msecs; - buf=ep_strbuf_sized_new(TIME_SECS_LEN+1+3+1, TIME_SECS_LEN+1+3+1); - if (time_val == 0) { - ep_strbuf_append(buf, "0 seconds"); - return buf->str; + return wmem_strdup(scope, "0 seconds"); } - if(time_val<0){ + buf = wmem_strbuf_sized_new(scope, TIME_SECS_LEN+1+3+1, TIME_SECS_LEN+1+3+1); + + if (time_val<0) { /* oops we got passed a negative time */ time_val= -time_val; msecs = time_val % 1000; @@ -503,8 +502,9 @@ time_msecs_to_ep_str(gint32 time_val) time_val /= 1000; } - time_secs_to_ep_str_buf(time_val, msecs, FALSE, buf); - return buf->str; + time_secs_to_str_buf(time_val, msecs, FALSE, buf); + + return wmem_strbuf_finalize(buf); } static const char mon_names[12][4] = { @@ -573,7 +573,7 @@ static const gchar *get_zonename(struct tm *tmp) { } gchar * -abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, +abs_time_to_str(wmem_allocator_t *scope, const nstime_t *abs_time, const absolute_time_display_e fmt, gboolean show_zone) { struct tm *tmp = NULL; @@ -601,7 +601,8 @@ abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, case ABSOLUTE_TIME_DOY_UTC: if (show_zone) { - buf = ep_strdup_printf("%04d/%03d:%02d:%02d:%02d.%09ld %s", + buf = wmem_strdup_printf(scope, + "%04d/%03d:%02d:%02d:%02d.%09ld %s", tmp->tm_year + 1900, tmp->tm_yday + 1, tmp->tm_hour, @@ -610,7 +611,8 @@ abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, (long)abs_time->nsecs, zonename); } else { - buf = ep_strdup_printf("%04d/%03d:%02d:%02d:%02d.%09ld", + buf = wmem_strdup_printf(scope, + "%04d/%03d:%02d:%02d:%02d.%09ld", tmp->tm_year + 1900, tmp->tm_yday + 1, tmp->tm_hour, @@ -623,7 +625,8 @@ abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, case ABSOLUTE_TIME_UTC: case ABSOLUTE_TIME_LOCAL: if (show_zone) { - buf = ep_strdup_printf("%s %2d, %d %02d:%02d:%02d.%09ld %s", + buf = wmem_strdup_printf(scope, + "%s %2d, %d %02d:%02d:%02d.%09ld %s", mon_names[tmp->tm_mon], tmp->tm_mday, tmp->tm_year + 1900, @@ -633,7 +636,8 @@ abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, (long)abs_time->nsecs, zonename); } else { - buf = ep_strdup_printf("%s %2d, %d %02d:%02d:%02d.%09ld", + buf = wmem_strdup_printf(scope, + "%s %2d, %d %02d:%02d:%02d.%09ld", mon_names[tmp->tm_mon], tmp->tm_mday, tmp->tm_year + 1900, @@ -645,12 +649,12 @@ abs_time_to_ep_str(const nstime_t *abs_time, const absolute_time_display_e fmt, break; } } else - buf = ep_strdup("Not representable"); + buf = wmem_strdup(scope, "Not representable"); return buf; } gchar * -abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt, +abs_time_secs_to_str(wmem_allocator_t *scope, const time_t abs_time, const absolute_time_display_e fmt, gboolean show_zone) { struct tm *tmp = NULL; @@ -677,7 +681,8 @@ abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt case ABSOLUTE_TIME_DOY_UTC: if (show_zone) { - buf = ep_strdup_printf("%04d/%03d:%02d:%02d:%02d %s", + buf = wmem_strdup_printf(scope, + "%04d/%03d:%02d:%02d:%02d %s", tmp->tm_year + 1900, tmp->tm_yday + 1, tmp->tm_hour, @@ -685,7 +690,8 @@ abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt tmp->tm_sec, zonename); } else { - buf = ep_strdup_printf("%04d/%03d:%02d:%02d:%02d", + buf = wmem_strdup_printf(scope, + "%04d/%03d:%02d:%02d:%02d", tmp->tm_year + 1900, tmp->tm_yday + 1, tmp->tm_hour, @@ -697,7 +703,8 @@ abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt case ABSOLUTE_TIME_UTC: case ABSOLUTE_TIME_LOCAL: if (show_zone) { - buf = ep_strdup_printf("%s %2d, %d %02d:%02d:%02d %s", + buf = wmem_strdup_printf(scope, + "%s %2d, %d %02d:%02d:%02d %s", mon_names[tmp->tm_mon], tmp->tm_mday, tmp->tm_year + 1900, @@ -706,7 +713,8 @@ abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt tmp->tm_sec, zonename); } else { - buf = ep_strdup_printf("%s %2d, %d %02d:%02d:%02d", + buf = wmem_strdup_printf(scope, + "%s %2d, %d %02d:%02d:%02d", mon_names[tmp->tm_mon], tmp->tm_mday, tmp->tm_year + 1900, @@ -717,7 +725,7 @@ abs_time_secs_to_ep_str(const time_t abs_time, const absolute_time_display_e fmt break; } } else - buf = ep_strdup("Not representable"); + buf = wmem_strdup(scope, "Not representable"); return buf; } @@ -856,14 +864,12 @@ display_epoch_time(gchar *buf, int buflen, const time_t sec, gint32 frac, * Display a relative time as days/hours/minutes/seconds. */ gchar * -rel_time_to_ep_str(const nstime_t *rel_time) +rel_time_to_str(wmem_allocator_t *scope, const nstime_t *rel_time) { - emem_strbuf_t *buf; + wmem_strbuf_t *buf; gint32 time_val; gint32 nsec; - buf=ep_strbuf_sized_new(1+TIME_SECS_LEN+1+6+1, 1+TIME_SECS_LEN+1+6+1); - /* If the nanoseconds part of the time stamp is negative, print its absolute value and, if the seconds part isn't (the seconds part should be zero in that case), stick @@ -871,12 +877,14 @@ rel_time_to_ep_str(const nstime_t *rel_time) time_val = (gint) rel_time->secs; nsec = rel_time->nsecs; if (time_val == 0 && nsec == 0) { - ep_strbuf_append(buf, "0.000000000 seconds"); - return buf->str; + return wmem_strdup(scope, "0.000000000 seconds"); } + + buf = wmem_strbuf_sized_new(scope, 1+TIME_SECS_LEN+1+6+1, 1+TIME_SECS_LEN+1+6+1); + if (nsec < 0) { nsec = -nsec; - ep_strbuf_append_c(buf, '-'); + wmem_strbuf_append_c(buf, '-'); /* * We assume here that "rel_time->secs" is negative @@ -886,8 +894,9 @@ rel_time_to_ep_str(const nstime_t *rel_time) time_val = (gint) -rel_time->secs; } - time_secs_to_ep_str_buf(time_val, nsec, TRUE, buf); - return buf->str; + time_secs_to_str_buf(time_val, nsec, TRUE, buf); + + return wmem_strbuf_finalize(buf); } #define REL_TIME_SECS_LEN (1+10+1+9+1) diff --git a/epan/to_str.h b/epan/to_str.h index 583af027d8..e05b7c0fa3 100644 --- a/epan/to_str.h +++ b/epan/to_str.h @@ -75,19 +75,19 @@ extern gchar* ipxnet_to_str_punct(const guint32 ad, const char punct); extern gchar* tvb_vines_addr_to_str(tvbuff_t *tvb, const gint offset); WS_DLL_PUBLIC gchar* eui64_to_str(const guint64 ad); WS_DLL_PUBLIC gchar* tvb_eui64_to_str(tvbuff_t *tvb, const gint offset, const guint encoding); -WS_DLL_PUBLIC gchar* time_secs_to_ep_str(const gint32 time_val); +WS_DLL_PUBLIC gchar* time_secs_to_str(wmem_allocator_t *scope, const gint32 time_val); gchar* time_secs_to_ep_str_unsigned(const guint32); -WS_DLL_PUBLIC gchar* time_msecs_to_ep_str(gint32 time_val); -WS_DLL_PUBLIC gchar* abs_time_to_ep_str(const nstime_t*, const absolute_time_display_e fmt, +WS_DLL_PUBLIC gchar* time_msecs_to_str(wmem_allocator_t *scope, gint32 time_val); +WS_DLL_PUBLIC gchar* abs_time_to_str(wmem_allocator_t *scope, const nstime_t*, const absolute_time_display_e fmt, gboolean show_zone); -WS_DLL_PUBLIC gchar* abs_time_secs_to_ep_str(const time_t, const absolute_time_display_e fmt, +WS_DLL_PUBLIC gchar* abs_time_secs_to_str(wmem_allocator_t *scope, const time_t, const absolute_time_display_e fmt, gboolean show_zone); WS_DLL_PUBLIC void display_signed_time(gchar *, int, const gint32, gint32, const to_str_time_res_t); WS_DLL_PUBLIC void display_epoch_time(gchar *, int, const time_t, gint32, const to_str_time_res_t); extern void guint32_to_str_buf(guint32 u, gchar *buf, int buf_len); -WS_DLL_PUBLIC gchar* rel_time_to_ep_str(const nstime_t*); +WS_DLL_PUBLIC gchar* rel_time_to_str(wmem_allocator_t *scope, const nstime_t*); WS_DLL_PUBLIC gchar* rel_time_to_secs_ep_str(const nstime_t*); WS_DLL_PUBLIC gchar* guid_to_ep_str(const e_guid_t*); gchar* guid_to_str_buf(const e_guid_t*, gchar*, int); diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c index 77d264cc58..5c40b317a8 100644 --- a/epan/wslua/wslua_util.c +++ b/epan/wslua/wslua_util.c @@ -45,7 +45,7 @@ WSLUA_FUNCTION wslua_format_date(lua_State* LS) { /* Formats an absolute timesta then.secs = (guint32)(floor(timestamp)); then.nsecs = (guint32) ( (timestamp-(double)(then.secs))*1000000000); - str = abs_time_to_ep_str(&then, ABSOLUTE_TIME_LOCAL, TRUE); + str = abs_time_to_str(NULL, &then, ABSOLUTE_TIME_LOCAL, TRUE); /* XXX right scope? */ lua_pushstring(LS,str); WSLUA_RETURN(1); /* A string with the formated date */ @@ -59,7 +59,7 @@ WSLUA_FUNCTION wslua_format_time(lua_State* LS) { /* Formats a relative timestam then.secs = (guint32)(floor(timestamp)); then.nsecs = (guint32) ( (timestamp-(double)(then.secs))*1000000000); - str = rel_time_to_ep_str(&then); + str = rel_time_to_str(NULL, &then); /* XXX what is the right scope? */ lua_pushstring(LS,str); WSLUA_RETURN(1); /* A string with the formated time */ |