ksocks.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KSOCKS_H_
00019 #define _KSOCKS_H_
00020
00021 #include <qstringlist.h>
00022 #include <ksockaddr.h>
00023 #include <sys/types.h>
00024 #include <sys/time.h>
00025 #include <kstaticdeleter.h>
00026
00027 class KSocksTable;
00028 class KSocksPrivate;
00029 class KLibrary;
00030 class KConfigBase;
00031 struct sockaddr;
00032
00033
00044 class KSocks {
00045 friend class KStaticDeleter<KSocks>;
00046
00047 public:
00048
00054 static KSocks *self();
00055
00060 static bool activated();
00061
00065 void disableSocks();
00066
00070 void enableSocks();
00071
00076 bool usingSocks();
00077
00082 bool hasSocks();
00083
00088 bool hasWorkingAsyncConnect();
00089
00090
00091
00092
00097 int connect (int sockfd, const sockaddr *serv_addr,
00098 ksocklen_t addrlen);
00103 signed long int read (int fd, void *buf, unsigned long int count);
00108 signed long int write (int fd, const void *buf, unsigned long int count);
00113 int recvfrom (int s, void *buf, unsigned long int len, int flags,
00114 sockaddr *from, ksocklen_t *fromlen);
00119 int sendto (int s, const void *msg, unsigned long int len, int flags,
00120 const sockaddr *to, ksocklen_t tolen);
00125 int recv (int s, void *buf, unsigned long int len, int flags);
00130 int send (int s, const void *msg, unsigned long int len, int flags);
00135 int getsockname (int s, sockaddr *name, ksocklen_t *namelen);
00140 int getpeername (int s, sockaddr *name, ksocklen_t *namelen);
00145 int accept (int s, sockaddr *addr, ksocklen_t *addrlen);
00150 int select (int n, fd_set *readfds, fd_set *writefds,
00151 fd_set *exceptfds, struct timeval *timeout);
00156 int listen (int s, int backlog);
00157
00162 int bind (int sockfd, sockaddr *my_addr,
00163 ksocklen_t addrlen);
00164 int bind (int sockfd, const sockaddr *my_addr,
00165 ksocklen_t addrlen);
00166
00172 void die();
00173
00178 static void disable();
00179
00184 static void setConfig(KConfigBase *config);
00185
00186 private:
00187 KSocks(KConfigBase *config);
00188 ~KSocks();
00189
00190 void stopSocks();
00191
00192 static KSocks *_me;
00193 static bool _disabled;
00194 QStringList _libNames;
00195 QStringList _libPaths;
00196 bool _useSocks, _hasSocks;
00197 KLibrary* _socksLib;
00198
00199
00200 KSocksTable *_st;
00201 KSocksPrivate *d;
00202 };
00203
00204
00205
00206
00207 #endif
This file is part of the documentation for kdecore Library Version 3.2.3.