|
|
@ -1,7 +1,7 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include "./helper/exec.hpp"
|
|
|
|
#include "./helper/exec.hpp"
|
|
|
|
|
|
|
|
#include "./handler/asyncHandler.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
const std::string tcpdump_baseCmd = "tcpdump -vvv -e -n -X -s0 -i ";
|
|
|
|
const std::string tcpdump_baseCmd = "tcpdump -vvv -e -n -X -s0 -i ";
|
|
|
|
|
|
|
|
|
|
|
@ -14,9 +14,9 @@ int main(int argc, char *args[]){
|
|
|
|
fprintf(stderr, "Missing interface\n");
|
|
|
|
fprintf(stderr, "Missing interface\n");
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int exitCode = exec(tcpdump_cmd.c_str());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int exitCode = exec(tcpdump_cmd.c_str(), &asyncHandler);
|
|
|
|
|
|
|
|
|
|
|
|
if(exitCode){
|
|
|
|
if(exitCode){
|
|
|
|
fprintf(stderr, "\ntcpdump exited with non-zero ExitCode: %d\n Something went wrong! Check tcpdump-output for more information.\n", exitCode);
|
|
|
|
fprintf(stderr, "\ntcpdump exited with non-zero ExitCode: %d\n Something went wrong! Check tcpdump-output for more information.\n", exitCode);
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|