• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | Static Public Member Functions | Friends | List of all members
KSocks Class Reference

#include <ksocks.h>

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

static KSocks * self ()
 
static bool activated ()
 
static void disable ()
 
static void setConfig (TDEConfigBase *config)
 

Friends

class KStaticDeleter< KSocks >
 

Detailed Description

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

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().

Access to a SOCKS Proxy.

Definition at line 48 of file ksocks.h.

Member Function Documentation

◆ accept()

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 560 of file ksocks.cpp.

◆ activated()

bool KSocks::activated ( )
static

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

Returns
true if activated

Definition at line 239 of file ksocks.cpp.

◆ bind() [1/2]

int KSocks::bind ( int  sockfd,
const sockaddr *  my_addr,
ksocklen_t  addrlen 
)

Definition at line 587 of file ksocks.cpp.

◆ bind() [2/2]

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 593 of file ksocks.cpp.

◆ 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 479 of file ksocks.cpp.

◆ die()

void KSocks::die ( )

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

Please don't use it.

Definition at line 425 of file ksocks.cpp.

◆ disable()

void KSocks::disable ( )
static

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

Definition at line 206 of file ksocks.cpp.

◆ disableSocks()

void KSocks::disableSocks ( )

Disable the use of SOCKS immediately.

Definition at line 458 of file ksocks.cpp.

◆ enableSocks()

void KSocks::enableSocks ( )

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

Definition at line 463 of file ksocks.cpp.

◆ getpeername()

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 548 of file ksocks.cpp.

◆ getsockname()

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 536 of file ksocks.cpp.

◆ hasSocks()

bool KSocks::hasSocks ( )

Checks whether SOCKS is available for use.

Returns
true if SOCKS is available for use.

Definition at line 453 of file ksocks.cpp.

◆ hasWorkingAsyncConnect()

bool KSocks::hasWorkingAsyncConnect ( )

Returns whether asynchronous connects work with the selected SOCKS impementation.

Definition at line 468 of file ksocks.cpp.

◆ listen()

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 580 of file ksocks.cpp.

◆ read()

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 487 of file ksocks.cpp.

◆ recv()

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 522 of file ksocks.cpp.

◆ recvfrom()

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 501 of file ksocks.cpp.

◆ select()

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 572 of file ksocks.cpp.

◆ self()

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 212 of file ksocks.cpp.

◆ send()

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 529 of file ksocks.cpp.

◆ sendto()

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 514 of file ksocks.cpp.

◆ setConfig()

void KSocks::setConfig ( TDEConfigBase *  config)
static

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

Definition at line 226 of file ksocks.cpp.

◆ usingSocks()

bool KSocks::usingSocks ( )

Checks whether SOCKS is currently being used.

Returns
true if SOCKS is currently being used.

Definition at line 448 of file ksocks.cpp.

◆ write()

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 494 of file ksocks.cpp.

Friends And Related Function Documentation

◆ KStaticDeleter< KSocks >

friend class KStaticDeleter< KSocks >
friend

Definition at line 35 of file ksocks.h.


The documentation for this class was generated from the following files:
  • ksocks.h
  • ksocks.cpp

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.