• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • network
k3socks.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001-2003 George Staikos <staikos@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include <config.h>
20 #define I_KNOW_KSOCKS_ISNT_PUBLIC
21 #include "k3socks.h" //krazy:exclude=includes (not public: you should know you need kde_socklen_t if you use this)
22 #undef I_KNOW_KSOCKS_ISNT_PUBLIC
23 
24 #ifdef HAVE_SYS_TIME_H
25 #include <sys/time.h>
26 #endif
27 
28 #include <QtCore/QFile>
29 #include <QtCore/QCharRef>
30 #include <QtCore/QMap>
31 
32 #include <klocale.h>
33 #include <kdebug.h>
34 #include "klibloader.h"
35 #include <kconfig.h>
36 
37 #include <sys/types.h>
38 #include <sys/socket.h>
39 
40 #include <unistd.h>
41 
42 #include <kconfiggroup.h>
43 
44 // DO NOT RE-ORDER THESE.
45 enum SymbolKeys {
46  S_SOCKSinit = 0,
47  S_connect = 1,
48  S_read = 2,
49  S_write = 3,
50  S_recvfrom = 4,
51  S_sendto = 5,
52  S_recv = 6,
53  S_send = 7,
54  S_getsockname = 8,
55  S_getpeername = 9,
56  S_accept = 10,
57  S_select = 11,
58  S_listen = 12,
59  S_bind = 13
60  };
61 
62 
63 extern "C" {
64 // Function pointer table
65 static int (*F_SOCKSinit) (char *) = 0L;
66 static int (*F_connect) (int, const struct sockaddr *, kde_socklen_t) = 0L;
67 static signed long int (*F_read) (int, void *, unsigned long int) = 0L;
68 static signed long int (*F_write) (int, const void *, unsigned long int) = 0L;
69 static int (*F_recvfrom) (int, void *, unsigned long int, int, struct sockaddr *,
70  kde_socklen_t *) = 0L;
71 static int (*F_sendto) (int, const void *, unsigned long int, int,
72  const struct sockaddr *, kde_socklen_t) = 0L;
73 static int (*F_recv) (int, void *, unsigned long int, int) = 0L;
74 static int (*F_send) (int, const void *, unsigned long int, int) = 0L;
75 static int (*F_getsockname) (int, struct sockaddr *, kde_socklen_t *) = 0L;
76 static int (*F_getpeername) (int, struct sockaddr *, kde_socklen_t *) = 0L;
77 static int (*F_accept) (int, struct sockaddr *, kde_socklen_t *) = 0L;
78 static int (*F_select) (int, fd_set *, fd_set *, fd_set *,
79  struct timeval *) = 0L;
80 static int (*F_listen) (int, int) = 0L;
81 static int (*F_bind) (int, const struct sockaddr *, kde_socklen_t) = 0L;
82 }
83 
84 
85 class KSocksTable {
86  public:
87  KSocksTable();
88  virtual ~KSocksTable();
89 
90  // The name of each symbol and it's SOCKS replacement
91  QMap<SymbolKeys,QByteArray> symbols;
92  // The name of this library
93  QString myname;
94  bool hasWorkingAsyncConnect;
95 };
96 
97 
98 KSocksTable::KSocksTable() : myname(QString::fromLatin1("Unknown")), hasWorkingAsyncConnect(true) {
99 }
100 
101 KSocksTable::~KSocksTable() {
102 }
103 
104 
105 /*
106  * How to add support for a new SOCKS package.
107  *
108  * 1) Subclass KSocksTable as is done below and write out all the symbols
109  * 1.b) Give the class a "myname"
110  * 2) Make sure that all possible library names are written into the
111  * _libNames string list. Don't forget that different OSes name shared
112  * libraries differently. Expect .so, .sl, .a (!) (AIX does this).
113  * 3) Find a unique symbol in the library that we can use to identify that
114  * library and write out the test case in the constructor
115  * 4) Make necessary changes to the KControl module in kdebase/kcontrol/....
116  * 5) TEST!
117  *
118  */
119 
123 
124 
125 //
126 // Support for NEC SOCKS client
127 //
128 
129 class KNECSocksTable : public KSocksTable {
130  public:
131  KNECSocksTable();
132  virtual ~KNECSocksTable();
133 };
134 
135 
136 KNECSocksTable::KNECSocksTable() : KSocksTable() {
137  myname = i18n("NEC SOCKS client");
138  symbols.insert(S_SOCKSinit, "SOCKSinit");
139  symbols.insert(S_connect, "connect");
140  symbols.insert(S_read, "read");
141  symbols.insert(S_write, "write");
142  symbols.insert(S_recvfrom, "recvfrom");
143  symbols.insert(S_sendto, "sendto");
144  symbols.insert(S_recv, "recv");
145  symbols.insert(S_send, "send");
146  symbols.insert(S_getsockname, "getsockname");
147  symbols.insert(S_getpeername, "getpeername");
148  symbols.insert(S_accept, "accept");
149  symbols.insert(S_select, "select");
150  symbols.insert(S_listen, "listen");
151  symbols.insert(S_bind, "bind");
152 }
153 
154 KNECSocksTable::~KNECSocksTable() {
155 }
156 
157 
158 
159 
160 //
161 // Support for Dante SOCKS client
162 //
163 
164 class KDanteSocksTable : public KSocksTable {
165  public:
166  KDanteSocksTable();
167  virtual ~KDanteSocksTable();
168 };
169 
170 KDanteSocksTable::KDanteSocksTable() : KSocksTable() {
171  hasWorkingAsyncConnect = false;
172  myname = i18n("Dante SOCKS client");
173  symbols.insert(S_SOCKSinit, "SOCKSinit");
174  symbols.insert(S_connect, "Rconnect");
175  symbols.insert(S_read, "Rread");
176  symbols.insert(S_write, "Rwrite");
177  symbols.insert(S_recvfrom, "Rrecvfrom");
178  symbols.insert(S_sendto, "Rsendto");
179  symbols.insert(S_recv, "Rrecv");
180  symbols.insert(S_send, "Rsend");
181  symbols.insert(S_getsockname, "Rgetsockname");
182  symbols.insert(S_getpeername, "Rgetpeername");
183  symbols.insert(S_accept, "Raccept");
184  symbols.insert(S_select, "Rselect");
185  symbols.insert(S_listen, "Rlisten");
186  symbols.insert(S_bind, "Rbind");
187 }
188 
189 
190 KDanteSocksTable::~KDanteSocksTable() {
191 }
192 
193 
194 
198 
199 class KSocks::KSocksPrivate
200 {
201 public:
202  KSocksPrivate() :
203  _useSocks(false),
204  _hasSocks(false),
205  _socksLib(0L),
206  _st(0L)
207  {}
208 
209  static int debugArea() { static int s_area = KDebug::registerArea("kdecore (KSocks)"); return s_area; }
210 
211  QList<QByteArray> _libNames;
212  QList<QByteArray> _libPaths;
213  bool _useSocks;
214  bool _hasSocks;
215  KLibrary* _socksLib;
216  KSocksTable *_st;
217 };
218 
219 KSocks *KSocks::_me = 0;
220 #ifdef __CYGWIN__
221 bool KSocks::_disabled = true;
222 #else
223 bool KSocks::_disabled = false;
224 #endif
225 
226 void KSocks::disable()
227 {
228  if (!_me)
229  _disabled = true;
230 }
231 
232 KSocks *KSocks::self() {
233  // Note that we don't use a static deleter here. It makes no sense and tends to cause crashes.
234  if (!_me) {
235  if (KGlobal::hasMainComponent()) {
236  KConfigGroup cfg(KGlobal::config(), "Socks");
237  _me = new KSocks(&cfg);
238  } else {
239  _disabled = true;
240  _me = new KSocks(0);
241  }
242  }
243  return _me;
244 }
245 
246 void KSocks::setConfig(const KConfigGroup *config)
247 {
248  // We can change the config from disabled to enabled
249  // but not the other way around.
250  if (_me && _disabled) {
251  delete _me;
252  _me = 0;
253  _disabled = false;
254  }
255  if (!_me)
256  _me = new KSocks(config);
257 }
258 
259 bool KSocks::activated() { return (_me != 0L); }
260 
261 // Function for the KControl module to test if the socks support works.
262 KDECORE_EXPORT bool kdeHasSocks() { return KSocks::self()->hasSocks(); }
263 
264 KSocks::KSocks(const KConfigGroup *config)
265  : d(new KSocksPrivate())
266 {
267  if (!config)
268  return;
269 
270  if (!config->readEntry("SOCKS_enable", false)) {
271  _disabled = true;
272  }
273 
274  if (_disabled)
275  return;
276 
277  d->_libPaths << ""
278  << "/usr/lib" KDELIBSUFF "/"
279  << "/usr/lib/"
280  << "/usr/local/lib" KDELIBSUFF "/"
281  << "/usr/local/lib/"
282  << "/usr/local/socks5/lib" KDELIBSUFF "/"
283  << "/usr/local/socks5/lib/"
284  << "/opt/socks5/lib" KDELIBSUFF "/"
285  << "/opt/socks5/lib/";
286  d->_libNames << "libsocks.so" // Dante
287  << "libdsocksd.so.0" // Dante 1.1.14-2 on
288  // Debian unstable 17-12-2003
289  << "libsocks5.so" // ?
290  << "libsocks5_sh.so"; // NEC
291 
292  // Add the custom library paths here
293  QStringList newlibs = config->readEntry("SOCKS_lib_path", QStringList());
294 
295  for (QStringList::Iterator it = newlibs.begin();
296  it != newlibs.end();
297  ++it) {
298  QString thisone = *it;
299  if (thisone[thisone.length()-1] != QLatin1Char('/'))
300  thisone += QLatin1Char('/');
301  d->_libPaths << QFile::encodeName(thisone);
302  kDebug(d->debugArea()) << "KSocks added a new library path: " << thisone;
303  }
304 
305  // Load the proper libsocks and KSocksTable
306  KLibLoader *ll = KLibLoader::self();
307 
308 
309  int _meth = config->readEntry("SOCKS_method", 1);
310  /**** Current methods
311  * 1) Autodetect (read: any) 2) NEC
312  * 3) Dante 4) Custom
313  */
314 
315  if (_meth == 4) { // try to load^H^H^H^Hguess at a custom library
316  d->_socksLib = ll->library(config->readPathEntry("SOCKS_lib", QString()));
317  if (d->_socksLib && d->_socksLib->resolveFunction("Rconnect")) { // Dante compatible?
318  d->_st = new KDanteSocksTable;
319  d->_useSocks = true;
320  d->_hasSocks = true;
321  } else if (d->_socksLib && d->_socksLib->resolveFunction("connect")) { // NEC compatible?
322  d->_st = new KNECSocksTable;
323  d->_useSocks = true;
324  d->_hasSocks = true;
325  } else if (d->_socksLib) {
326  d->_socksLib->unload();
327  d->_socksLib = 0L;
328  }
329  } else // leave this here "else for {}"
330  for (QList<QByteArray>::const_iterator pit = d->_libPaths.constBegin();
331  !d->_hasSocks && pit != d->_libPaths.constEnd();
332  ++pit)
333  for (QList<QByteArray>::const_iterator it = d->_libNames.constBegin();
334  it != d->_libNames.constEnd();
335  ++it) {
336  d->_socksLib = ll->library(QLatin1String(*pit) + QLatin1String(*it));
337  if (d->_socksLib) {
338  if ((_meth == 1 || _meth == 2) &&
339  d-> _socksLib->resolveFunction("S5LogShowThreadIDS") != 0L) { // NEC SOCKS
340  kDebug(d->debugArea()) << "Found NEC SOCKS";
341  d->_st = new KNECSocksTable;
342  d->_useSocks = true;
343  d->_hasSocks = true;
344  break;
345  } else if ((_meth == 1 || _meth == 3) &&
346  d->_socksLib->resolveFunction("sockaddr2ruleaddress") != 0L) { //Dante
347  kDebug(d->debugArea()) << "Found Dante SOCKS";
348  d->_st = new KDanteSocksTable;
349  d->_useSocks = true;
350  d->_hasSocks = true;
351  break;
352  } else {
353  d->_socksLib->unload();
354  d->_socksLib = 0L;
355  }
356  }
357  }
358 
359  // Load in all the symbols
360  if (d->_st) {
361  for (QMap<SymbolKeys,QByteArray>::Iterator it = d->_st->symbols.begin();
362  it != d->_st->symbols.end();
363  ++it) {
364  switch(it.key()) {
365  case S_SOCKSinit:
366  F_SOCKSinit = (int (*)(char *))
367  d->_socksLib->resolveFunction(it.value());
368  break;
369  case S_connect:
370  F_connect = (int (*)(int, const struct sockaddr *, kde_socklen_t))
371  d->_socksLib->resolveFunction(it.value());
372  break;
373  case S_read:
374  F_read = (signed long int (*)(int, void *, unsigned long int))
375  d->_socksLib->resolveFunction(it.value());
376  break;
377  case S_write:
378  F_write = (signed long int (*)(int, const void *, unsigned long int))
379  d->_socksLib->resolveFunction(it.value());
380  break;
381  case S_recvfrom:
382  F_recvfrom = (int (*)(int, void *, unsigned long int, int,
383  struct sockaddr *, kde_socklen_t *))
384  d->_socksLib->resolveFunction(it.value());
385  break;
386  case S_sendto:
387  F_sendto = (int (*)(int, const void *, unsigned long int, int,
388  const struct sockaddr *, kde_socklen_t))
389  d->_socksLib->resolveFunction(it.value());
390  break;
391  case S_recv:
392  F_recv = (int (*)(int, void *, unsigned long int, int))
393  d->_socksLib->resolveFunction(it.value());
394  break;
395  case S_send:
396  F_send = (int (*)(int, const void *, unsigned long int, int))
397  d->_socksLib->resolveFunction(it.value());
398  break;
399  case S_getsockname:
400  F_getsockname = (int (*)(int, struct sockaddr *, kde_socklen_t *))
401  d->_socksLib->resolveFunction(it.value());
402  break;
403  case S_getpeername:
404  F_getpeername = (int (*)(int, struct sockaddr *, kde_socklen_t *))
405  d->_socksLib->resolveFunction(it.value());
406  break;
407  case S_accept:
408  F_accept = (int (*)(int, struct sockaddr *, kde_socklen_t *))
409  d->_socksLib->resolveFunction(it.value());
410  break;
411  case S_select:
412  F_select = (int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval *))
413  d->_socksLib->resolveFunction(it.value());
414  break;
415  case S_listen:
416  F_listen = (int (*)(int, int))
417  d->_socksLib->resolveFunction(it.value());
418  break;
419  case S_bind:
420  F_bind = (int (*)(int, const struct sockaddr *, kde_socklen_t))
421  d->_socksLib->resolveFunction(it.value());
422  break;
423  default:
424  kDebug(d->debugArea()) << "KSocks got a symbol it doesn't know about!";
425  break;
426  }
427  }
428 
429  // Now we check for the critical stuff.
430  if (F_SOCKSinit) {
431  int rc = (*F_SOCKSinit)((char *)"KDE");
432  if (rc != 0)
433  stopSocks();
434  else kDebug(d->debugArea()) << "SOCKS has been activated!";
435  } else {
436  stopSocks();
437  }
438  }
439 }
440 
441 
442 KSocks::~KSocks() {
443  stopSocks();
444  _me = 0;
445  delete d;
446 }
447 
448 void KSocks::die() {
449  if (_me == this) {
450  _me = 0;
451  delete this;
452  }
453 }
454 
455 void KSocks::stopSocks() {
456  if (d->_hasSocks) {
457  // This library doesn't even provide the basics.
458  // It's probably broken. Let's abort.
459  d->_useSocks = false;
460  d->_hasSocks = false;
461  if (d->_socksLib) {
462  d->_socksLib->unload();
463  d->_socksLib = 0L;
464  }
465  delete d->_st;
466  d->_st = 0L;
467  }
468 }
469 
470 
471 bool KSocks::usingSocks() {
472  return d->_useSocks;
473 }
474 
475 
476 bool KSocks::hasSocks() {
477  return d->_hasSocks;
478 }
479 
480 
481 void KSocks::disableSocks() {
482  d->_useSocks = false;
483 }
484 
485 
486 void KSocks::enableSocks() {
487  if (d->_hasSocks)
488  d->_useSocks = true;
489 }
490 
491 bool KSocks::hasWorkingAsyncConnect()
492 {
493  return (d->_useSocks && d->_st) ? d->_st->hasWorkingAsyncConnect : true;
494 }
495 
496 
497 /*
498  * REIMPLEMENTED FUNCTIONS FROM LIBC
499  *
500  */
501 
502 int KSocks::connect (int sockfd, const sockaddr *serv_addr,
503  kde_socklen_t addrlen) {
504  if (d->_useSocks && F_connect)
505  return (*F_connect)(sockfd, serv_addr, addrlen);
506  else return ::connect(sockfd, (sockaddr*) serv_addr, (socklen_t)addrlen);
507 }
508 
509 
510 signed long int KSocks::read (int fd, void *buf, unsigned long int count) {
511  if (d->_useSocks && F_read)
512  return (*F_read)(fd, buf, count);
513  else return ::read(fd, buf, count);
514 }
515 
516 
517 signed long int KSocks::write (int fd, const void *buf, unsigned long int count) {
518  if (d->_useSocks && F_write)
519  return (*F_write)(fd, buf, count);
520  else return ::write(fd, buf, count);
521 }
522 
523 
524 int KSocks::recvfrom (int s, void *buf, unsigned long int len, int flags,
525  sockaddr *from, kde_socklen_t *fromlen) {
526  if (d->_useSocks && F_recvfrom) {
527  return (*F_recvfrom)(s, buf, len, flags, from, fromlen);
528  } else {
529  socklen_t casted_len = (socklen_t) *fromlen;
530  int rc = ::recvfrom(s, (char*) buf, len, flags, from, &casted_len);
531  *fromlen = casted_len;
532  return rc;
533  }
534 }
535 
536 
537 int KSocks::sendto (int s, const void *msg, unsigned long int len, int flags,
538  const sockaddr *to, kde_socklen_t tolen) {
539  if (d->_useSocks && F_sendto)
540  return (*F_sendto)(s, msg, len, flags, to, tolen);
541  else return ::sendto(s, (char*) msg, len, flags, to, (socklen_t)tolen);
542 }
543 
544 
545 int KSocks::recv (int s, void *buf, unsigned long int len, int flags) {
546  if (d->_useSocks && F_recv)
547  return (*F_recv)(s, buf, len, flags);
548  else return ::recv(s, (char*) buf, len, flags);
549 }
550 
551 
552 int KSocks::send (int s, const void *msg, unsigned long int len, int flags) {
553  if (d->_useSocks && F_send)
554  return (*F_send)(s, msg, len, flags);
555  else return ::send(s, (char*) msg, len, flags);
556 }
557 
558 
559 int KSocks::getsockname (int s, sockaddr *name, kde_socklen_t *namelen) {
560  if (d->_useSocks && F_getsockname) {
561  return (*F_getsockname)(s, name, namelen);
562  } else {
563  socklen_t casted_len = *namelen;
564  int rc = ::getsockname(s, name, &casted_len);
565  *namelen = casted_len;
566  return rc;
567  }
568 }
569 
570 
571 int KSocks::getpeername (int s, sockaddr *name, kde_socklen_t *namelen) {
572  if (d->_useSocks && F_getpeername) {
573  return (*F_getpeername)(s, name, namelen);
574  } else {
575  socklen_t casted_len = *namelen;
576  int rc = ::getpeername(s, name, &casted_len);
577  *namelen = casted_len;
578  return rc;
579  }
580 }
581 
582 
583 int KSocks::accept (int s, sockaddr *addr, kde_socklen_t *addrlen) {
584  if (d->_useSocks && F_accept) {
585  return (*F_accept)(s, addr, addrlen);
586  } else {
587  socklen_t casted_len = *addrlen;
588  int rc = ::accept(s, addr, &casted_len);
589  *addrlen = casted_len;
590  return rc;
591  }
592 }
593 
594 
595 int KSocks::select (int n, fd_set *readfds, fd_set *writefds,
596  fd_set *exceptfds, struct timeval *timeout) {
597  if (d->_useSocks && F_select)
598  return (*F_select)(n, readfds, writefds, exceptfds, timeout);
599  else return ::select(n, readfds, writefds, exceptfds, timeout);
600 }
601 
602 
603 int KSocks::listen (int s, int backlog) {
604  if (d->_useSocks && F_listen)
605  return (*F_listen)(s, backlog);
606  else return ::listen(s, backlog);
607 }
608 
609 
610 int KSocks::bind (int sockfd, const sockaddr *my_addr, kde_socklen_t addrlen) {
611  if (d->_useSocks && F_bind)
612  return (*F_bind)(sockfd, my_addr, addrlen);
613  else return ::bind(sockfd, my_addr, (socklen_t)addrlen);
614 }
615 
616 int KSocks::bind (int sockfd, sockaddr *my_addr, kde_socklen_t addrlen) {
617  if (d->_useSocks && F_bind)
618  return (*F_bind)(sockfd, my_addr, addrlen);
619  else return ::bind(sockfd, my_addr, (socklen_t)addrlen);
620 }
621 
622 
623 
S_getpeername
Definition: k3socks.cpp:55
i18n
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
KLibLoader::library
KLibrary * library(const QString &libname, QLibrary::LoadHints loadHint=0)
Loads and initializes a library.
Definition: klibloader.cpp:89
KConfigGroup::readPathEntry
QString readPathEntry(const QString &pKey, const QString &aDefault) const
Reads a path.
Definition: kconfiggroup.cpp:780
S_recv
Definition: k3socks.cpp:52
kdebug.h
F_write
static signed long int(* F_write)(int, const void *, unsigned long int)=0L
Definition: k3socks.cpp:68
timeout
int timeout
Definition: kkernel_mac.cpp:46
kconfig.h
QMap< SymbolKeys, QByteArray >
F_getsockname
static int(* F_getsockname)(int, struct sockaddr *, kde_socklen_t *)=0L
Definition: k3socks.cpp:75
F_accept
static int(* F_accept)(int, struct sockaddr *, kde_socklen_t *)=0L
Definition: k3socks.cpp:77
KSocketFactory::listen
QTcpServer * listen(const QString &protocol, const QHostAddress &address=QHostAddress::Any, quint16 port=0, QObject *parent=0)
Opens a TCP/IP socket for listening protocol protocol, binding only at address address.
Definition: ksocketfactory.cpp:115
S_select
Definition: k3socks.cpp:57
F_send
static int(* F_send)(int, const void *, unsigned long int, int)=0L
Definition: k3socks.cpp:74
klocale.h
KGlobal::config
KSharedConfigPtr config()
Returns the general config object.
Definition: kglobal.cpp:139
S_SOCKSinit
Definition: k3socks.cpp:46
F_recvfrom
static int(* F_recvfrom)(int, void *, unsigned long int, int, struct sockaddr *, kde_socklen_t *)=0L
Definition: k3socks.cpp:69
S_send
Definition: k3socks.cpp:53
k3socks.h
F_getpeername
static int(* F_getpeername)(int, struct sockaddr *, kde_socklen_t *)=0L
Definition: k3socks.cpp:76
S_bind
Definition: k3socks.cpp:59
S_accept
Definition: k3socks.cpp:56
kdeHasSocks
bool kdeHasSocks()
Definition: k3socks.cpp:262
S_recvfrom
Definition: k3socks.cpp:50
F_SOCKSinit
static int(* F_SOCKSinit)(char *)=0L
Definition: k3socks.cpp:65
F_select
static int(* F_select)(int, fd_set *, fd_set *, fd_set *, struct timeval *)=0L
Definition: k3socks.cpp:78
F_sendto
static int(* F_sendto)(int, const void *, unsigned long int, int, const struct sockaddr *, kde_socklen_t)=0L
Definition: k3socks.cpp:71
S_sendto
Definition: k3socks.cpp:51
F_listen
static int(* F_listen)(int, int)=0L
Definition: k3socks.cpp:80
KDebug::registerArea
static int registerArea(const QByteArray &areaName, bool enabled=true)
Definition: kdebug.cpp:856
KLibrary
Thin wrapper around QLibrary; you should rarely use this directly, see KPluginLoader for higher-level...
Definition: klibrary.h:38
F_read
static signed long int(* F_read)(int, void *, unsigned long int)=0L
Definition: k3socks.cpp:67
QList::Iterator
typedef Iterator
S_getsockname
Definition: k3socks.cpp:54
QString
QList< QByteArray >
QMap::begin
iterator begin()
QStringList
QList::end
iterator end()
QLatin1Char
F_recv
static int(* F_recv)(int, void *, unsigned long int, int)=0L
Definition: k3socks.cpp:73
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:53
KLibLoader::self
static KLibLoader * self()
Returns a pointer to the factory.
Definition: klibloader.cpp:46
S_read
Definition: k3socks.cpp:48
KLibLoader
The KLibLoader allows you to load libraries dynamically at runtime.
Definition: klibloader.h:55
QLatin1String
F_connect
static int(* F_connect)(int, const struct sockaddr *, kde_socklen_t)=0L
Definition: k3socks.cpp:66
S_listen
Definition: k3socks.cpp:58
KGlobal::hasMainComponent
bool hasMainComponent()
Definition: kglobal.cpp:151
QString::length
int length() const
kDebug
#define kDebug
Definition: kdebug.h:316
klibloader.h
S_connect
Definition: k3socks.cpp:47
QList::constBegin
const_iterator constBegin() const
KLibrary::unload
bool unload()
Definition: klibrary.h:79
KConfigGroup::readEntry
T readEntry(const QString &key, const T &aDefault) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfiggroup.h:248
QList::begin
iterator begin()
F_bind
static int(* F_bind)(int, const struct sockaddr *, kde_socklen_t)=0L
Definition: k3socks.cpp:81
QFile::encodeName
QByteArray encodeName(const QString &fileName)
kconfiggroup.h
SymbolKeys
SymbolKeys
Definition: k3socks.cpp:45
S_write
Definition: k3socks.cpp:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal