Stefan Schuermans
header fix
Stefan Schuermans commited d48e86e at 2012-05-02 18:39:39
/* flaneth - flash and ethernet
Copyright (C) 2007-2012 Stefan Schuermans <stefan@schuermans.info>
Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html
a BlinkenArea project - http://www.blinkenarea.org/ */
#include <string.h>
#include <avr/pgmspace.h>
#include "debug.h"
#include "http.h"
#include "macros.h"
#include "tcp.h"
// receive states while parsing HTTP request
#define HTTP_RCV_CMD 0 // receiving HTTP command (e.g. GET)
#define HTTP_RCV_FILE 1 // receiving filename
#define HTTP_RCV_HDR_END 2 // receiving header until end
#define HTTP_RCV_DONE 3 // receiving completed
// knwon HTTP commands
#define HTTP_CMD_UNKNOWN 0 // unknown HTTP command
#define HTTP_CMD_GET 1 // GET command
// files available using HTTP
#define HTTP_FILE_NOT_FOUND 0 // file not found file
#define HTTP_FILE_INDEX 1 // index file
#define HTTP_FILE_ON_ALL 2 // turn on all link
#define HTTP_FILE_ON_SINGLE 3 // turn on single links (+0..+7)
#define HTTP_FILE_OFF_ALL 11 // turn off all link
#define HTTP_FILE_OFF_SINGLE 12 // turn off single links (+0..+7)
#define HTTP_FILE_IMG1 20 // image: on
#define HTTP_FILE_IMG0 21 // image: off
// content of webpages and strings to fill in for variables
#include "http_content.inc"
// table with HTTP connections
struct HttpConnection {
unsigned char ConnNo; // number of the TCP connection, 0xFF is unused
unsigned long RcvCnt; // number of received bytes on connection
unsigned char RcvState; // what is being received at the moment
unsigned char RcvBuf[16]; // receive buffer
unsigned char RcvBufLen; // length of data in receive buffer
unsigned char Command; // the command the client issued
char PreHttp1; // flag if a HTTP version before 1.0 is used
unsigned char File; // the file the client requested
uint16_t pSndData; // the data to send (progmem pointer)
unsigned short SndDataLen; // the length of the data to send
char Vars; // flag if to interpret variables
} HttpConns[4];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX