Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/http/http_server.h File Reference


Detailed Description

Author:
Version:
1.0
Date:
13.10.2002
OpenTCP HTTP function declarations, constants, etc.

Definition in file http_server.h.

Go to the source code of this file.

Data Structures

struct  http_server_state
 Structure that holds all the necessary state information for session management. More...


Defines

#define NO_OF_HTTP_SESSIONS   3
 Defines number of simultaneous HTTP sessions.

#define HTTPS_SERVERPORT   80
 HTTP server port on which we'll listen.

#define HTTPS_STATE_FREE   1
#define HTTPS_STATE_RESERVED   2
#define HTTPS_STATE_ACTIVE   3

Functions

INT8 https_init (void)
 Initialize HTTP server variables.

INT16 https_findfile (UINT8, UINT8)
 Brief function description here.

INT16 https_loadbuffer (UINT8, UINT8 *, UINT16)
 Fill network transmit buffer with HTTP headers&data.


Variables

http_server_state https []
 Used for storing state information about different HTTP sessions.


Define Documentation

#define NO_OF_HTTP_SESSIONS   3
 

Change this define to change how many simultaneous HTTP sessions will be possible at any given time. Note that this will require at least as much TCP sockets, so change NO_OF_TCPSOCKETS also!

Definition at line 75 of file http_server.h.

#define HTTPS_SERVERPORT   80
 

This defines on what TCP port the HTTP server will listen for incoming connections/requests. For HTTP standard port is 80.

Definition at line 83 of file http_server.h.

Referenced by https_init().

#define HTTPS_STATE_FREE   1
 

HTTP Server state: session entry free and available

Definition at line 86 of file http_server.h.

Referenced by https_init().

#define HTTPS_STATE_RESERVED   2
 

HTTP Server state: session entry is reserved and therefore not available

Definition at line 89 of file http_server.h.

#define HTTPS_STATE_ACTIVE   3
 

HTTP Server state: session entry (and the session itself) are active.

Definition at line 92 of file http_server.h.


Function Documentation

INT8 https_init void   
 

Author:
Date:
13.10.2002
This function should be called before the HTTP Server application is used to set the operating parameters of it

Definition at line 93 of file http_server.c.

References http_server_state::flen, http_server_state::fpoint, http_server_state::fstart, http_server_state::funacked, https_enabled, HTTPS_SERVERPORT, HTTPS_STATE_FREE, http_server_state::ownersocket, RESET_SYSTEM, http_server_state::state, TCP_DEF_TOUT, tcp_getsocket(), tcp_listen(), TCP_TOS_NORMAL, and TCP_TYPE_SERVER.

INT16 https_findfile UINT8    hash,
UINT8    ses
 

Author:
Date:
09.10.2002
Parameters:
hash  Calculated file-name hash value. Used so that the whole file name doesn't need to be stored in RAM
ses  HTTP session identifier
Returns:
  • -1 - This function should return -1 if no file has been found
  • 1 - This function should return 1 if a file with appropriate hash value has been found.
Warning:
  • This function MUST be implemented by user application to work with local configuration
This function is invoked by the HTTP server once a hash value of a requested file name has been calculated. User application uses this hash value to check if appropriate file is available to web server. Appropriate https session entry is then filled accordingly.

Definition at line 124 of file https_callbacks.c.

INT16 https_loadbuffer UINT8    ses,
UINT8 *    buf,
UINT16    buflen
 

Author:
Date:
09.10.2002
Parameters:
ses  HTTP session identifier
buf  Pointer to buffer where data is to be stored
buflen  Length of the buffer in bytes
Returns:
  • >=0 - Number of bytes written to buffer
Warning:
  • This function MUST be implemented by user application to work with local configuration
This handlers' job is to fill the buffer with the data that web server should return back through the TCP connection. This is accomplished based session identifer and values of variables in appropriate https entry.

Definition at line 173 of file https_callbacks.c.

References https_not_found_page.


Variable Documentation

struct http_server_state https[]  
 

This is an array of http_server_state structures holding various state information about the HTTP sessions. HTTP server uses this information to determine actions that need to be taken on sockets.

Definition at line 158 of file http_server.h.


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18