NetBurner 3.5.0
PDF Version
 
http.h File Reference

NetBurner HTTP Web Server Header File. More...

#include <nettypes.h>
#include <stddef.h>
#include <config_obj.h>

Go to the source code of this file.

Classes

struct  HTTP_Request
 HTTP Request Structure. More...
 
class  HtmlPageHandler
 Base class for all GET handlers. To handle GET requests for a specific URL in your application, build a GET handler object for that specifif URL. A NULL name will be a catch all for all GET requests. More...
 
class  CallBackFunctionPageHandler
 Implements the HtmlPageHandler class as a function pointer callback for GET requests. More...
 

Typedefs

typedef int http_gethandlerfunc(int sock, HTTP_Request &pd)
 Implements the HtmlPageHandler class as a function pointer callback for GET requests.
 

Enumerations

enum  HTTP_RequestTypes { tUnknown , tGet , tPost , tHead }
 HTTP request types for HTTP page handler callback functions. More...
 
enum  HTTP_ACCESS
 HTTP page access return values.
 

Functions

HTTP_RequestGetActiveHttpRequest ()
 Get thc curent active running http request. Only valid fromwithing http get or post handeling. Also valid during page fill in operations.
 
HTTP_ACCESS CheckHttpAccess (int sock, int access_level, HTTP_Request &Req)
 All HTTP requests go though this function.
 
void StartHttp (uint16_t port, bool RunConfigMirror)
 Start the HTTP web server. Further documentation in the Initialization section Initialization - System Initialization Functions.
 
void StopHttp ()
 Stop the HTTP web server.
 
void SendHTMLHeader (int sock)
 Send a HTML response header.
 
void SendHTMLHeaderWCookie (int sock, char *cookie)
 Send a HTML response header and cookie.
 
void SendTextHeader (int sock)
 Send a HTML plain text header.
 
void SendGifHeader (int sock)
 Send a HTML GIF header.
 
void EmptyResponse (int sock)
 Send an empty response back.
 
void NoContentResponse (int sock)
 Send a no content response back.
 
void RedirectResponse (int sock, PCSTR new_page)
 Redirect a HTTP request to a different page.
 
void NotFoundResponse (int sock, PCSTR new_page)
 Send a page not found response.
 
void ForbiddenResponse (int sock, PCSTR new_page)
 Send a page is forbidden response.
 
void NotAvailableResponse (int sock, PCSTR new_page)
 Send a response indicating that the requested resource is not available at this time.
 
void BadRequestResponse (int sock, PCSTR url, PCSTR data)
 Send a response indicating that the client request itself is faulty in some manner.
 
int writeallsafestring (int fd, PCSTR str)
 Send a string and escape all special characters.
 
int writesafestring (int fd, PCSTR str, size_t strLength)
 Send a string with a specified length and escape all special characters.
 
int httpstricmp (PCSTR str1, PCSTR strIsUpper2)
 Special string compare. Returns 1 if the strings match until one string ends with a null (0).
 

Detailed Description

NetBurner HTTP Web Server Header File.