33 # pragma warning(disable : 4786) 38 #include <formvalue.h> 41 #include <httpresponse.h> 42 #include <httprequest.h> 48 const char * getEHSconfig();
110 virtual bool BindPrivilegedPort(
int socket,
const char *addr,
const unsigned short port) = 0;
133 virtual const std::string GetPassphrase(
bool twice) = 0;
140 #define MAX_REQUEST_SIZE_DEFAULT (256 * 1024) 158 EHS & operator=(
const EHS &);
193 EHS(
EHS *parent = NULL, std::string registerpath =
"");
207 virtual const std::string GetPassphrase(
bool twice);
216 void RegisterEHS(
EHS *child,
const char *uripath);
223 void UnregisterEHS (
const char *uripath);
230 ehs_autoptr<HttpResponse> RouteRequest(
HttpRequest *request);
249 void SetSourceEHS (
EHS & source);
260 void StartServer(EHSServerParameters ¶ms);
272 void HandleData(
int timeout = 0);
282 virtual bool ThreadInitHandler();
291 virtual void ThreadExitHandler();
313 bool ShouldTerminate()
const;
324 m_poBindHelper = helper;
333 return m_poBindHelper;
342 m_poRawSocketHandler = helper;
351 return m_poRawSocketHandler;
358 void AddResponse(ehs_autoptr<GenericResponse> ehs_rvref response);
EHSServer contains all the network related services for EHS.
EHS provides HTTP server functionality to a child class.
EHSConnection abstracts the concept of a connection to an EHS application.
EHSServer * m_poEHSServer
EHSServer object associated with this EHS object.
This interface describes a handler for retrieving passphrases.
void SetRawSocketHandler(RawSocketHandler *helper)
Sets a RawSocketHandler for use by the network abstraction layer.
PrivilegedBindHelper * GetBindHelper() const
Retieves our PrivilegedBindHelper.
RawSocketHandler * GetRawSocketHandler() const
Retrieves our RawSocketHandler.
EHS * m_poParent
Points to the EHS object this object was registered with, NULL if top level.
Helper class for performing raw socket IO.
EHSServerParameters m_oParams
Stores a map with server parameters.
void SetBindHelper(PrivilegedBindHelper *helper)
Sets a PrivilegedBindHelper for use by the network abstraction layer.
RawSocketHandler * m_poRawSocketHandler
Our RawSocketHandler.
PrivilegedBindHelper * m_poBindHelper
Our bind helper.
EHS * m_poSourceEHS
Source EHS object to route requests to for data instead of processing it ourselves.
virtual bool OnData(EHSConnection *conn, std::string data)=0
Handle raw data.
bool m_bNoRouting
Flag: We don't do request routing.
This class represents a clients HTTP request.
virtual ~PassphraseHandler()
Destructor.
virtual void OnConnect(EHSConnection *conn)=0
Handle connect event.
EHSMap m_oEHSMap
Stores path => EHSConnection pairs for path/tree traversal.
virtual void OnDisconnect(EHSConnection *conn)=0
Handle disconnect event.
Helper class for binding of sockets to privileged ports.
std::string m_sRegisteredAs
The string that this EHS object is regestered as.
This class represents what is sent back to the client.