Add new encoding names for seconds/{micro,nano}second time stamps.

Add ENC_TIME_SECS_NSECS and ENC_TIME_SECS_USECS; they make it more
explicit (especially to those not familiar with UN*X data types) what
the representation is, allow for ENC_TIME_SECS_MSECS etc. if they're
needed, and match names such as ENC_TIME_SECS and ENC_TIME_MSECS.

Change-Id: I6ab36fb4da70563587141cd65ffff8523477b0c4
Reviewed-on: https://code.wireshark.org/review/28564
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-07-01 21:08:41 -07:00
parent a796138283
commit 1075054a10
22 changed files with 93 additions and 80 deletions

View File

@ -1629,10 +1629,14 @@ For FT_ABSOLUTE_TIME fields, the encoding specifies the form in which
the time stamp is specified, as well as its byte order. The time stamp
encodings that are currently supported are:
ENC_TIME_TIMESPEC - 8 bytes; the first 4 bytes are seconds since
the UN*X epoch (1970-01-01 00:00:00 UTC) and the next 4 bytes
are nanoseconds since that second. (I.e., a UN*X struct
timespec with a 4-byte time_t.)
ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
bytes are seconds and the next 4 bytes are nanoseconds; for 12
bytes, the first 8 bytes are seconds and the next 4 bytes are
nanoseconds; for 16 bytes, the first 8 bytes are seconds and
the next 8 bytes are nanoseconds. The seconds are seconds
since the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X
struct timespec with a 4-byte or 8-byte time_t or a structure
with an 8-byte time_t and an 8-byte nanoseconds field.)
ENC_TIME_NTP - 8 bytes; the first 4 bytes are seconds since the NTP
epoch (1900-01-01 00:00:00 GMT) and the next 4 bytes are 1/2^32's of
@ -1649,7 +1653,7 @@ encodings that are currently supported are:
NTP time.) It's used by the Object Management Group's Real-Time
Publish-Subscribe Wire Protocol for the Data Distribution Service.
ENC_TIME_TIMEVAL - 8 bytes; the first 4 bytes are seconds since the
ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds since the
UN*X epoch and the next 4 bytes are microseconds since that
second. (I.e., a UN*X struct timeval with a 4-byte time_t.)
@ -1673,10 +1677,13 @@ For FT_RELATIVE_TIME fields, the encoding specifies the form in which
the time stamp is specified, as well as its byte order. The time stamp
encodings that are currently supported are:
ENC_TIME_TIMESPEC - 8 bytes; the first 4 bytes are seconds and the
next 4 bytes are nanoseconds.
ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
bytes are seconds and the next 4 bytes are nanoseconds; for 12
bytes, the first 8 bytes are seconds and the next 4 bytes are
nanoseconds; for 16 bytes, the first 8 bytes are seconds and
the next 8 bytes are nanoseconds.
ENC_TIME_TIMEVAL - 8 bytes; the first 4 bytes are seconds and the
ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
next 4 bytes are microseconds.
ENC_TIME_SECS - 4 to 8 bytes, representing a value in seconds.

View File

@ -1669,16 +1669,16 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(ninep_tree, hf_9P_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
offset += 8;
proto_tree_add_item(ninep_tree, hf_9P_atime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_atime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
proto_tree_add_item(ninep_tree, hf_9P_mtime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_mtime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
proto_tree_add_item(ninep_tree, hf_9P_ctime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_ctime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
proto_tree_add_item(ninep_tree, hf_9P_btime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_btime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
proto_tree_add_item(ninep_tree, hf_9P_gen, tvb, offset, 8, ENC_LITTLE_ENDIAN);
@ -1713,10 +1713,10 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(ninep_tree, hf_9P_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
offset += 8;
proto_tree_add_item(ninep_tree, hf_9P_atime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_atime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
proto_tree_add_item(ninep_tree, hf_9P_mtime, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(ninep_tree, hf_9P_mtime, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 16;
conv_set_tag(pinfo, tag, ninemsg, _9P_NOFID, NULL);

View File

@ -152,7 +152,7 @@ static dissector_table_t aruba_erm_subdissector_table;
static int
dissect_aruba_erm_pcap(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *aruba_erm_tree, gint offset)
{
proto_tree_add_item(aruba_erm_tree, hf_aruba_erm_time, tvb, offset, 8, ENC_TIME_TIMEVAL|ENC_BIG_ENDIAN);
proto_tree_add_item(aruba_erm_tree, hf_aruba_erm_time, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN);
offset +=8;
proto_tree_add_item(aruba_erm_tree, hf_aruba_erm_incl_len, tvb, 8, 4, ENC_BIG_ENDIAN);

View File

@ -830,7 +830,7 @@ dissect_bitcoin_msg_version(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
create_services_tree(tvb, ti, offset);
offset += 8;
proto_tree_add_item(tree, &hfi_msg_version_timestamp, tvb, offset, 8, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, &hfi_msg_version_timestamp, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 8;
ti = proto_tree_add_item(tree, &hfi_msg_version_addr_you, tvb, offset, 26, ENC_NA);

View File

@ -5105,7 +5105,7 @@ guint c_dissect_msg_osd_op(proto_tree *root,
off = c_dissect_osd_flags(tree, tvb, off, data);
proto_tree_add_item(tree, hf_msg_osd_op_mtime,
tvb, off, 8, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
tvb, off, 8, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
off += 8;
off = c_dissect_eversion(tree, hf_msg_osd_op_reassert_version,

View File

@ -1696,7 +1696,7 @@ static const struct epl_datatype {
{ "Time_of_Day", &hf_epl_od_time, ENC_NA },
{ "Time_Diff", &hf_epl_od_time_difference, ENC_NA },
#endif
{ "NETTIME", &hf_epl_od_time, ENC_TIME_TIMESPEC, 8 },
{ "NETTIME", &hf_epl_od_time, ENC_TIME_SECS_NSECS, 8 },
{ 0, 0, 0, 0 }
};
@ -2766,10 +2766,10 @@ dissect_epl_soc(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint of
((EPL_SOC_MC_MASK & flags) >> 7), ((EPL_SOC_PS_MASK & flags) >> 6));
}
proto_tree_add_item(epl_tree, hf_epl_soc_nettime, tvb, offset, 8, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(epl_tree, hf_epl_soc_nettime, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 8;
proto_tree_add_item(epl_tree, hf_epl_soc_relativetime, tvb, offset, 8, ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN);
proto_tree_add_item(epl_tree, hf_epl_soc_relativetime, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
offset += 8;
return offset;

View File

@ -285,17 +285,17 @@ glusterfs_rpc_dissect_gf_iatt(proto_tree *tree, tvbuff_t *tvb, int hfindex,
if (tree)
proto_tree_add_item(iatt_tree, hf_glusterfs_ia_atime, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 8;
if (tree)
proto_tree_add_item(iatt_tree, hf_glusterfs_ia_mtime, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 8;
if (tree)
proto_tree_add_item(iatt_tree, hf_glusterfs_ia_ctime, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 8;
proto_item_set_len (iatt_item, offset - start_offset);

View File

@ -173,7 +173,7 @@ dissect_gmtlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gmhdr_tree, guint o
expert_add_info_format(pinfo, gmhdr_tree, &ei_gmhdr_field_length_invalid, "Field length %u invalid", fl);
break;
}
ti = proto_tree_add_item(gmhdr_tree, hf_gmhdr_timestamp, tvb, offset, fl, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
ti = proto_tree_add_item(gmhdr_tree, hf_gmhdr_timestamp, tvb, offset, fl, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
proto_item_append_text(ti, "; Source: %s", val_to_str_const(tl>>8, gmhdr_ftype_timestamp, "Unknown"));
break;
case GMHDR_FTYPE_FCS: {
@ -328,7 +328,7 @@ dissect_gmtimestamp_trailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
gmtrailer_tree = proto_item_add_subtree(ti, ett_gmtrailer);
proto_tree_add_item(gmtrailer_tree, hf_gmtrailer_origcrc, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(gmtrailer_tree, hf_gmtrailer_portid, tvb, offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(gmtrailer_tree, hf_gmtrailer_timestamp, tvb, offset+6, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
proto_tree_add_item(gmtrailer_tree, hf_gmtrailer_timestamp, tvb, offset+6, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
}
return 14;

View File

@ -1558,7 +1558,7 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui
tag_offset += tag_len;
break;
case TAG_CTIM:
proto_tree_add_item(tag_tree, hf_gquic_tag_ctim, tvb, tag_offset_start + tag_offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(tag_tree, hf_gquic_tag_ctim, tvb, tag_offset_start + tag_offset, 8, ENC_TIME_SECS_NSECS);
tag_offset += 8;
break;
case TAG_RNON: /* Public Reset Tag */

View File

@ -56,7 +56,7 @@ dissect_gsmtap_log(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * d
ti = proto_tree_add_item(tree, proto_gsmtap_log, tvb, 0, -1, ENC_NA);
log_tree = proto_item_add_subtree(ti, ett_gsmtap_log);
proto_tree_add_item(log_tree, hf_log_ts, tvb, offset, 8, ENC_TIME_TIMEVAL|ENC_BIG_ENDIAN);
proto_tree_add_item(log_tree, hf_log_ts, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN);
offset += 8;
proto_tree_add_item_ret_string(log_tree, hf_log_ident, tvb, offset, 16, ENC_NA, wmem_packet_scope(), &log_ident);
offset += 16;

View File

@ -187,7 +187,7 @@ dissect_ixiatrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, voi
break;
}
/* Timestamp */
ti = proto_tree_add_item(ixiatrailer_tree, hf_ixiatrailer_timestamp, tvb, offset, field_length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
ti = proto_tree_add_item(ixiatrailer_tree, hf_ixiatrailer_timestamp, tvb, offset, field_length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
proto_item_append_text(ti, "; Source: %s", val_to_str_const(field_type, ixiatrailer_ftype_timestamp, "Unknown"));
break;
default:

View File

@ -286,7 +286,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp1_q_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp1_unk, tvb,
@ -311,7 +311,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp2_q_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp2_unk, tvb,
@ -363,7 +363,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp1_r_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp1_unk, tvb,
@ -388,7 +388,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp2_r_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp2_unk, tvb,
@ -413,7 +413,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp3_r_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp3_unk, tvb,
@ -438,7 +438,7 @@ mpls_pm_dissect_timestamp(tvbuff_t *tvb, proto_tree *pm_tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp4_r_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_timestamp4_unk, tvb,
@ -598,7 +598,7 @@ dissect_mpls_pm_loss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case MPLS_PM_TSF_PTP:
proto_tree_add_item(pm_tree, hf_mpls_pm_origin_timestamp_ptp, tvb,
offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(pm_tree, hf_mpls_pm_origin_timestamp_unk, tvb,

View File

@ -6966,7 +6966,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case 37013: /* timestamp_interval */
/* XXX - what format is this in? */
ti = proto_tree_add_item(pdutree, hf_cflow_timestamp_interval,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case 37014: /* transport_packets_expected */
ti = proto_tree_add_item(pdutree, hf_cflow_transport_packets_expected,
@ -7553,49 +7553,49 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case (NTOP_BASE + 134): /* SIP_INVITE_TIME */
case ((VENDOR_NTOP << 16) | 134): /* SIP_INVITE_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_invite_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 135): /* SIP_TRYING_TIME */
case ((VENDOR_NTOP << 16) | 135): /* SIP_TRYING_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_trying_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 136): /* SIP_RINGING_TIME */
case ((VENDOR_NTOP << 16) | 136): /* SIP_RINGING_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_ringing_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 137): /* SIP_INVITE_OK_TIME */
case ((VENDOR_NTOP << 16) | 137): /* SIP_INVITE_OK_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_invite_ok_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 138): /* SIP_INVITE_FAILURE_TIME */
case ((VENDOR_NTOP << 16) | 138): /* SIP_INVITE_FAILURE_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_invite_failure_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 139): /* SIP_BYE_TIME */
case ((VENDOR_NTOP << 16) | 139): /* SIP_BYE_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_bye_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 140): /* SIP_BYE_OK_TIME */
case ((VENDOR_NTOP << 16) | 140): /* SIP_BYE_OK_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_bye_ok_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 141): /* SIP_CANCEL_TIME */
case ((VENDOR_NTOP << 16) | 141): /* SIP_CANCEL_TIME */
ti = proto_tree_add_item(pdutree, hf_pie_ntop_sip_cancel_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case (NTOP_BASE + 142): /* SIP_CANCEL_OK_TIME */
@ -9233,7 +9233,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case ((VENDOR_PLIXER << 16) | 111): /* origination_time */
/* XXX - what format is this? */
ti = proto_tree_add_item(pdutree, hf_pie_plixer_origination_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_PLIXER << 16) | 112): /* encryption */
ti = proto_tree_add_item(pdutree, hf_pie_plixer_encryption,
@ -9262,7 +9262,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case ((VENDOR_PLIXER << 16) | 117): /* date_time */
/* XXX - what format is this? */
ti = proto_tree_add_item(pdutree, hf_pie_plixer_date_time,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
/* END Plixer International */
@ -9723,7 +9723,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
* i.e. should it be ENC_TIME_SECS?
*/
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icasessionupdatebeginsec,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_NETSCALER << 16) | 224):
/*
@ -9731,7 +9731,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
* i.e. should it be ENC_TIME_SECS?
*/
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icasessionupdateendsec,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_NETSCALER << 16) | 225):
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icachannelid1,
@ -9792,7 +9792,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case ((VENDOR_NETSCALER << 16) | 239):
/* XXX - what format is this? */
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_applicationstartuptime,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_NETSCALER << 16) | 240):
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icaapplicationterminationtype,
@ -9853,12 +9853,12 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
case ((VENDOR_NETSCALER << 16) | 254):
/* XXX - what format is this? */
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icanetworkupdatestarttime,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_NETSCALER << 16) | 255):
/* XXX - what format is this? */
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icanetworkupdateendtime,
tvb, offset, length, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset, length, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
break;
case ((VENDOR_NETSCALER << 16) | 256):
ti = proto_tree_add_item(pdutree, hf_pie_netscaler_icaclientsidesrtt,

View File

@ -1307,7 +1307,7 @@ dissect_nfq_attrs(tvbuff_t *tvb, void *data, proto_tree *tree, int nla_type, int
case WS_NFQA_TIMESTAMP:
if (len == 16) {
proto_tree_add_item(tree, &hfi_nfq_timestamp, tvb, offset, 16, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
proto_tree_add_item(tree, &hfi_nfq_timestamp, tvb, offset, 16, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 16;
}
break;

View File

@ -264,7 +264,7 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
if (value_len == 16) {
/* XXX - add an "expert info" warning if the nanoseconds are >= 10^9? */
proto_tree_add_item(tlv_tree, &hfi_nflog_tlv_timestamp,
tvb, offset + 4, value_len, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
tvb, offset + 4, value_len, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
handled = TRUE;
}
break;

View File

@ -827,7 +827,7 @@ dissect_rpcap_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
ti = proto_tree_add_item (parent_tree, hf_packet, tvb, offset, 20, ENC_NA);
tree = proto_item_add_subtree (ti, ett_packet);
proto_tree_add_item(tree, hf_timestamp, tvb, offset, 8, ENC_TIME_TIMEVAL|ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_timestamp, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN);
offset += 8;
caplen = tvb_get_ntohl (tvb, offset);

View File

@ -133,7 +133,7 @@ dissect_rtacser_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Time-stamp is stored as 2 x 32-bit unsigned integers, the left and right-hand side of the decimal point respectively */
/* The format mirrors the timeval struct - absolute Epoch time (seconds since 1/1/1970) with an added microsecond component */
proto_tree_add_item(rtacser_tree, hf_rtacser_timestamp, tvb, offset, 8, ENC_TIME_TIMEVAL|ENC_BIG_ENDIAN);
proto_tree_add_item(rtacser_tree, hf_rtacser_timestamp, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN);
offset += 8;
/* Set INFO column with RTAC Serial Event Type */

View File

@ -161,7 +161,7 @@ dissect_sebek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree_add_item(sebek_tree, hf_sebek_counter, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 8;
proto_tree_add_item(sebek_tree, hf_sebek_pid, tvb, offset, 4, ENC_BIG_ENDIAN);
@ -196,7 +196,7 @@ dissect_sebek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree_add_item(sebek_tree, hf_sebek_counter, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
offset += 8;
proto_tree_add_item(sebek_tree, hf_sebek_ppid, tvb, offset, 4, ENC_BIG_ENDIAN);

View File

@ -962,7 +962,7 @@ static void dissect_uftp_announce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
offset += 1;
proto_tree_add_item(announce_tree, hf_uftp_announce_blocksize, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(announce_tree, hf_uftp_announce_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(announce_tree, hf_uftp_announce_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
offset += 8;
if (flags & FLAG_IPV6) {
iplen = 16;
@ -1038,7 +1038,7 @@ static void dissect_uftp_register(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
offset += 1;
proto_tree_add_item(register_tree, hf_uftp_register_keyinfo_len, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(register_tree, hf_uftp_register_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(register_tree, hf_uftp_register_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
offset += 8;
proto_tree_add_item(register_tree, hf_uftp_register_rand2, tvb, offset, RAND_LEN, ENC_NA);
offset += RAND_LEN;
@ -1288,7 +1288,7 @@ static void dissect_uftp_fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += 6;
proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftstamp, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
offset += 8;
proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_name, tvb, offset, namelen, ENC_ASCII|ENC_NA);
offset += namelen;
@ -1348,7 +1348,7 @@ static void dissect_uftp_fileinfoack(tvbuff_t *tvb, packet_info *pinfo, proto_tr
offset += 1;
proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_reserved, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
destcount = (tvb_reported_length(tvb) - hlen) / 4;
offset = hlen;
@ -1556,7 +1556,7 @@ static gint dissect_uftp_tfmccack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
offset += 2;
proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_client_id, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
return TFMCC_ACK_LEN;
}
@ -2006,7 +2006,7 @@ static void dissect_uftp_congctrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
offset += 2;
proto_tree_add_uint(congctrl_tree, hf_uftp_congctrl_cc_rate, tvb, offset, 2, rate);
offset += 2;
proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_tstamp, tvb, offset, 8, ENC_TIME_TIMESPEC);
proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_tstamp, tvb, offset, 8, ENC_TIME_SECS_NSECS);
itemcount = (tvb_reported_length(tvb) - hlen) / CC_ITEM_LEN;
offset = hlen;

View File

@ -1670,7 +1670,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
switch (encoding) {
case ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN:
case ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN:
/*
* If the length is 16, 8-byte seconds, followed
* by 8-byte fractional time in nanoseconds,
@ -1699,7 +1699,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
} else if (length == 4) {
/*
* Backwards compatibility.
* ENC_TIME_TIMESPEC is 0; using
* ENC_TIME_SECS_NSECS is 0; using
* ENC_BIG_ENDIAN by itself with a 4-byte
* time-in-seconds value was done in the
* past.
@ -1710,7 +1710,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
report_type_length_mismatch(tree, "a timespec", length, (length < 4));
break;
case ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN:
case ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN:
/*
* If the length is 16, 8-byte seconds, followed
* by 8-byte fractional time in nanoseconds,
@ -1739,7 +1739,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
} else if (length == 4) {
/*
* Backwards compatibility.
* ENC_TIME_TIMESPEC is 0; using
* ENC_TIME_SECS_NSECS is 0; using
* ENC_LITTLE_ENDIAN by itself with a 4-byte
* time-in-seconds value was done in the
* past.
@ -1897,7 +1897,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
report_type_length_mismatch(tree, "an RTPS time stamp", length, (length < 4));
break;
case ENC_TIME_TIMEVAL|ENC_BIG_ENDIAN:
case ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN:
/*
* 4-byte seconds, followed by 4-byte fractional
* time in microseconds, both big-endian.
@ -1911,7 +1911,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
report_type_length_mismatch(tree, "a timeval", length, (length < 4));
break;
case ENC_TIME_TIMEVAL|ENC_LITTLE_ENDIAN:
case ENC_TIME_SECS_USECS|ENC_LITTLE_ENDIAN:
/*
* 4-byte seconds, followed by 4-byte fractional
* time in microseconds, both little-endian.
@ -2547,7 +2547,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
* so that passing TRUE is interpreted as that.
*/
if (encoding == TRUE)
encoding = ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN;
encoding = ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN;
get_time_value(tree, tvb, start, length, encoding, &time_stamp, FALSE);
@ -2569,7 +2569,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
* so that passing TRUE is interpreted as that.
*/
if (encoding == TRUE)
encoding = ENC_TIME_TIMESPEC|ENC_LITTLE_ENDIAN;
encoding = ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN;
get_time_value(tree, tvb, start, length, encoding, &time_stamp, TRUE);

View File

@ -348,10 +348,10 @@ void proto_report_dissector_bug(const char *format, ...)
*
* We now support:
*
* ENC_TIME_TIMESPEC - 8, 12, or 16 bytes. For 8 bytes, the first 4 bytes
* are seconds and the next 4 bytes are nanoseconds; for 12 bytes, the
* first 8 bytes are seconds and the next 4 bytes are nanoseconds; for
* 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
* ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
* bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
* the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
* for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
* nanoseconds. If the time is absolute, the seconds are seconds since
* the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
* timespec with a 4-byte or 8-byte time_t or a structure with an
@ -372,7 +372,7 @@ void proto_report_dissector_bug(const char *format, ...)
* NTP time.) It's used by the Object Management Group's Real-Time
* Publish-Subscribe Wire Protocol for the Data Distribution Service.
*
* ENC_TIME_TIMEVAL - 8 bytes; the first 4 bytes are seconds and the
* ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
* next 4 bytes are microseconds. If the time is absolute, the seconds
* are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
* a 4-byte time_t.)
@ -392,13 +392,19 @@ void proto_report_dissector_bug(const char *format, ...)
*
* ENC_TIME_MSEC_NTP - 4-8 bytes, representing a count of milliseconds since
* the NTP epoch. (I.e., milliseconds since the NTP epoch.)
*
* The backwards-compatibility names are defined as hex numbers so that
* the script to generate init.lua will add them as global variables,
* along with the new names.
*/
#define ENC_TIME_TIMESPEC 0x00000000
#define ENC_TIME_SECS_NSECS 0x00000000
#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
#define ENC_TIME_NTP 0x00000002
#define ENC_TIME_TOD 0x00000004
#define ENC_TIME_RTPS 0x00000008
#define ENC_TIME_NTP_BASE_ZERO ENC_TIME_RTPS /* for backwards source compatibility */
#define ENC_TIME_TIMEVAL 0x00000010
#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
#define ENC_TIME_SECS_USECS 0x00000010
#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
#define ENC_TIME_SECS 0x00000012
#define ENC_TIME_MSECS 0x00000014
#define ENC_TIME_SECS_NTP 0x00000018

View File

@ -59,7 +59,7 @@ my %DISPLAY_BASE = ('BASE_NONE' => "BASE_NONE",
my %ENCODINGS = ('ENC_BIG_ENDIAN' => "ENC_BIG_ENDIAN",
'ENC_LITTLE_ENDIAN' => "ENC_LITTLE_ENDIAN",
'ENC_TIME_TIMESPEC' => "ENC_TIME_TIMESPEC",
'ENC_TIME_SECS_NSECS' => "ENC_TIME_SECS_NSECS",
'ENC_TIME_NTP' => "ENC_TIME_NTP",
'ENC_ASCII' => "ENC_ASCII",
'ENC_UTF_8' => "ENC_UTF_8",