Defines | Typedefs | Enumerations | Functions | Variables
sockfilt.c File Reference
#include "server_setup.h"
#include "curlx.h"
#include "getpart.h"
#include "inet_pton.h"
#include "util.h"
#include "server_sockaddr.h"
#include "warnless.h"
#include "memdebug.h"
Include dependency graph for sockfilt.c:

Go to the source code of this file.

Defines

#define DEFAULT_LOGFILE   "log/sockfilt.log"
#define DEFAULT_PORT   8999
#define ENABLE_CURLX_PRINTF
#define siginterrupt(x, y)   do {} while(0)

Typedefs

typedef RETSIGTYPE(* SIGHANDLER_T )(int)

Enumerations

enum  sockmode { PASSIVE_LISTEN, PASSIVE_CONNECT, ACTIVE, ACTIVE_DISCONNECT }

Functions

static RETSIGTYPE exit_signal_handler (int signum)
static ssize_t fullread (int filedes, void *buffer, size_t nbytes)
static ssize_t fullwrite (int filedes, const void *buffer, size_t nbytes)
static void install_signal_handlers (void)
static bool juggle (curl_socket_t *sockfdp, curl_socket_t listenfd, enum sockmode *mode)
static void lograw (unsigned char *buffer, ssize_t len)
int main (int argc, char *argv[])
static bool read_stdin (void *buffer, size_t nbytes)
static void restore_signal_handlers (void)
static curl_socket_t sockdaemon (curl_socket_t sock, unsigned short *listenport)
static bool write_stdout (const void *buffer, size_t nbytes)

Variables

static bool bind_only = FALSE
static unsigned short connectport = 0
static volatile int exit_signal = 0
SIG_ATOMIC_T got_exit_signal = 0
static const char * ipv_inuse = "IPv4"
static unsigned short port = DEFAULT_PORT
const char * serverlogfile = DEFAULT_LOGFILE
static bool verbose = FALSE

Define Documentation

#define DEFAULT_LOGFILE   "log/sockfilt.log"

Definition at line 126 of file sockfilt.c.

#define DEFAULT_PORT   8999

Definition at line 123 of file sockfilt.c.

Definition at line 99 of file sockfilt.c.

#define siginterrupt (   x,
  y 
)    do {} while(0)

Definition at line 150 of file sockfilt.c.


Typedef Documentation

typedef RETSIGTYPE(* SIGHANDLER_T)(int)

Definition at line 155 of file sockfilt.c.


Enumeration Type Documentation

enum sockmode
Enumerator:
PASSIVE_LISTEN 
PASSIVE_CONNECT 
ACTIVE 
ACTIVE_DISCONNECT 

Definition at line 140 of file sockfilt.c.


Function Documentation

static RETSIGTYPE exit_signal_handler ( int  signum) [static]

Definition at line 194 of file sockfilt.c.

static ssize_t fullread ( int  filedes,
void *  buffer,
size_t  nbytes 
) [static]

Definition at line 355 of file sockfilt.c.

static ssize_t fullwrite ( int  filedes,
const void *  buffer,
size_t  nbytes 
) [static]

Definition at line 401 of file sockfilt.c.

static void install_signal_handlers ( void  ) [static]

Definition at line 205 of file sockfilt.c.

static bool juggle ( curl_socket_t sockfdp,
curl_socket_t  listenfd,
enum sockmode mode 
) [static]

Definition at line 912 of file sockfilt.c.

static void lograw ( unsigned char *  buffer,
ssize_t  len 
) [static]

Definition at line 474 of file sockfilt.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 1335 of file sockfilt.c.

static bool read_stdin ( void *  buffer,
size_t  nbytes 
) [static]

Definition at line 447 of file sockfilt.c.

static void restore_signal_handlers ( void  ) [static]

Definition at line 251 of file sockfilt.c.

static curl_socket_t sockdaemon ( curl_socket_t  sock,
unsigned short *  listenport 
) [static]

Definition at line 1193 of file sockfilt.c.

static bool write_stdout ( const void *  buffer,
size_t  nbytes 
) [static]

Definition at line 464 of file sockfilt.c.


Variable Documentation

bool bind_only = FALSE [static]

Definition at line 132 of file sockfilt.c.

unsigned short connectport = 0 [static]

Definition at line 138 of file sockfilt.c.

volatile int exit_signal = 0 [static]

Definition at line 187 of file sockfilt.c.

Definition at line 183 of file sockfilt.c.

const char* ipv_inuse = "IPv4" [static]

Definition at line 136 of file sockfilt.c.

unsigned short port = DEFAULT_PORT [static]

Definition at line 137 of file sockfilt.c.

Definition at line 129 of file sockfilt.c.

bool verbose = FALSE [static]

Definition at line 131 of file sockfilt.c.



rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:09