[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] web-server example

From: Steffen Damelang
Subject: [lwip-users] web-server example
Date: Mon, 20 Mar 2006 17:04:58 +0100

Hi lwip-users ...
my lwIP-stack is running with arp and icmp. I had to change a little bit in the 
etharp_arp_input to get it work.
Now I have a problem with the webserver example in the lwip-documentation 
"Design and Implementation of the lwIP TCP/IP-Stack"
I want to to interfacce the stack directly.
my http_init look like this:
struct tcp_pcb *pcb;
pcb = tcp_new();
tcp_bind(pcb, IP_ADDR_ANY, 80);
pcb = tcp_listen(pcb);
tcp_accept(pcb, http_accept);

If I point to the lwip-device with my browser I come into the 
http_accept_function which sets the callback for receiving:

tcp_recv(pcb, http_recv);

Now I came to the tcp_recv_function.

I want to send out a little testpage:

const char indexdata[] = "HTTP/1.0 200 OK\r\n\
Content-Type: text/html\r\n\
<head><title>A test page</head></title>\
This is a small testpage. \

I call tcp_write(pcb, &indexdata, sizeof(indexdata)) to enqeue the data. Later 
I call tcp_output(pcb) to send it.
Now here comes the problem. I think tcp_output does not apply any ethernet 
header to the frame. In ethereal I can see the data as a packet exactly like 
indexdata ...

Does anybody know this problem and know where to look?

Thanks for help ...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]