1 #include "wvdbusserver.h"
2 #include "wvstreamsdaemon.h"
3 #include "wvautoconf.h"
5 #include "wvsslstream.h"
7 #include "uniconfroot.h"
18 wv::bind(&WvDBusDaemon::cb,
this)),
19 log(
"WvDBusDaemon", WvLog::Debug), configfile(
"wvdbus.ini")
21 args.
add_option(
'c',
"config",
"Specify path to configuration file",
22 "FILENAME", configfile);
33 log(
"WvDBusDaemon starting.\n");
36 if (!cert && conf[
"cert"].exists() && conf[
"privrsa"].exists())
39 cert->
decode(WvX509::CertPEM, *conf[
"cert"]);
40 cert->
decode(WvRSAKey::RsaPEM, *conf[
"privrsa"]);
44 log(
"Certificate found in ini file, but failed to load!\n");
48 log(
"Certificate found in ini file, and loaded!\n");
53 for (i.rewind(); i.next(); )
67 return new WvSSLStream(IWvStream::create(s, obj), cert, 0,
true);
73 int main(
int argc,
char *argv[])
void add_option(char short_option, WvStringParm long_option, WvStringParm desc, WvStringParm arg_desc, int &val)
Add a switch that takes an integer argument.
WvArgs args
The arguments the daemon accepts; the defaults are described above.
SSL Stream, handles SSLv2, SSLv3, and TLS Methods - If you want it to be a server,...
void listen(WvStringParm moniker)
Listen using a given WvListener moniker.
WvString is an implementation of a simple and efficient printable-string class.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
WvStreamsDaemon(WvStringParm name, WvStringParm version, WvDaemonCallback cb)
Construct a new WvStreamsDaemon with given name and version, and use the cb function to populate the ...
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
virtual void decode(const WvX509::DumpMode mode, WvStringParm encoded)
Load the information from the format requested by mode into the class - this overwrites the certifica...
WvStreamsDaemon - High-level abstraction for a daemon process that does nothing but add streams to th...
IUniConfGen * mount(WvStringParm moniker, bool refresh=true) const
Mounts a generator at this key using a moniker.
int run(const char *argv0)
Run the daemon with no argument processing. Returns exit status.
bool test() const
Test to make sure that a certificate and a keypair go together.
void add_required_arg(WvStringParm desc, bool multiple=false)
Add a required argument to the list of parameters.
const WvStringList & extra_args() const
Remaining args.
Represents the root of a hierarhical registry consisting of pairs of UniConfKeys and associated strin...
void add_die_stream(IWvStream *istream, bool auto_free, const char *id)
Add a stream to the daemon; if the stream goes !isok() the daemon will exit.