summaryrefslogtreecommitdiff
path: root/options.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-25 00:05:37 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-25 00:05:37 +0000
commit2205b2fbf6f29d9d7fec8d245d51c0ccd75d2a7f (patch)
treee32ab0b36d848f4454a9e22871ba0b446fc6cc7f /options.h
parentsorry forgot to add keyDerivatioFactory (diff)
options is global now
kd_prf_ is set to null if cipher_ is null as well
Diffstat (limited to 'options.h')
-rw-r--r--options.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/options.h b/options.h
index e0c1ac3..b533695 100644
--- a/options.h
+++ b/options.h
@@ -46,7 +46,8 @@ typedef std::list<OptionConnectTo> ConnectToList;
class Options
{
public:
- Options();
+ static Options& instance();
+
bool parse(int argc, char* argv[]);
void printUsage();
void printOptions();
@@ -91,6 +92,21 @@ public:
ConnectToList getConnectTo();
private:
+ Options();
+ ~Options();
+ Options(const Options &l);
+ void operator=(const Options &l);
+
+ static Options* inst;
+ static Mutex instMutex;
+ class instanceCleaner {
+ public: ~instanceCleaner() {
+ if(Options::inst != 0)
+ delete Options::inst;
+ }
+ };
+ friend class instanceCleaner;
+
Mutex mutex;
ConnectToList connect_to_;
@@ -114,4 +130,6 @@ private:
std::string auth_algo_;
};
+extern Options& gOpt;
+
#endif