This file is indexed.

/usr/include/licq/daemon.h is in licq-dev 1.8.1-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
 * This file is part of Licq, an instant messaging client for UNIX.
 * Copyright (C) 2010-2012 Licq developers <licq-dev@googlegroups.com>
 *
 * Licq is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Licq is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Licq; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef LICQ_DAEMON_H
#define LICQ_DAEMON_H

#include <boost/noncopyable.hpp>
#include <pthread.h>
#include <string>

namespace Licq
{

class Event;
class PluginSignal;
class ProtocolSignal;
class Proxy;
class TCPSocket;
class User;
class UserEvent;
class UserId;


class Daemon : private boost::noncopyable
{
public:
  virtual void Shutdown() = 0;
  virtual const char* Version() const = 0;
  virtual void SaveConf() = 0;

  bool shuttingDown() const                     { return myShuttingDown; }

  /**
   * Check if GPG support is enabled
   * This function allows plugins to check at runtime if GPG options are available
   *
   * @return True if GPG support is available in daemon
   */
  bool haveGpgSupport() const;

  /**
   * Check if SSL support is enabled
   * This function allows plugins to check at runtime if encryption is available
   *
   * @return True if SSL support is available in daemon
   */
  bool haveCryptoSupport() const;

  // Firewall options
  bool tcpEnabled() const                       { return myTcpEnabled; }
  void setTcpEnabled(bool b)                    { myTcpEnabled = b; }
  bool behindFirewall() const                   { return myBehindFirewall; }
  void setBehindFirewall(bool b)                { myBehindFirewall = b; }
  unsigned tcpPortsLow() const                  { return myTcpPortsLow; }
  unsigned tcpPortsHigh() const                 { return myTcpPortsHigh; }
  void setTcpPorts(unsigned lowPort, unsigned highPort);

  // Proxy options
  Proxy* createProxy();
  bool proxyEnabled() const                     { return myProxyEnabled; }
  void setProxyEnabled(bool b)                  { myProxyEnabled = b; }
  enum ProxyTypes
  {
    ProxyTypeHttp = 1,
  };
  unsigned proxyType() const                    { return myProxyType; }
  void setProxyType(unsigned t)                 { myProxyType = t; }
  const std::string& proxyHost() const          { return myProxyHost; }
  void setProxyHost(const std::string& s)       { myProxyHost = s; }
  unsigned proxyPort() const                    { return myProxyPort; }
  void setProxyPort(unsigned short p)           { myProxyPort = p; }
  bool proxyAuthEnabled() const                 { return myProxyAuthEnabled; }
  void setProxyAuthEnabled(bool b)              { myProxyAuthEnabled = b; }
  const std::string& proxyLogin() const         { return myProxyLogin; }
  void setProxyLogin(const std::string& s)      { myProxyLogin = s; }
  const std::string& proxyPasswd() const        { return myProxyPasswd; }
  void setProxyPasswd(const std::string& s)     { myProxyPasswd = s; }

  const std::string& terminal() const           { return myTerminal; }
  void setTerminal(const std::string& s)        { myTerminal = s; }
  bool sendTypingNotification() const           { return mySendTypingNotification; }
  void setSendTypingNotification(bool b)        { mySendTypingNotification = b; }

  int StartTCPServer(TCPSocket *);

  virtual bool addUserEvent(User* u, UserEvent* e) = 0;
  virtual void rejectEvent(const UserId& userId, UserEvent* e) = 0;

  enum IgnoreTypes
  {
    IgnoreMassMsg = 1,
    IgnoreNewUsers = 2,
    IgnoreEmailPager = 4,
    IgnoreWebPanel = 8,
  };
  bool ignoreType(unsigned type) const          { return (myIgnoreTypes & type); }
  void setIgnoreType(unsigned type, bool ignore);

  /**
   * Get path for the base dir (e.g. /home/fred/.licq/)
   *
   * @return Full path for base dir, ending with a slash
   */
  const std::string& baseDir() const { return myBaseDir; }

  /**
   * Get path for plugin libraries (e.g. /usr/local/lib/licq/)
   *
   * @return Full path for library dir, ending with a slash
   */
  const std::string& libDir() const { return myLibDir; }

  /**
   * Get path for data files (e.g. /usr/local/share/licq/)
   *
   * @return Full path for share dir, ending with a slash
   */
  const std::string& shareDir() const { return myShareDir; }

protected:
  virtual ~Daemon() { /* Empty */ }

  bool myShuttingDown;
  std::string myTerminal;
  bool mySendTypingNotification;
  unsigned myIgnoreTypes;

  // Firewall
  bool myTcpEnabled;
  bool myBehindFirewall;
  unsigned myTcpPortsLow;
  unsigned myTcpPortsHigh;

  // Proxy
  bool myProxyEnabled;
  unsigned myProxyType;
  std::string myProxyHost;
  unsigned myProxyPort;
  bool myProxyAuthEnabled;
  std::string myProxyLogin;
  std::string myProxyPasswd;

  // Paths
  std::string myBaseDir;
  std::string myLibDir;
  std::string myShareDir;
};

extern Daemon& gDaemon;

} // namespace Licq

#endif