tcp-banger3.c File Reference
#include "squid.h"
Include dependency graph for tcp-banger3.c:

Go to the source code of this file.

Classes

struct  _thing
 

Macros

#define CHANGE_FD_SETSIZE   1
 
#define READ_BUF_SZ   4096
 
#define URL_BUF_SZ   4096
 

Typedefs

typedef struct _thing thing
 

Functions

int tvSubMsec (struct timeval t1, struct timeval t2)
 
static int get_url (const char *url)
 
static void child_main_loop (void)
 
static thingcreate_a_thing (char *argv[])
 
static void create_children (char *argv[])
 
char * parent_read_url (void)
 
static thingget_idle_thing (void)
 
static void dispatch (thing *t, char *url)
 
static void read_reply (thing *t)
 
static void parent_main_loop (void)
 
static void sig_child (int sig)
 
int main (int argc, char *argv[])
 

Variables

static thingthings = NULL
 
static fd_set R1
 
static int maxfd = 0
 
static struct timeval now
 
static int debug = 0
 

Macro Definition Documentation

#define CHANGE_FD_SETSIZE   1

Definition at line 17 of file tcp-banger3.c.

#define READ_BUF_SZ   4096

Definition at line 85 of file tcp-banger3.c.

Referenced by get_url().

#define URL_BUF_SZ   4096

Definition at line 86 of file tcp-banger3.c.

Referenced by child_main_loop(), dispatch(), get_url(), and parent_read_url().

Typedef Documentation

typedef struct _thing thing

Definition at line 96 of file tcp-banger3.c.

Function Documentation

static void child_main_loop ( void  )
static

Definition at line 186 of file tcp-banger3.c.

References buf, debug, get_url(), NULL, tvSubMsec(), and URL_BUF_SZ.

Referenced by create_a_thing().

static thing* create_a_thing ( char *  argv[])
static

Definition at line 213 of file tcp-banger3.c.

References child_main_loop(), maxfd, pid, _thing::pid, _thing::rfd, and _thing::wfd.

Referenced by create_children().

static void create_children ( char *  argv[])
static

Definition at line 256 of file tcp-banger3.c.

References assert, create_a_thing(), debug, i, _thing::next, _thing::rfd, things, and _thing::wfd.

Referenced by main().

static void dispatch ( thing t,
char *  url 
)
static

Definition at line 298 of file tcp-banger3.c.

References assert, debug, _thing::pid, R1, _thing::rfd, _thing::state, _thing::url, URL_BUF_SZ, and _thing::wfd.

Referenced by parent_main_loop().

static thing* get_idle_thing ( void  )
static

Definition at line 285 of file tcp-banger3.c.

References _thing::next, _thing::state, and things.

Referenced by parent_main_loop().

static int get_url ( const char *  url)
static
int main ( int  argc,
char *  argv[] 
)

Definition at line 377 of file tcp-banger3.c.

References create_children(), i, maxfd, parent_main_loop(), and sig_child().

static void parent_main_loop ( void  )
static
char* parent_read_url ( void  )

Definition at line 273 of file tcp-banger3.c.

References buf, NULL, and URL_BUF_SZ.

Referenced by parent_main_loop().

static void read_reply ( thing t)
static

Definition at line 316 of file tcp-banger3.c.

References buf, i, now, NULL, R1, _thing::rfd, _thing::state, and _thing::url.

Referenced by parent_main_loop().

static void sig_child ( int  sig)
static

Definition at line 366 of file tcp-banger3.c.

References pid.

Referenced by main().

Variable Documentation

int maxfd = 0
static

Definition at line 100 of file tcp-banger3.c.

Referenced by create_a_thing(), main(), and parent_main_loop().

struct timeval now
static

Definition at line 101 of file tcp-banger3.c.

Referenced by read_reply().

fd_set R1
static

Definition at line 99 of file tcp-banger3.c.

Referenced by dispatch(), parent_main_loop(), and read_reply().

thing* things = NULL
static

Definition at line 98 of file tcp-banger3.c.

Referenced by create_children(), and get_idle_thing().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors