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 <sys/types.h>
00023
#include <sys/time.h>
00024
#include <kstaticdeleter.h>
00025
00026
class KSocksTable;
00027
class KSocksPrivate;
00028
class KLibrary;
00029
class KConfigBase;
00030
struct sockaddr;
00031
00032
typedef unsigned ksocklen_t;
00033
00034
00045 class KSocks {
00046
friend class KStaticDeleter<KSocks>;
00047
00048
public:
00049
00055
static KSocks *
self();
00056
00061
static bool activated();
00062
00066
void disableSocks();
00067
00071
void enableSocks();
00072
00077
bool usingSocks();
00078
00083
bool hasSocks();
00084
00089
bool hasWorkingAsyncConnect();
00090
00091
00092
00093
00098
int connect (
int sockfd,
const sockaddr *serv_addr,
00099 ksocklen_t addrlen);
00104
signed long int read (
int fd,
void *buf,
unsigned long int count);
00109
signed long int write (
int fd,
const void *buf,
unsigned long int count);
00114
int recvfrom (
int s,
void *buf,
unsigned long int len,
int flags,
00115 sockaddr *from, ksocklen_t *fromlen);
00120
int sendto (
int s,
const void *msg,
unsigned long int len,
int flags,
00121
const sockaddr *to, ksocklen_t tolen);
00126
int recv (
int s,
void *buf,
unsigned long int len,
int flags);
00131
int send (
int s,
const void *msg,
unsigned long int len,
int flags);
00136
int getsockname (
int s, sockaddr *name, ksocklen_t *namelen);
00141
int getpeername (
int s, sockaddr *name, ksocklen_t *namelen);
00146
int accept (
int s, sockaddr *addr, ksocklen_t *addrlen);
00151
int select (
int n, fd_set *readfds, fd_set *writefds,
00152 fd_set *exceptfds,
struct timeval *timeout);
00157
int listen (
int s,
int backlog);
00158
00163
int bind (
int sockfd, sockaddr *my_addr,
00164 ksocklen_t addrlen);
00165
int bind (
int sockfd,
const sockaddr *my_addr,
00166 ksocklen_t addrlen);
00167
00173
void die();
00174
00179
static void disable();
00180
00185
static void setConfig(
KConfigBase *config);
00186
00187
private:
00188 KSocks(
KConfigBase *config);
00189 ~KSocks();
00190
00191
void stopSocks();
00192
00193
static KSocks *_me;
00194
static bool _disabled;
00195
QStringList _libNames;
00196
QStringList _libPaths;
00197
bool _useSocks, _hasSocks;
00198
KLibrary* _socksLib;
00199
00200
00201 KSocksTable *_st;
00202 KSocksPrivate *d;
00203 };
00204
00205
00206
00207
00208
#endif
This file is part of the documentation for kdecore Library Version 3.3.1.