LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   compose a HTTP object from raw IP packets (https://www.linuxquestions.org/questions/linux-networking-3/compose-a-http-object-from-raw-ip-packets-4175466485/)

piphonom 06-18-2013 08:34 AM

compose a HTTP object from raw IP packets
 
Hello! I'm developing a C program that should build HTTP objects from raw IP packets stream. As I understand it's not a trivial task for userspace but it is interesting for me. Does somebody know about some application that do the same job? The same task for example do Wireshark. But Wireshark has very complicated to understand sources because it supports a lot of different protocols and is written to be cross platform.
And also I'm interesting some C library that will help me to parse HTTP objects. I found two diffrernt libraries with the name libhttp, one for C++, and one for C. And unfotunetly C library is still not complited.
I will be appreciated for any suggestions!

nini09 06-18-2013 02:30 PM

If raw IP packet will make code complicated, TCP socket can save IP and TCP header.

Following link can make you build HTTP server or client much easy.
http://www.jmarshall.com/easy/http/

Another library is good choice, libebb.
libebb is a lightweight HTTP server library for C. It lays the foundation for writing a web server by providing the socket juggling and request parsing. By implementing the HTTP/1.1 grammar provided in RFC2612, libebb understands most most valid HTTP/1.1 connections (persistent, pipelined, and chunked requests included) and rejects invalid or malicious requests. libebb supports SSL over HTTP.


All times are GMT -5. The time now is 09:03 PM.