To run the program do the following from terminal: $ make $ ./hostman
This contains the source code of a simple TCP/IP packet analyzer. Its properties are:
- Will work for LINUX systems (due to using console color in followPacketStream.c. Removing console color will make it work in windows)
- GCC compiler works fine. MinGW will casue problem as the function fmemopen(), used in miscFunctions.c is not supported by MinGW
- It does not capture packets. It only analyzes packets from a captured PCAP file
- Command line driven program
- Source code contains 12 files (8 .c files, 4 .h files) included with Makefile. See Source file explanation below to see the details of what each of them files does
- Has options to view packet file data in several formats.
Compile the file using the provided make.
- main.c: Checks for valid pcap file and valid cmd argument. If both are valid function in another src file is called
- printUsage.c: Prints the usage (which commands invoke which functions)
- miscFunctions.c: Contains miscellaneous functions that are required by other source files
- packetBasicInfo.c: Prints source ip, destination ip, protocol, and size of each packet
- packetDetails.c: Prints the details of each packets (all info of all the fields, including payload)
- packetDump.c: Prints the hexdump of the packets along with their corresponding printable ASCII characters
- packetSearch.c: Can search the PCAP file for packets by their IP or a string in their payload
- followStream.c: Prints the conversation between two particular hosts in two different colors