ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-users: Re: [Wireshark-users] C++ program using"editcap"

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 20 Mar 2009 10:42:47 -0700

On Mar 20, 2009, at 1:54 AM, Faten SOLTANI wrote:

I'll need to use the EDITCAP to convert files from ASCII format to pcap
format, I need a help about writing a C++ program, where I call the
editpcap function,

Editcap is a program, not a function; you "call" it by using, for example, fork()/exec() or vfork()/exec() - or, if you have it, posix_spawn() - on UN*X, or CreateProcess() on Windows. You'd then wait for the program to finish and the process running it to terminate.

and where the input file must be located(in the same
folder as the function editpcap?).

The input file can be located anywhere; one of the arguments to the editcap program is the pathname of the input file.