Thread: MAC Timestamp

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    12

    MAC Timestamp

    Hello,
    im trying to create an application that it will get the MAC timestamp from a packet, like in wireshark. Unfortunately i haven't found anything yet that it will allow me to acquire the MAC Timestamp using an Ansi C or C++ application.
    Any suggestions or recommendations?
    Thank you

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    You aren't likely going to be able to do this without a tool similar to what "Wireshark" does already in place.

    It is essentially a matter of privileges. A "userland" tool does not have such privileges. A driver may have such privileges and can export an interface for "userland" code.

    I strongly suggest you just use "Wireshark". It is a pretty awesome tool.

    Soma

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Wireshark uses the pcap driver - perhaps you can as well.

    There's plenty of information on the web how to do this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Depending on what OS you're using, this may be possible without any external APIs.

    For Linux, you'll want to create a PF_PACKET socket and bind it to an ethernet interface. There's many tutorials on how to do this online.

    Mac OS uses the Berkeley Packet Filter ("/dev/bpf0") that will (like Linux) provide a raw socket that intercepts all levels of transmission on the interface.

    Windows....no idea. You could google it though.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is this a timestamp?
    By NewnOT in forum Tech Board
    Replies: 11
    Last Post: 09-21-2010, 03:41 PM
  2. Timestamp as filename
    By d_boggus in forum C Programming
    Replies: 2
    Last Post: 05-19-2010, 02:05 AM
  3. about timestamp
    By George2 in forum C Programming
    Replies: 2
    Last Post: 08-16-2006, 06:59 AM
  4. access timestamp
    By Jalabert in forum Windows Programming
    Replies: 2
    Last Post: 06-02-2005, 08:02 AM
  5. making a timestamp
    By karmatic in forum C Programming
    Replies: 6
    Last Post: 04-11-2003, 10:05 PM