00001 /* 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * Manages a UniConf daemon. 00006 */ 00007 #ifndef __UNICONFDAEMON_H 00008 #define __UNICONFDAEMON_H 00009 00010 #include "wvlog.h" 00011 #include "wvstreamlist.h" 00012 #include "uniconf.h" 00013 #include "wvaddr.h" 00014 00015 class WvX509Mgr; 00016 00017 class UniConfDaemon : public WvStreamList 00018 { 00019 UniConf cfg; 00020 WvLog log, debug; 00021 bool closed; 00022 bool authenticate; 00023 00024 public: 00025 /** 00026 * Create a UniConfDaemon to serve the Uniconf tree cfg. If auth is 00027 * true, require authentication through PAM before accepting connections. 00028 */ 00029 UniConfDaemon(const UniConf &cfg, bool auth); 00030 virtual ~UniConfDaemon(); 00031 00032 virtual bool isok() const; 00033 virtual void close(); 00034 00035 void accept(WvStream *stream); 00036 00037 bool setupunixsocket(WvStringParm path); 00038 bool setuptcpsocket(const WvIPPortAddr &addr); 00039 bool setupsslsocket(const WvIPPortAddr &addr, WvX509Mgr *x509); 00040 00041 private: 00042 void unixcallback(WvStream &s, void *userdata); 00043 void tcpcallback(WvStream &s, void *userdata); 00044 void sslcallback(WvStream &s, void *userdata); 00045 }; 00046 00047 #endif // __UNICONFDAEMON_H