diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-28 11:37:06 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-28 18:38:18 +0000 |
commit | 54b733ce9a0d1cd4ab9b142479368a5e696360be (patch) | |
tree | 1c98ec83c70ba99b383105516048d0254168d855 /epan/wslua/wslua_file.c | |
parent | efea8ce1c6a4331bc2ff7090dd3dadd2a80f6d86 (diff) |
Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution. Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.
Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display". Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.
Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/wslua/wslua_file.c')
-rw-r--r-- | epan/wslua/wslua_file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/wslua/wslua_file.c b/epan/wslua/wslua_file.c index f83eb29d20..81347aaae0 100644 --- a/epan/wslua/wslua_file.c +++ b/epan/wslua/wslua_file.c @@ -705,7 +705,7 @@ static CaptureInfo* push_CaptureInfo(lua_State* L, wtap *wth, const gboolean fir if (first_time) { /* XXX: need to do this? */ wth->file_encap = WTAP_ENCAP_UNKNOWN; - wth->tsprecision = WTAP_FILE_TSPREC_SEC; + wth->file_tsprec = WTAP_TSPREC_UNKNOWN; wth->snapshot_length = 0; } @@ -720,8 +720,8 @@ WSLUA_METAMETHOD CaptureInfo__tostring(lua_State* L) { lua_pushstring(L,"CaptureInfo pointer is NULL!"); } else { wtap *wth = fi->wth; - lua_pushfstring(L, "CaptureInfo: file_type_subtype=%d, snapshot_length=%d, pkt_encap=%d, tsprecision='%s'", - wth->file_type_subtype, wth->snapshot_length, wth->phdr.pkt_encap, wth->tsprecision); + lua_pushfstring(L, "CaptureInfo: file_type_subtype=%d, snapshot_length=%d, pkt_encap=%d, file_tsprec='%s'", + wth->file_type_subtype, wth->snapshot_length, wth->phdr.pkt_encap, wth->file_tsprec); } WSLUA_RETURN(1); /* String of debug information. */ @@ -747,8 +747,8 @@ WSLUA_ATTRIBUTE_NAMED_NUMBER_SETTER(CaptureInfo,encap,wth->file_encap,int); See `wtap_file_tsprec` in `init.lua` for available precisions. */ -WSLUA_ATTRIBUTE_NAMED_NUMBER_GETTER(CaptureInfo,time_precision,wth->tsprecision); -WSLUA_ATTRIBUTE_NAMED_NUMBER_SETTER(CaptureInfo,time_precision,wth->tsprecision,int); +WSLUA_ATTRIBUTE_NAMED_NUMBER_GETTER(CaptureInfo,time_precision,wth->file_tsprec); +WSLUA_ATTRIBUTE_NAMED_NUMBER_SETTER(CaptureInfo,time_precision,wth->file_tsprec,int); /* WSLUA_ATTRIBUTE CaptureInfo_snapshot_length RW The maximum packet length that could be recorded. @@ -979,7 +979,7 @@ WSLUA_METAMETHOD CaptureInfoConst__tostring(lua_State* L) { lua_pushstring(L,"CaptureInfoConst pointer is NULL!"); } else { wtap_dumper *wdh = fi->wdh; - lua_pushfstring(L, "CaptureInfoConst: file_type_subtype=%d, snaplen=%d, encap=%d, compressed=%d, tsprecision='%s'", + lua_pushfstring(L, "CaptureInfoConst: file_type_subtype=%d, snaplen=%d, encap=%d, compressed=%d, file_tsprec='%s'", wdh->file_type_subtype, wdh->snaplen, wdh->encap, wdh->compressed, wdh->tsprecision); } |