~ubuntu-branches/ubuntu/natty/znc/natty-backports

« back to all changes in this revision

Viewing changes to znc.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2009-05-23 16:17:47 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090523161747-dtgbsub23o1sl7ss
Tags: 0.070-1
* New upstream release.
  - Add new pkgconfig files to znc-dev.
* Fix typo in get-orig-source target.
* Merge 0.058-2~bpo40+1 and 0.058-2~bpo40+2 changelog.
* Add recommends on the new source package znc-extra.
* Add my own copyright for the Debian packaging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        CSockManager() : TSocketManager<Csock>() {}
28
28
        virtual ~CSockManager() {}
29
29
 
30
 
        bool ListenHost(u_short iPort, const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
 
30
        bool ListenHost(u_short iPort, const CString& sSockName, const CString& sBindHost, bool bSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
31
31
                CSListener L(iPort, sBindHost);
32
32
 
33
33
                L.SetSockName(sSockName);
34
 
                L.SetIsSSL(isSSL);
 
34
                L.SetIsSSL(bSSL);
35
35
                L.SetTimeout(iTimeout);
36
36
                L.SetMaxConns(iMaxConns);
37
37
 
44
44
                return Listen(L, pcSock);
45
45
        }
46
46
 
47
 
        bool ListenAll(u_short iPort, const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
48
 
                return ListenHost(iPort, sSockName, "", isSSL, iMaxConns, pcSock, iTimeout, bIsIPv6);
 
47
        bool ListenAll(u_short iPort, const CString& sSockName, bool bSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
 
48
                return ListenHost(iPort, sSockName, "", bSSL, iMaxConns, pcSock, iTimeout, bIsIPv6);
49
49
        }
50
50
 
51
 
        u_short ListenRand(const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
 
51
        u_short ListenRand(const CString& sSockName, const CString& sBindHost, bool bSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
52
52
                unsigned short uPort = 0;
53
53
                CSListener L(0, sBindHost);
54
54
 
55
55
                L.SetSockName(sSockName);
56
 
                L.SetIsSSL(isSSL);
 
56
                L.SetIsSSL(bSSL);
57
57
                L.SetTimeout(iTimeout);
58
58
                L.SetMaxConns(iMaxConns);
59
59
 
68
68
                return uPort;
69
69
        }
70
70
 
71
 
        u_short ListenAllRand(const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
72
 
                return(ListenRand(sSockName, "", isSSL, iMaxConns, pcSock, iTimeout, bIsIPv6));
 
71
        u_short ListenAllRand(const CString& sSockName, bool bSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
 
72
                return(ListenRand(sSockName, "", bSSL, iMaxConns, pcSock, iTimeout, bIsIPv6));
73
73
        }
74
74
 
75
 
        bool Connect(const CString& sHostname, u_short iPort , const CString& sSockName, int iTimeout = 60, bool isSSL = false, const CString& sBindHost = "", Csock *pcSock = NULL) {
 
75
        bool Connect(const CString& sHostname, u_short iPort , const CString& sSockName, int iTimeout = 60, bool bSSL = false, const CString& sBindHost = "", Csock *pcSock = NULL) {
76
76
                CSConnection C(sHostname, iPort, iTimeout);
77
77
 
78
78
                C.SetSockName(sSockName);
79
 
                C.SetIsSSL(isSSL);
 
79
                C.SetIsSSL(bSSL);
80
80
                C.SetBindHost(sBindHost);
81
81
 
82
82
                return TSocketManager<Csock>::Connect(C, pcSock);
104
104
        void InitDirs(const CString& sArgvPath, const CString& sDataDir);
105
105
        bool OnBoot();
106
106
        CString ExpandConfigPath(const CString& sConfigFile);
107
 
        bool WriteNewConfig(CString& sConfigFile);
 
107
        bool WriteNewConfig(const CString& sConfigFile);
108
108
        bool WriteConfig();
109
109
        bool ParseConfig(const CString& sConfig);
110
110
        bool RehashConfig(CString& sError);
153
153
        CString GetModPath() const;
154
154
        CString GetPemLocation() const { return GetZNCPath() + "/znc.pem"; }
155
155
        const CString& GetConfigFile() const { return m_sConfigFile; }
156
 
        bool WritePemFile(bool bEncPem = false);
 
156
        bool WritePemFile();
157
157
        const CString& GetISpoofFile() const { return m_sISpoofFile; }
158
158
        const CString& GetISpoofFormat() const { return m_sISpoofFormat; }
159
159
        const VCString& GetVHosts() const { return m_vsVHosts; }
273
273
        bool IsIPV6() const { return m_bIPV6; }
274
274
        unsigned short GetPort() const { return m_uPort; }
275
275
        const CString& GetBindHost() const { return m_sBindHost; }
 
276
        CRealListener* GetRealListener() const { return m_pListener; }
276
277
        // !Getters
277
278
 
278
279
        bool Listen() {