X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2FpcapDecoder%2Fmain.cpp;h=cdada35bbab9c6d99e992a982685bb22e2471b53;hp=377b31705904d91d654845541c2205a1998f54e8;hb=7ee10b64f4c116460ffef5784eb9ef87d3f2339c;hpb=1a1b334a0d2b023bd778f0a19665cc9017dbc94a diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 377b317..cdada35 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -179,12 +179,10 @@ struct sniff_tcp { u_char *getPayload(const u_char* packet, int packetSize, int &payloadSize, std::string &srcIp, std::string &dstIp, int &fragmentId, bool &dfFlag, bool &mfFlag, int &fragmentOffset) { - const struct sniff_ethernet *ethernet; /* The ethernet header */ const struct sniff_ip *ip; /* The IP header */ const struct sniff_tcp *tcp; /* The TCP header */ u_int size_ip; u_int size_tcp; - ethernet = (struct sniff_ethernet*)(packet); ip = (struct sniff_ip*)(packet + SIZE_ETHERNET); size_ip = IP_HL(ip) * 4; // 4 bytes per 32 bits word @@ -306,7 +304,7 @@ int main(int argc, char **argv) { // Command-line parameters: std::string inputFile = argv[1]; - bool isHex = (inputFile.substr(inputFile.find_last_of(".") + 1) == "hex"); + //bool isHex = (inputFile.substr(inputFile.find_last_of(".") + 1) == "hex"); std::string outputFile = inputFile; // extension will be added later std::string optionals; int indx = 2; @@ -321,8 +319,8 @@ int main(int argc, char **argv) { // SNIFFING //////////////////////////////////////////////////////////////////////////////////////////////7 //temporary packet buffers - struct pcap_pkthdr header; // The header that pcap gives us - const u_char *packet; // The actual packet + //struct pcap_pkthdr header; // The header that pcap gives us + //const u_char *packet; // The actual packet //------------------ //open the pcap file pcap_t *handle;