27 #ifndef PTLIB_HTTPSVC_H
28 #define PTLIB_HTTPSVC_H
104 const char * configPageName,
261 const PURL & editSection,
262 const PURL & newSection,
327 const char * help = NULL,
328 const char * helpGif =
"help.gif");
333 const char * keyword =
"#equival");
387 #define PCREATE_SERVICE_MACRO(name, request, args) \
388 class PServiceMacro_##name : public PServiceMacro { \
390 PServiceMacro_##name() : PServiceMacro(#name, false) { } \
391 PString Translate(PHTTPRequest &, const PString &, const PString &) const; \
393 static const PServiceMacro_##name serviceMacro_##name; \
394 PString PServiceMacro_##name::Translate(PHTTPRequest & request, const PString & args, const PString &) const
398 #define PCREATE_SERVICE_MACRO_BLOCK(name, request, args, block) \
399 class PServiceMacro_##name : public PServiceMacro { \
401 PServiceMacro_##name() : PServiceMacro(#name, true) { } \
402 PString Translate(PHTTPRequest &, const PString &, const PString &) const; \
404 static const PServiceMacro_##name serviceMacro_##name; \
405 PString PServiceMacro_##name::Translate(PHTTPRequest & request, const PString & args, const PString & block) const
506 #endif // P_HTTPFORMS
508 #endif // PTLIB_HTTPSVC_H
PHTTPServiceProcess & process
Definition: httpsvc.h:316
PTEACypher::Key signatureKey
Signature key for encryption of HTML files.
Definition: httpsvc.h:66
static bool ProcessMacros(PHTTPRequest &request, PString &text, const PString &filename, unsigned options)
atomic< PThread * > m_restartThread
Definition: httpsvc.h:199
PTEACypher::Key m_signatureKey
Definition: httpsvc.h:180
PString m_copyrightEmail
Definition: httpsvc.h:193
const char * m_rotateTemplateKey
Definition: httpsvc.h:126
PBoolean CheckSignature()
const char * m_realmKey
Definition: httpsvc.h:114
virtual PBoolean SubstituteEquivalSequence(PHTTPRequest &request, const PString &, PString &)
PString m_manufacturersHomePage
Definition: httpsvc.h:184
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 PBoolean OnPOST(PHTTPServer &server, const PHTTPConnectionInfo &connectInfo)
Handle the POST command passed from the HTTP socket.
virtual PString GetCopyrightText()
unsigned m_gifWidth
Definition: httpsvc.h:188
PHTTPFile * m_fullLogPage
Definition: httpsvc.h:134
const char * m_logFileKey
Definition: httpsvc.h:122
Definition: httpsvc.h:291
static const PString & GetDefaultSection()
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
Definition: httpsvc.h:485
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:165
bool ShouldIgnoreSignatures() const
Definition: httpsvc.h:167
ClearLogPage(PHTTPServiceProcess &process, const PURL &url, const PHTTPAuthority &auth)
Definition: httpsvc.h:346
PString m_macroKeyword
Definition: httpsvc.h:177
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
This class describes the simplest authorisation mechanism for a Universal Resource Locator...
Definition: http.h:1505
P_REMOVE_VIRTUAL(PHTTPServer *, CreateHTTPServer(PChannel &), 0)
PTEACypher::Key m_productKey
Definition: httpsvc.h:178
This abstract class describes the authorisation mechanism for a Universal Resource Locator...
Definition: http.h:1452
This class defines an absolute time and date.
Definition: ptime.h:49
const PString & GetHomePage() const
Definition: httpsvc.h:157
PString m_gifFilename
Definition: httpsvc.h:187
Definition: httpsvc.h:101
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)
PString m_productNameHTML
Definition: httpsvc.h:186
PHTTPServiceProcess & m_process
Definition: httpsvc.h:502
friend class PServiceMacros_list
Definition: httpsvc.h:381
void BeginRestartSystem()
const char * m_httpPortKey
Definition: httpsvc.h:139
WORD patchVersion
Definition: httpsvc.h:59
const char * m_clearLogPageName
Definition: httpsvc.h:131
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:424
PServiceHTTPString(const PURL &url, const PString &string, const PString &contentType, const PHTTPAuthority &auth)
Definition: httpsvc.h:427
const char * manufacturerName
Definition: httpsvc.h:54
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:3151
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:2251
PServiceHTTPDirectory(const PURL &url, const PDirectory &dirname, PBoolean needSig=false)
Definition: httpsvc.h:468
PServiceHTTPString(const PURL &url, const PHTTPAuthority &auth)
Definition: httpsvc.h:418
const PString & GetEMailAddress() const
Definition: httpsvc.h:158
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:445
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
PBoolean needSignature
Definition: httpsvc.h:481
const char * m_tailLogPageName
Definition: httpsvc.h:132
This object describes a HyperText Transport Protocol resource which is a single file.
Definition: http.h:2098
This is an array collection class of PString objects.
Definition: pstring.h:2365
const char * m_rotateSizeKey
Definition: httpsvc.h:127
const PTime & GetCompilationDate() const
Definition: httpsvc.h:156
Definition: httpsvc.h:411
const char * compilationDate
Definition: httpsvc.h:60
PConfigPage * m_configPage
Definition: httpsvc.h:111
This object describes a HyperText Transport Protocol resource which is a string kept in memory...
Definition: http.h:2009
const char * m_rotatePrefixKey
Definition: httpsvc.h:125
unsigned m_gifHeight
Definition: httpsvc.h:189
const char * macroName
Definition: httpsvc.h:377
const char * m_passwordKey
Definition: httpsvc.h:116
void SetIgnoreSignatures(bool ig)
Definition: httpsvc.h:168
This object describes a HyperText Transport Protocol resource which is a set of files in a directory...
Definition: http.h:2303
PTime m_compilationDate
Definition: httpsvc.h:183
const char * productHTML
HTML for the product name, if NULL defaults to the productName variable.
Definition: httpsvc.h:70
const char * m_rotateDirKey
Definition: httpsvc.h:124
const char * gifFilename
File name for the products GIF file.
Definition: httpsvc.h:74
Class to represent a directory in the operating system file system.
Definition: pdirect.h:173
Definition: httpsvc.h:322
virtual void AddUnregisteredText(PHTML &html)
PServiceHTTPFile(const PString &filename, PBoolean needSig=false)
Definition: httpsvc.h:443
PHTTPServiceProcess(const Info &inf)
int gifHeight
in the generated HTML.
Definition: httpsvc.h:76
CodeStatus buildStatus
AlphaCode, BetaCode or ReleaseCode.
Definition: httpsvc.h:58
const char * manufHomePage
WWW address of manufacturers home page.
Definition: httpsvc.h:68
A process type that runs as a "background" service.
Definition: svcproc.h:45
const char * email
contact email for manufacturer
Definition: httpsvc.h:69
Definition: httpsvc.h:211
const char * securedKeys[MaxSecuredKeys]
Product secured keys for registration.
Definition: httpsvc.h:63
int gifWidth
Size of GIF image, if zero then none is used.
Definition: httpsvc.h:75
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:344
PBoolean needSignature
Definition: httpsvc.h:461
PINDEX securedKeyCount
Definition: httpsvc.h:64
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
Abstract class defining I/O channel semantics.
Definition: channel.h:103
const char * m_configPageName
Definition: httpsvc.h:109
PServiceMacro * link
Definition: httpsvc.h:379
virtual void AddRegisteredText(PHTML &html)
PStringArray m_securedKeys
Definition: httpsvc.h:179
PString m_copyrightHomePage
Definition: httpsvc.h:192
virtual void OnHTTPEnded(PHTTPServer &server)
Callback when an existing HTTP connection has ended.
bool PBoolean
Definition: object.h:174
const PString & GetCopyrightHomePage() const
Definition: httpsvc.h:162
WORD oemVersion
Definition: httpsvc.h:82
virtual void AddFields(const PString &prefix)=0
virtual PBoolean GetExpirationDate(PTime &when)
Get a block of data (eg HTML) that the resource contains.
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)
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:159
const char * m_usernameKey
Definition: httpsvc.h:115
The character string class.
Definition: pstring.h:108
Definition: httpsvc.h:365
virtual PString LoadText(PHTTPRequest &request)
Get a block of text data (eg HTML) that the resource contains.
void OnContinue()
Resume after the service was paused.
Definition: httpsvc.h:343
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...
PTEACypher::Key productKey
Poduct key for registration.
Definition: httpsvc.h:62
Params(const char *configPageName, const char *section=GetDefaultSection())
PHTTPServiceProcess & process
Definition: httpsvc.h:285
Definition: httpsvc.h:439
PBoolean isMacroBlock
Definition: httpsvc.h:378
PString LoadText(PHTTPRequest &)
Get a block of text data (eg HTML) that the resource contains.
const char * productName
Definition: httpsvc.h:53
Definition: httpform.h:1081
virtual ~Params()
Definition: httpsvc.h:107
PString ExtractSignature(PString &out)
const char * GetServiceDependencies() const
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:56
const char * copyrightEmail
E-Mail address for copyright holder.
Definition: httpsvc.h:80
static PServiceMacro * list
Definition: httpsvc.h:380
const PString & GetGifHTML() const
Definition: httpsvc.h:160
PString m_copyrightHolder
Definition: httpsvc.h:191
This class describes a HyperText markup Language string as used by the World Wide Web and the PURL an...
Definition: html.h:45
const char * m_section
Definition: httpsvc.h:110
Definition: httpsvc.h:347
const PString & GetCopyrightHolder() const
Definition: httpsvc.h:161
PHTTPSimpleAuth m_authority
Definition: httpsvc.h:117
PHTTPTailFile * m_tailLogPage
Definition: httpsvc.h:136
Listener for incoming HTTP request with thread pool to handle those requests.
Definition: http.h:1327
bool m_forceRotate
Definition: httpsvc.h:120
ClearLogPage * m_clearLogPage
Definition: httpsvc.h:135
PServiceHTTPDirectory(const PURL &url, const PDirectory &dirname, const PHTTPAuthority &auth, PBoolean needSig=false)
Definition: httpsvc.h:471
PServiceHTTPString(const PURL &url, const PString &string, const PHTTPAuthority &auth)
Definition: httpsvc.h:421
PString m_manufacturersEmail
Definition: httpsvc.h:185
Definition: httpsvc.h:251
const char * m_logOptionsKey
Definition: httpsvc.h:123
bool m_ignoreSignatures
Definition: httpsvc.h:181
virtual bool InitialiseBase(Params ¶ms)
Definition: httpsvc.h:464
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:451
virtual PString Translate(PHTTPRequest &request, const PString &args, const PString &block) const
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:449
Definition: httpsvc.h:345
const char * m_rotateAgeKey
Definition: httpsvc.h:129
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:57
static bool SpliceMacro(PString &text, const PString &tokens, const PString &value)
const char * m_httpInterfacesKey
Definition: httpsvc.h:140
const char * copyrightHolder
Name of copyright holder.
Definition: httpsvc.h:78
const PString & GetMacroKeyword() const
Definition: httpsvc.h:155
void OnStop()
Called by the system when the service is stopped.
WORD majorVersion
Definition: httpsvc.h:56
virtual PString GetPageGraphic()
CodeStatus
Release status for the program.
Definition: pprocess.h:114
PString CalculateSignature()
PString m_httpInterfaces
Definition: httpsvc.h:142
const PString & GetCopyrightEmail() const
Definition: httpsvc.h:163
PServiceMacro(const char *name, PBoolean isBlock)
const char * m_logLevelKey
Definition: httpsvc.h:121
PServiceHTTPString(const PURL &url, const PString &string)
Definition: httpsvc.h:415
const char * m_fullLogPageName
Definition: httpsvc.h:130
const char * m_rotateCountKey
Definition: httpsvc.h:128
virtual void OnConfigChanged()=0
A TCP/IP socket for the HyperText Transfer Protocol version 1.0.
Definition: http.h:1042
virtual PBoolean OnPOST(PHTTPServer &server, const PHTTPConnectionInfo &connectInfo)
Handle the POST command passed from the HTTP socket.
virtual PBoolean Initialise(const char *initMsg)=0
This object describes a HyperText Transport Protocol request.
Definition: http.h:1417
Ultimate parent class for all objects in the class library.
Definition: object.h:2204
PHTTPServiceProcess & process
Definition: httpsvc.h:245
This object describes the connectiono associated with a HyperText Transport Protocol request...
Definition: http.h:937
const char * copyrightHomePage
Home page for copyright holder.
Definition: httpsvc.h:79
PString m_gifHTML
Definition: httpsvc.h:190
This class describes a Universal Resource Locator.
Definition: url.h:56
const char * gifHTML
HTML to show GIF image in page headers, if NULL then the following are used to build one...
Definition: httpsvc.h:72
PServiceHTTPFile(const PString &filename, const PString &file, PBoolean needSig=false)
Definition: httpsvc.h:447
WORD m_httpPort
Definition: httpsvc.h:141
virtual PBoolean Post(PHTTPRequest &request, const PStringToString &, PHTML &msg)
Get a block of data (eg HTML) that the resource contains.
const PTEACypher::Key & GetProductKey() const
Definition: httpsvc.h:164
const PTEACypher::Key & GetSignatureKey() const
Definition: httpsvc.h:166
This object describes a HyperText Transport Protocol resource which is a single file.
Definition: http.h:2224
MacroOptions
Definition: httpsvc.h:342
Definition: httpform.h:915