ucspi-tcp6 1.13.02
ucspi-tcp6
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
tcpserver.c File Reference
#include <sys/types.h>
#include <unistd.h>
#include <sys/param.h>
#include <netdb.h>
#include "uint_t.h"
#include "str.h"
#include "byte.h"
#include "fmt.h"
#include "scan.h"
#include "ip.h"
#include "fd.h"
#include "exit.h"
#include "env.h"
#include "prot.h"
#include "open.h"
#include "wait.h"
#include "genalloc.h"
#include "stralloc.h"
#include "alloc.h"
#include "buffer.h"
#include "logmsg.h"
#include "getoptb.h"
#include "pathexec.h"
#include "socket_if.h"
#include "ndelay.h"
#include "remoteinfo.h"
#include "rules.h"
#include "sig.h"
#include "dnsresolv.h"
Include dependency graph for tcpserver.c:

Go to the source code of this file.

Data Structures

struct  child
 

Macros

#define WHO   "tcpserver"
 

Functions

void drop_nomem (void)
 
 GEN_ALLOC_typedef (GEN_ALLOC_readyplus(child_alloc, GEN_ALLOC_readyplus(struct child, GEN_ALLOC_readyplus(c, GEN_ALLOC_readyplus(len, GEN_ALLOC_readyplus(a)
 
void ipchild_append (char ip[16], unsigned long n)
 
void ipchild_clear (char ip[16])
 
int ipchild_limit (char ip[16], unsigned long n)
 
void cats (char *s)
 
void append (char *ch)
 
void safecats (char *s)
 
void env (const char *s, const char *t)
 
void drop_rules (const char *fnbase)
 
void found (char *data, unsigned int datalen)
 
void doit (int t)
 
void usage (void)
 
void printstatus (void)
 
int main (int argc, char *const *argv)
 

Variables

int verbosity = 1
 
int flagkillopts = 1
 
int flagdelay = 1
 
char * banner = ""
 
int flagremoteinfo = 0
 
int flagremotehost = 1
 
int flagparanoid = 0
 
unsigned long timeout = 26
 
uint32 netif = 0
 
int flagdualstack = 0
 
uint16 localport
 
char localportstr [FMT_ULONG]
 
char localip [16]
 
char localipstr [IP6_FMT]
 
char * localhost = 0
 
const char * thishost = "0.0.0.0"
 
uint16 remoteport
 
char remoteportstr [FMT_ULONG]
 
char remoteip [16]
 
char remoteipstr [IP6_FMT]
 
char * remotehost = 0
 
unsigned long limit = 40
 
unsigned long numchildren = 0
 
unsigned long ipchildren = 0
 
unsigned long maxconip = 0
 
char bspace [16]
 
buffer bo
 
int flagdeny = 0
 
int flagallow = 0
 
int flagallownorules = 0
 
char * fnrules = 0
 
char * fniprules = 0
 
int flag1 = 0
 
unsigned long backlog = 20
 
unsigned long uid = 0
 
unsigned long gid = 0
 

Macro Definition Documentation

◆ WHO

#define WHO   "tcpserver"

Definition at line 31 of file tcpserver.c.

Function Documentation

◆ append()

void append ( char *  ch)

Definition at line 150 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cats()

void cats ( char *  s)

Definition at line 146 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doit()

void doit ( int  t)

Definition at line 209 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drop_nomem()

void drop_nomem ( void  )

Definition at line 77 of file tcpserver.c.

Here is the caller graph for this function:

◆ drop_rules()

void drop_rules ( const char *  fnbase)

Definition at line 173 of file tcpserver.c.

Here is the caller graph for this function:

◆ env()

void env ( const char *  s,
const char *  t 
)

Definition at line 169 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ found()

void found ( char *  data,
unsigned int  datalen 
)

Definition at line 178 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GEN_ALLOC_typedef()

GEN_ALLOC_typedef ( GEN_ALLOC_readyplus(  child_alloc,
GEN_ALLOC_readyplus(  struct child,
GEN_ALLOC_readyplus(  c,
GEN_ALLOC_readyplus(  len,
GEN_ALLOC_readyplus(  a 
)

Definition at line 89 of file tcpserver.c.

◆ ipchild_append()

void ipchild_append ( char  ip[16],
unsigned long  n 
)

Definition at line 95 of file tcpserver.c.

Here is the caller graph for this function:

◆ ipchild_clear()

void ipchild_clear ( char  ip[16])

Definition at line 113 of file tcpserver.c.

Here is the caller graph for this function:

◆ ipchild_limit()

int ipchild_limit ( char  ip[16],
unsigned long  n 
)

Definition at line 127 of file tcpserver.c.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

Definition at line 406 of file tcpserver.c.

Here is the call graph for this function:

◆ printstatus()

void printstatus ( void  )

Definition at line 375 of file tcpserver.c.

Here is the caller graph for this function:

◆ safecats()

void safecats ( char *  s)

Definition at line 154 of file tcpserver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

void usage ( void  )

Definition at line 354 of file tcpserver.c.

Here is the caller graph for this function:

Variable Documentation

◆ backlog

unsigned long backlog = 20

Definition at line 371 of file tcpserver.c.

◆ banner

char* banner = ""

Definition at line 36 of file tcpserver.c.

◆ bo

buffer bo

Definition at line 75 of file tcpserver.c.

◆ bspace

char bspace[16]

Definition at line 74 of file tcpserver.c.

◆ flag1

int flag1 = 0

Definition at line 370 of file tcpserver.c.

◆ flagallow

int flagallow = 0

Definition at line 141 of file tcpserver.c.

◆ flagallownorules

int flagallownorules = 0

Definition at line 142 of file tcpserver.c.

◆ flagdelay

int flagdelay = 1

Definition at line 35 of file tcpserver.c.

◆ flagdeny

int flagdeny = 0

Definition at line 140 of file tcpserver.c.

◆ flagdualstack

int flagdualstack = 0

Definition at line 42 of file tcpserver.c.

◆ flagkillopts

int flagkillopts = 1

Definition at line 34 of file tcpserver.c.

◆ flagparanoid

int flagparanoid = 0

Definition at line 39 of file tcpserver.c.

◆ flagremotehost

int flagremotehost = 1

Definition at line 38 of file tcpserver.c.

◆ flagremoteinfo

int flagremoteinfo = 0

Definition at line 37 of file tcpserver.c.

◆ fniprules

char* fniprules = 0

Definition at line 144 of file tcpserver.c.

◆ fnrules

char* fnrules = 0

Definition at line 143 of file tcpserver.c.

◆ gid

unsigned long gid = 0

Definition at line 373 of file tcpserver.c.

◆ ipchildren

unsigned long ipchildren = 0

Definition at line 71 of file tcpserver.c.

◆ limit

unsigned long limit = 40

Definition at line 69 of file tcpserver.c.

◆ localhost

char* localhost = 0

Definition at line 51 of file tcpserver.c.

◆ localip

char localip[16]

Definition at line 48 of file tcpserver.c.

◆ localipstr

char localipstr[IP6_FMT]

Definition at line 49 of file tcpserver.c.

◆ localport

uint16 localport

Definition at line 46 of file tcpserver.c.

◆ localportstr

char localportstr[FMT_ULONG]

Definition at line 47 of file tcpserver.c.

◆ maxconip

unsigned long maxconip = 0

Definition at line 72 of file tcpserver.c.

◆ netif

uint32 netif = 0

Definition at line 41 of file tcpserver.c.

◆ numchildren

unsigned long numchildren = 0

Definition at line 70 of file tcpserver.c.

◆ remotehost

char* remotehost = 0

Definition at line 59 of file tcpserver.c.

◆ remoteip

char remoteip[16]

Definition at line 56 of file tcpserver.c.

◆ remoteipstr

char remoteipstr[IP6_FMT]

Definition at line 57 of file tcpserver.c.

◆ remoteport

uint16 remoteport

Definition at line 54 of file tcpserver.c.

◆ remoteportstr

char remoteportstr[FMT_ULONG]

Definition at line 55 of file tcpserver.c.

◆ thishost

const char* thishost = "0.0.0.0"

Definition at line 52 of file tcpserver.c.

◆ timeout

unsigned long timeout = 26

Definition at line 40 of file tcpserver.c.

◆ uid

unsigned long uid = 0

Definition at line 372 of file tcpserver.c.

◆ verbosity

int verbosity = 1

Definition at line 33 of file tcpserver.c.