kdecore Library API Documentation

KSocks Class Reference

This class provides you with an interface to a SOCKS Proxy server. Access to a SOCKS Proxy. More...

#include <ksocks.h>

List of all members.

Public Member Functions

void disableSocks ()
void enableSocks ()
bool usingSocks ()
bool hasSocks ()
bool hasWorkingAsyncConnect ()
int connect (int sockfd, const sockaddr *serv_addr, ksocklen_t addrlen)
signed long int read (int fd, void *buf, unsigned long int count)
signed long int write (int fd, const void *buf, unsigned long int count)
int recvfrom (int s, void *buf, unsigned long int len, int flags, sockaddr *from, ksocklen_t *fromlen)
int sendto (int s, const void *msg, unsigned long int len, int flags, const sockaddr *to, ksocklen_t tolen)
int recv (int s, void *buf, unsigned long int len, int flags)
int send (int s, const void *msg, unsigned long int len, int flags)
int getsockname (int s, sockaddr *name, ksocklen_t *namelen)
int getpeername (int s, sockaddr *name, ksocklen_t *namelen)
int accept (int s, sockaddr *addr, ksocklen_t *addrlen)
int select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
int listen (int s, int backlog)
int bind (int sockfd, sockaddr *my_addr, ksocklen_t addrlen)
int bind (int sockfd, const sockaddr *my_addr, ksocklen_t addrlen)
void die ()

Static Public Member Functions

KSocksself ()
bool activated ()
void disable ()
void setConfig (KConfigBase *config)

Friends

class KStaticDeleter<KSocks>


Detailed Description

This class provides you with an interface to a SOCKS Proxy server. Access to a SOCKS Proxy.

A SOCKS server is able to provide full internet access behind a firewall. KSocks is a singleton; there can only be one instance at any given time. To obtain a reference to that instance, use self().

Definition at line 45 of file ksocks.h.


Member Function Documentation

KSocks * KSocks::self  )  [static]
 

Return an instance of class KSocks *.

You cannot delete this object. It is a singleton class.

Returns:
the KSock instance

Definition at line 207 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::accept(), KExtendedSocket::accept(), KNetwork::KSocksSocketDevice::bind(), KNetwork::KSocksSocketDevice::connect(), KExtendedSocket::connect(), KExtendedSocket::flush(), KSocket::KSocket(), KNetwork::KSocksSocketDevice::listen(), KExtendedSocket::listen(), KNetwork::KSocksSocketDevice::localAddress(), KExtendedSocket::localAddress(), KNetwork::KSocksSocketDevice::peerAddress(), KExtendedSocket::peerAddress(), KNetwork::KSocksSocketDevice::poll(), KExtendedSocket::readBlock(), KExtendedSocket::waitForMore(), KNetwork::KSocksSocketDevice::writeBlock(), and KExtendedSocket::writeBlock().

bool KSocks::activated  )  [static]
 

Checks whether KSocks has been started (ie someone called self()).

Returns:
true if activated

Definition at line 234 of file ksocks.cpp.

void KSocks::disableSocks  ) 
 

Disable the use of SOCKS immediately.

Definition at line 453 of file ksocks.cpp.

void KSocks::enableSocks  ) 
 

Enable the use of SOCKS immediately if hasSocks() is true.

Definition at line 458 of file ksocks.cpp.

bool KSocks::usingSocks  ) 
 

Checks whether SOCKS is currently being used.

Returns:
true if SOCKS is currently being used.

Definition at line 443 of file ksocks.cpp.

bool KSocks::hasSocks  ) 
 

Checks whether SOCKS is available for use.

Returns:
true if SOCKS is available for use.

Definition at line 448 of file ksocks.cpp.

bool KSocks::hasWorkingAsyncConnect  ) 
 

Returns whether asynchronous connects work with the selected SOCKS impementation.

Definition at line 463 of file ksocks.cpp.

Referenced by KExtendedSocket::connect().

int KSocks::connect int  sockfd,
const sockaddr *  serv_addr,
ksocklen_t  addrlen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 474 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::connect(), and KExtendedSocket::connect().

signed long int KSocks::read int  fd,
void *  buf,
unsigned long int  count
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 482 of file ksocks.cpp.

Referenced by KExtendedSocket::readBlock().

signed long int KSocks::write int  fd,
const void *  buf,
unsigned long int  count
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 489 of file ksocks.cpp.

Referenced by KExtendedSocket::flush(), and KExtendedSocket::writeBlock().

int KSocks::recvfrom int  s,
void *  buf,
unsigned long int  len,
int  flags,
sockaddr *  from,
ksocklen_t *  fromlen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 496 of file ksocks.cpp.

int KSocks::sendto int  s,
const void *  msg,
unsigned long int  len,
int  flags,
const sockaddr *  to,
ksocklen_t  tolen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 509 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::writeBlock().

int KSocks::recv int  s,
void *  buf,
unsigned long int  len,
int  flags
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 517 of file ksocks.cpp.

int KSocks::send int  s,
const void *  msg,
unsigned long int  len,
int  flags
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 524 of file ksocks.cpp.

int KSocks::getsockname int  s,
sockaddr *  name,
ksocklen_t *  namelen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 531 of file ksocks.cpp.

Referenced by KSocket::KSocket(), KNetwork::KSocksSocketDevice::localAddress(), and KExtendedSocket::localAddress().

int KSocks::getpeername int  s,
sockaddr *  name,
ksocklen_t *  namelen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 543 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::peerAddress(), and KExtendedSocket::peerAddress().

int KSocks::accept int  s,
sockaddr *  addr,
ksocklen_t *  addrlen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 555 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::accept(), and KExtendedSocket::accept().

int KSocks::select int  n,
fd_set *  readfds,
fd_set *  writefds,
fd_set *  exceptfds,
struct timeval *  timeout
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 567 of file ksocks.cpp.

Referenced by KExtendedSocket::accept(), KExtendedSocket::connect(), KNetwork::KSocksSocketDevice::poll(), and KExtendedSocket::waitForMore().

int KSocks::listen int  s,
int  backlog
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 575 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::listen(), and KExtendedSocket::listen().

int KSocks::bind int  sockfd,
sockaddr *  my_addr,
ksocklen_t  addrlen
 

This is the re-implementation of libc's function of the same name.

Read the appropriate man page.

Definition at line 588 of file ksocks.cpp.

Referenced by KNetwork::KSocksSocketDevice::bind(), KExtendedSocket::connect(), and KExtendedSocket::listen().

void KSocks::die  ) 
 

If you're using this, you're probably doing something wrong.

Please don't use it.

Definition at line 420 of file ksocks.cpp.

void KSocks::disable  )  [static]
 

Set this before the first call to KSocks::self() and it will fail to initialize SOCKS.

Definition at line 201 of file ksocks.cpp.

void KSocks::setConfig KConfigBase config  )  [static]
 

Set this before the first call to KSocks::self() and it will use config to read its configuration from.

Definition at line 221 of file ksocks.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jan 22 16:44:07 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003