MAC Timestamp

This is a discussion on MAC Timestamp within the Networking/Device Communication forums, part of the General Programming Boards category; Hello, im trying to create an application that it will get the MAC timestamp from a packet, like in wireshark. ...

  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
    4,415
    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
    32,833
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 04:41 PM
  2. Timestamp as filename
    By d_boggus in forum C Programming
    Replies: 2
    Last Post: 05-19-2010, 03:05 AM
  3. about timestamp
    By George2 in forum C Programming
    Replies: 2
    Last Post: 08-16-2006, 07:59 AM
  4. access timestamp
    By Jalabert in forum Windows Programming
    Replies: 2
    Last Post: 06-02-2005, 09:02 AM
  5. making a timestamp
    By karmatic in forum C Programming
    Replies: 6
    Last Post: 04-11-2003, 11:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21