protocol testing...

This is a discussion on protocol testing... within the Linux Programming forums, part of the Platform Specific Boards category; hello, may be someone know, how I can send packets from collected(via tcpdump) those before in pcap-dump to my target ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    77

    protocol testing...

    hello, may be someone know, how I can send packets from collected(via tcpdump) those before in pcap-dump to my target ip? I need this for testing my program with specify protocol without real interaction.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Quote Originally Posted by quantt View Post
    hello, may be someone know, how I can send packets from collected(via tcpdump) those before in pcap-dump to my target ip? I need this for testing my program with specify protocol without real interaction.
    Take WinPCAP SDK (sorry - take PCAP lib for linux), take sample code that reads packets from the dump file, write application using this sample, that will read packets and then send them to the preconfigured port...

    As a starting point look for function pcap_open_offline
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    77
    thanks for your reply, but how I can change addres while reading from the dump?

    I'm collecting the data to pcap_t and then injecting it and there I'm unsure with 2 and 3 arguments, where I can get it?

    pcap_t *p;
    // int pcap_inject(pcap_t *p, const void *buf, size_t size)
    sentbytes=pcap_inject(p, (void*)&data , sizeof(data) ));

    and more over, I can't change second argument, because it's a const.

    actually, I can filtering the dump by this...
    pcap_compile();
    pcap_setfilter();

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Software Testing, references & bibliography
    By Mario F. in forum Tech Board
    Replies: 5
    Last Post: 08-23-2009, 10:51 PM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 02:58 PM
  3. C++ bit testing
    By Vicious in forum C++ Programming
    Replies: 3
    Last Post: 09-19-2004, 12:44 PM
  4. Blending and Depth Testing
    By Thunderco in forum Game Programming
    Replies: 2
    Last Post: 03-08-2004, 06:37 PM
  5. about testing a program
    By Abdi in forum C Programming
    Replies: 1
    Last Post: 06-09-2002, 01:51 AM

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