Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* tcpdump/packet_ioctl: SIOCGSTAMP
@ 1999-07-20  4:00 Brian Hazzard
  0 siblings, 0 replies; only message in thread
From: Brian Hazzard @ 1999-07-20  4:00 UTC (permalink / raw)


Hi,

I am running tcpdump on an alpha running linux 2.2.10.  
The tcpdump timestamp is in seconds.  Has anyone been able to
get usec timestamps on linux alphas???

Thanks,
Brian

PS. I am running tcpdump-3.4 and libpcap-0.4.  libpcap makes an ioctl
to packet_ioctl (in af_packet.c) to get the timestamp 
(passing a reference to a timeval structure).  Inserting a 
printk in af_packet.c for the SIOCGSTAMP ioctl shows both 
the sk->stamp.tv_sec and sk->stamp.tv_usec fields are
filled in.  Unfortunately, inserting a printf after the ioctl call 
in libpcap shows the usec field is zero.  Is there a problem with 
passing data structures this way using copy_to_user for alphas?

from libpcap
-----------------
                /* Get timestamp */
                if (ioctl(p->fd, SIOCGSTAMP, &h.ts) < 0) {
                        sprintf(p->errbuf, "SIOCGSTAMP: %s",
                            pcap_strerror(errno));
                        return (-1);
                }
from af_packet.c
-----------------
                case SIOCGSTAMP:
                        if(sk->stamp.tv_sec==0)
                                return -ENOENT;
                        err = -EFAULT;

                        if (!copy_to_user((void *)arg, &sk->stamp,
sizeof(struct timeval)))
                                err = 0;
                        return err;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-07-20  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-20  4:00 tcpdump/packet_ioctl: SIOCGSTAMP Brian Hazzard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox