Port of LwIP performed by Ralf in 2010. Not recommended for use with recent mbed libraries, but good demos of raw LwIP possible
Dependents: LwIP_raw_API_serverExample tiny-dtls
HTTPServer/HTTPLog.h@0:0791c1fece8e, 2012-09-18 (annotated)
- Committer:
- RodColeman
- Date:
- Tue Sep 18 14:41:24 2012 +0000
- Revision:
- 0:0791c1fece8e
[mbed] converted /Eth_TCP_Wei_Server/lwip
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RodColeman | 0:0791c1fece8e | 1 | #ifndef HTTPLOG_H |
RodColeman | 0:0791c1fece8e | 2 | #define HTTPLOG_H |
RodColeman | 0:0791c1fece8e | 3 | |
RodColeman | 0:0791c1fece8e | 4 | #include "HTTPServer.h" |
RodColeman | 0:0791c1fece8e | 5 | |
RodColeman | 0:0791c1fece8e | 6 | class HTTPLog : public HTTPHandler { |
RodColeman | 0:0791c1fece8e | 7 | public: |
RodColeman | 0:0791c1fece8e | 8 | HTTPLog(const char *prefix) : HTTPHandler(prefix) {} |
RodColeman | 0:0791c1fece8e | 9 | HTTPLog(HTTPServer *server, const char *prefix) : HTTPHandler(prefix) { server->addHandler(this); } |
RodColeman | 0:0791c1fece8e | 10 | |
RodColeman | 0:0791c1fece8e | 11 | private: |
RodColeman | 0:0791c1fece8e | 12 | virtual HTTPHandle action(HTTPConnection *con) const { |
RodColeman | 0:0791c1fece8e | 13 | struct ip_addr ip = con->pcb()->remote_ip; |
RodColeman | 0:0791c1fece8e | 14 | printf("%hhu.%hhu.%hhu.%hhu %s %s", (ip.addr)&0xFF, (ip.addr>>8)&0xFF, (ip.addr>>16)&0xFF, (ip.addr>>24)&0xFF, (con->getType() == POST? "POST" : "GET"), con->getURL()); |
RodColeman | 0:0791c1fece8e | 15 | return HTTP_AddFields; |
RodColeman | 0:0791c1fece8e | 16 | } |
RodColeman | 0:0791c1fece8e | 17 | }; |
RodColeman | 0:0791c1fece8e | 18 | |
RodColeman | 0:0791c1fece8e | 19 | #endif |