Generating random packets with certain characteristics and writing them to pcap file

Discussion in 'C Programming' started by cowboy2474, Oct 2, 2013.

  1. cowboy2474

    cowboy2474

    Joined:
    Oct 2, 2013
    Messages:
    1
    Likes Received:
    0
    Hi,

    I'm trying to generate random packets (not so much random in contents but more so random in wait times between them) and output them to a pcap file.

    Is there any way to do this using the libpcap library? I know I've included a <pcap.h> in the past to read through existing pcap files and traverse the packets in a sequential manner (to replay them back out), but what about generating random timestamps and writing certain payloads to a pcap file? I want to be able to do this for arbitrary Ethernet frames (not just IP, UDP, TCP, etc. just the raw Ethernet frames), and provide microsecond timestamps.

    Any experience with this? Am I better off doing this in a language like Python (or Haskell, etc.) -- is there an easier way in one of those?

    Thank you all!

    Cheers
     
    cowboy2474, Oct 2, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Eiland
    Replies:
    0
    Views:
    573
    Earl Eiland
    Feb 9, 2005
  2. pavel.orehov@gmail.com

    Parse pcap Ethereal file SNMP messages

    pavel.orehov@gmail.com, Oct 2, 2007, in forum: Java
    Replies:
    5
    Views:
    1,538
    pavel.orehov@gmail.com
    Nov 13, 2007
  3. globalrev
    Replies:
    4
    Views:
    1,115
    Gabriel Genellina
    Apr 20, 2008
  4. Joop Van den tillaart

    Generate a grid of cells, and give characteristics

    Joop Van den tillaart, Jun 12, 2007, in forum: Ruby
    Replies:
    11
    Views:
    374
    Joop Van den tillaart
    Jun 15, 2007
  5. SAN CAZIANO
    Replies:
    8
    Views:
    454
    Dr John Stockton
    Oct 15, 2004
  6. shahriar_saberi@yahoo.com
    Replies:
    13
    Views:
    423
    Paul Lalli
    Jul 25, 2005
  7. ryan
    Replies:
    1
    Views:
    261
    Mumia W.
    May 30, 2007
  8. VK
    Replies:
    15
    Views:
    2,050
    Dr J R Stockton
    May 2, 2010
Loading...