aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/nettl.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-24 21:31:56 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-24 21:31:56 +0000
commite7e62591fe23566d2bb5685ade31d2a925ed726c (patch)
tree7be99a00405385c14e1606c31906463d60107655 /wiretap/nettl.c
parent6f063a4571dad2e3d8681d4ce6b1114bcc1b811b (diff)
EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/nettl.c')
-rw-r--r--wiretap/nettl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/wiretap/nettl.c b/wiretap/nettl.c
index 22d54d5148..75ffb9e1ca 100644
--- a/wiretap/nettl.c
+++ b/wiretap/nettl.c
@@ -501,8 +501,8 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
phdr->caplen = pntohl(&ip_hdr.caplen);
}
- phdr->ts.tv_sec = pntohl(&ip_hdr.sec);
- phdr->ts.tv_usec = pntohl(&ip_hdr.usec);
+ phdr->ts.secs = pntohl(&ip_hdr.sec);
+ phdr->ts.nsecs = pntohl(&ip_hdr.usec) * 1000;
break;
case NETTL_SUBSYS_NS_LS_DRIVER :
@@ -546,8 +546,8 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
phdr->len = length;
phdr->caplen = pntohs(&drv_eth_hdr.caplen);
- phdr->ts.tv_sec = pntohl(&ip_hdr.sec);
- phdr->ts.tv_usec = pntohl(&ip_hdr.usec);
+ phdr->ts.secs = pntohl(&ip_hdr.sec);
+ phdr->ts.nsecs = pntohl(&ip_hdr.usec) * 1000;
break;
case NETTL_SUBSYS_SX25L2:
@@ -567,8 +567,8 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (length <= 0) return 0;
phdr->len = length - 24;
phdr->caplen = pntohl(&ip_hdr.caplen) - 24;
- phdr->ts.tv_sec = pntohl(&ip_hdr.sec);
- phdr->ts.tv_usec = pntohl(&ip_hdr.usec);
+ phdr->ts.secs = pntohl(&ip_hdr.sec);
+ phdr->ts.nsecs = pntohl(&ip_hdr.usec) * 1000;
if (wth->capture.nettl->is_hpux_11)
padlen = 28;
else
@@ -596,8 +596,8 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (length <= 0) return 0;
phdr->len = length;
phdr->caplen = pntohl(&ip_hdr.caplen);
- phdr->ts.tv_sec = pntohl(&ip_hdr.sec);
- phdr->ts.tv_usec = pntohl(&ip_hdr.usec);
+ phdr->ts.secs = pntohl(&ip_hdr.sec);
+ phdr->ts.nsecs = pntohl(&ip_hdr.usec) * 1000;
if (wth->capture.nettl->is_hpux_11) {
if (file_seek(fh, 4, SEEK_CUR, err) == -1) return -1;
offset += 4;
@@ -737,8 +737,8 @@ static gboolean nettl_dump(wtap_dumper *wdh,
memset(&rec_hdr,0,sizeof(rec_hdr));
rec_hdr.hdr_len = g_htons(sizeof(rec_hdr));
rec_hdr.hdr.kind = g_htonl(NETTL_HDR_PDUIN);
- rec_hdr.hdr.sec = g_htonl(phdr->ts.tv_sec);
- rec_hdr.hdr.usec = g_htonl(phdr->ts.tv_usec);
+ rec_hdr.hdr.sec = g_htonl(phdr->ts.secs);
+ rec_hdr.hdr.usec = g_htonl(phdr->ts.nsecs/1000);
rec_hdr.hdr.caplen = g_htonl(phdr->caplen);
rec_hdr.hdr.length = g_htonl(phdr->len);
rec_hdr.hdr.devid = -1;