31 #ifndef PTLIB_HTTPSVC_H
32 #define PTLIB_HTTPSVC_H
119 PINDEX stackSize = 0x4000
124 PINDEX stackSize = 0x4000
244 const PURL & editSection,
245 const PURL & newSection,
313 const char * help = NULL,
314 const char * helpGif =
"help.gif");
319 const char * keyword =
"#equival");
373 #define PCREATE_SERVICE_MACRO(name, request, args) \
374 class PServiceMacro_##name : public PServiceMacro { \
376 PServiceMacro_##name() : PServiceMacro(#name, false) { } \
377 PString Translate(PHTTPRequest &, const PString &, const PString &) const; \
379 static const PServiceMacro_##name serviceMacro_##name; \
380 PString PServiceMacro_##name::Translate(PHTTPRequest & request, const PString & args, const PString &) const
384 #define PCREATE_SERVICE_MACRO_BLOCK(name, request, args, block) \
385 class PServiceMacro_##name : public PServiceMacro { \
387 PServiceMacro_##name() : PServiceMacro(#name, true) { } \
388 PString Translate(PHTTPRequest &, const PString &, const PString &) const; \
390 static const PServiceMacro_##name serviceMacro_##name; \
391 PString PServiceMacro_##name::Translate(PHTTPRequest & request, const PString & args, const PString & block) const
471 #endif // PTLIB_HTTPSVC_H
PHTTPServiceProcess & process
Definition: httpsvc.h:302
PTEACypher::Key signatureKey
Signature key for encryption of HTML files.
Definition: httpsvc.h:87
static bool ProcessMacros(PHTTPRequest &request, PString &text, const PString &filename, unsigned options)
PTCPSocket * socket
Definition: httpsvc.h:59
This class contains the Multipurpose Internet Mail Extensions parameters and variables.
Definition: mime.h:52
PTEACypher::Key signatureKey
Definition: httpsvc.h:161
PStringArray securedKeys
Definition: httpsvc.h:160
PBoolean CheckSignature()
virtual PBoolean SubstituteEquivalSequence(PHTTPRequest &request, const PString &, PString &)
PRegisterPage(PHTTPServiceProcess &app, const PHTTPAuthority &auth)
void OnLoadedText(PHTTPRequest &request, PString &text)
This is called after the text has been loaded and may be used to customise or otherwise mangle a load...
virtual PString GetCopyrightText()
PString productNameHTML
Definition: httpsvc.h:167
Definition: httpsvc.h:277
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
virtual PBoolean Post(PHTTPRequest &request, const PStringToString &data, PHTML &replyMessage)
Get a block of data (eg HTML) that the resource contains.
const PStringArray & GetSecuredKeys() const
Definition: httpsvc.h:139
PString gifHTML
Definition: httpsvc.h:168
Definition: httpsvc.h:332
PSocket * httpListeningSocket
Definition: httpsvc.h:155
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
This abstract class describes the authorisation mechanism for a Universal Resource Locator...
Definition: http.h:1002
This class defines an absolute time and date.
Definition: ptime.h:53
const PString & GetHomePage() const
Definition: httpsvc.h:135
void OnLoadedText(PHTTPRequest &, PString &text)
This is called after the text has been loaded and may be used to customise or otherwise mangle a load...
PConfigPage(PHTTPServiceProcess &app, const PString §ion, const PHTTPAuthority &auth)
void SetIgnoreSignatures(PBoolean ig)
Definition: httpsvc.h:142
friend class PServiceMacros_list
Definition: httpsvc.h:367
void BeginRestartSystem()
PBoolean OnStart()
Called when the service is started.
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
virtual PBoolean Post(PHTTPRequest &request, const PStringToString &data, PHTML &replyMessage)
Get a block of data (eg HTML) that the resource contains.
PServiceHTTPString(const PURL &url, const PString &string, const PString &contentType)
Definition: httpsvc.h:410
PServiceHTTPString(const PURL &url, const PString &string, const PString &contentType, const PHTTPAuthority &auth)
Definition: httpsvc.h:413
void CompleteRestartSystem()
const char * manufacturerName
Definition: httpsvc.h:75
PString copyrightHolder
Definition: httpsvc.h:169
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:2784
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
PServiceHTTPDirectory(const PURL &url, const PDirectory &dirname, PBoolean needSig=false)
Definition: httpsvc.h:454
PString manufacturersHomePage
Definition: httpsvc.h:165
PString macroKeyword
Definition: httpsvc.h:157
PServiceHTTPString(const PURL &url, const PHTTPAuthority &auth)
Definition: httpsvc.h:404
const PString & GetEMailAddress() const
Definition: httpsvc.h:136
virtual PBoolean Post(PHTTPRequest &request, const PStringToString &data, PHTML &replyMessage)
Get a block of data (eg HTML) that the resource contains.
PServiceHTTPFile(const PString &filename, const PFilePath &file, PBoolean needSig=false)
Definition: httpsvc.h:431
This class is a variation of a string that ignores case.
Definition: pstring.h:1708
PString copyrightEmail
Definition: httpsvc.h:171
PTEACypher::Key productKey
Definition: httpsvc.h:159
PBoolean needSignature
Definition: httpsvc.h:467
This object describes a HyperText Transport Protocol resource which is a single file.
Definition: http.h:1614
This is an array collection class of PString objects.
Definition: pstring.h:2024
const PTime & GetCompilationDate() const
Definition: httpsvc.h:134
Definition: httpsvc.h:397
const char * compilationDate
Definition: httpsvc.h:81
This object describes a HyperText Transport Protocol resource which is a string kept in memory...
Definition: http.h:1525
const char * macroName
Definition: httpsvc.h:363
void Main()
User override function for the main execution routine of the thread.
PBoolean ProcessHTTP(PTCPSocket &socket)
PINDEX myStackSize
Definition: httpsvc.h:57
This object describes a HyperText Transport Protocol resource which is a set of files in a directory...
Definition: http.h:1819
PHTTPServiceThread(PINDEX stackSize, PHTTPServiceProcess &app)
const char * productHTML
HTML for the product name, if NULL defaults to the productName variable.
Definition: httpsvc.h:91
const char * gifFilename
File name for the products GIF file.
Definition: httpsvc.h:95
BOOL PBoolean
Definition: object.h:102
PString section
Definition: httpform.h:876
Class to represent a directory in the operating system file system.
Definition: pdirect.h:182
Definition: httpsvc.h:308
virtual void AddUnregisteredText(PHTML &html)
PServiceHTTPFile(const PString &filename, PBoolean needSig=false)
Definition: httpsvc.h:429
PHTTPServiceProcess(const Info &inf)
int gifHeight
in the generated HTML.
Definition: httpsvc.h:97
CodeStatus buildStatus
AlphaCode, BetaCode or ReleaseCode.
Definition: httpsvc.h:79
const char * manufHomePage
WWW address of manufacturers home page.
Definition: httpsvc.h:89
A process type that runs as a "background" service.
Definition: svcproc.h:49
const char * email
contact email for manufacturer
Definition: httpsvc.h:90
Definition: httpsvc.h:191
const char * securedKeys[MaxSecuredKeys]
Product secured keys for registration.
Definition: httpsvc.h:84
PLIST(ThreadList, PHTTPServiceThread)
int gifWidth
Size of GIF image, if zero then none is used.
Definition: httpsvc.h:96
void GetPageHeader(PHTML &)
Comparison Compare(const PObject &obj) const
Compare the two objects and return their relative rank.
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
Definition: httpsvc.h:330
PBoolean needSignature
Definition: httpsvc.h:447
PINDEX securedKeyCount
Definition: httpsvc.h:85
PMutex httpThreadsMutex
Definition: httpsvc.h:181
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
PTime compilationDate
Definition: httpsvc.h:164
PServiceMacro * link
Definition: httpsvc.h:365
virtual void AddRegisteredText(PHTML &html)
PBoolean OnPOST(PHTTPServer &server, const PURL &url, const PMIMEInfo &info, const PStringToString &data, const PHTTPConnectionInfo &connectInfo)
Handle the POST command passed from the HTTP socket.
virtual void AddFields(const PString &prefix)=0
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
PTCPSocket * AcceptHTTP()
PConfigSectionsPage(PHTTPServiceProcess &app, const PURL &url, const PHTTPAuthority &auth, const PString &prefix, const PString &valueName, const PURL &editSection, const PURL &newSection, const PString &newTitle, PHTML &heading)
PBoolean ShouldIgnoreSignatures() const
Definition: httpsvc.h:141
static PHTTPServiceProcess & Current()
PString LoadText(PHTTPRequest &request)
Get a block of text data (eg HTML) that the resource contains.
const PString & GetProductName() const
Definition: httpsvc.h:137
The character string class.
Definition: pstring.h:108
Definition: httpsvc.h:351
void OnContinue()
Resume after the service was paused.
Definition: httpsvc.h:329
void OnLoadedText(PHTTPRequest &, PString &text)
This is called after the text has been loaded and may be used to customise or otherwise mangle a load...
A socket that uses the TCP transport on the Internet Protocol.
Definition: tcpsock.h:44
PTEACypher::Key productKey
Poduct key for registration.
Definition: httpsvc.h:83
PBoolean OnPOST(PHTTPServer &server, const PURL &url, const PMIMEInfo &info, const PStringToString &data, const PHTTPConnectionInfo &connectInfo)
Handle the POST command passed from the HTTP socket.
PHTTPServiceProcess & process
Definition: httpsvc.h:271
PThread * restartThread
Definition: httpsvc.h:177
Definition: httpsvc.h:425
PBoolean isMacroBlock
Definition: httpsvc.h:364
PString LoadText(PHTTPRequest &)
Get a block of text data (eg HTML) that the resource contains.
const char * productName
Definition: httpsvc.h:74
Definition: httpform.h:891
PBoolean ListenForHTTP(WORD port, PSocket::Reusability reuse=PSocket::CanReuseAddress, PINDEX stackSize=0x4000)
PString ExtractSignature(PString &out)
const char * GetServiceDependencies() const
PBoolean ignoreSignatures
Definition: httpsvc.h:162
PHTTPServiceProcess & process
Definition: httpsvc.h:58
This class defines a thread of execution in the system.
Definition: thread.h:66
WORD buildNumber
Definition: httpsvc.h:80
PBoolean OnPause()
Called by the system when the service is to be paused.
This class describes a name space that a Universal Resource Locator operates in.
Definition: http.h:58
const char * copyrightEmail
E-Mail address for copyright holder.
Definition: httpsvc.h:101
static PServiceMacro * list
Definition: httpsvc.h:366
This class describes a HyperText markup Language string as used by the World Wide Web and the PURL an...
Definition: html.h:49
Definition: httpsvc.h:333
PServiceHTTPDirectory(const PURL &url, const PDirectory &dirname, const PHTTPAuthority &auth, PBoolean needSig=false)
Definition: httpsvc.h:457
PServiceHTTPString(const PURL &url, const PString &string, const PHTTPAuthority &auth)
Definition: httpsvc.h:407
Definition: httpsvc.h:234
Definition: httpsvc.h:450
PServiceHTML(const char *title, const char *help=NULL, const char *helpGif="help.gif")
PServiceHTTPFile(const PString &filename, const PFilePath &file, const PHTTPAuthority &auth, PBoolean needSig=false)
Definition: httpsvc.h:437
virtual PString Translate(PHTTPRequest &request, const PString &args, const PString &block) const
PString manufacturersEmail
Definition: httpsvc.h:166
void OnLoadedText(PHTTPRequest &, PString &text)
This is called after the text has been loaded and may be used to customise or otherwise mangle a load...
PServiceHTTPFile(const PString &filename, const PHTTPAuthority &auth, PBoolean needSig=false)
Definition: httpsvc.h:435
Definition: httpsvc.h:331
virtual PHTTPServer * CreateHTTPServer(PTCPSocket &socket)
void OnLoadedText(PHTTPRequest &, PString &text)
This is called after the text has been loaded and may be used to customise or otherwise mangle a load...
WORD minorVersion
Definition: httpsvc.h:78
static bool SpliceMacro(PString &text, const PString &tokens, const PString &value)
const char * copyrightHolder
Name of copyright holder.
Definition: httpsvc.h:99
const PString & GetMacroKeyword() const
Definition: httpsvc.h:133
PString contentType
MIME content type for the resource.
Definition: http.h:1512
PString copyrightHomePage
Definition: httpsvc.h:170
void OnStop()
Called by the system when the service is stopped.
WORD majorVersion
Definition: httpsvc.h:77
virtual PString GetPageGraphic()
CodeStatus
Release status for the program.
Definition: pprocess.h:235
A network communications channel.
Definition: socket.h:58
PString CalculateSignature()
PServiceMacro(const char *name, PBoolean isBlock)
PServiceHTTPString(const PURL &url, const PString &string)
Definition: httpsvc.h:401
virtual PHTTPServer * OnCreateHTTPServer(const PHTTPSpace &urlSpace)
virtual void OnConfigChanged()=0
A TCP/IP socket for the HyperText Transfer Protocol version 1.0.
Definition: http.h:762
virtual PBoolean Initialise(const char *initMsg)=0
This object describes a HyperText Transport Protocol request.
Definition: http.h:968
Reusability
Flags to reuse of port numbers in Listen() function.
Definition: socket.h:84
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PHTTPServiceProcess & process
Definition: httpsvc.h:228
This object describes the connectiono associated with a HyperText Transport Protocol request...
Definition: http.h:665
const char * copyrightHomePage
Home page for copyright holder.
Definition: httpsvc.h:100
This class describes a Universal Resource Locator.
Definition: url.h:54
ThreadList httpThreads
Definition: httpsvc.h:180
const char * gifHTML
HTML to show GIF image in page headers, if NULL then the following are used to build one...
Definition: httpsvc.h:93
PServiceHTTPFile(const PString &filename, const PString &file, PBoolean needSig=false)
Definition: httpsvc.h:433
const PTEACypher::Key & GetProductKey() const
Definition: httpsvc.h:138
const PTEACypher::Key & GetSignatureKey() const
Definition: httpsvc.h:140
MacroOptions
Definition: httpsvc.h:328
PHTTPSpace httpNameSpace
Definition: httpsvc.h:156
Definition: httpform.h:804