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

Go to the source code of this file.


struct  _f
struct  _request


#define PROXY_PORT   3128
#define PROXY_ADDR   ""
#define READ_BUF_SZ   4096
#define RFC1123_STRFTIME   "%a, %d %b %Y %H:%M:%S GMT"


typedef void( CB )(int, void *)


static void free_request (struct _request *r)
char * mkrfc1123 (time_t *t)
void fd_close (int fd)
void fd_open (int fd, CB *cb, void *data, CB *ccb)
void sig_intr (int sig)
void read_reply (int fd, void *data)
void reply_done (int fd, void *data)
struct _requestrequest (char *urlin)
void read_url (int fd, void *junk)
void usage (void)
int main (int argc, argv)


static int proxy_port = PROXY_PORT
static char * proxy_addr = PROXY_ADDR
static char * progname
static int reqpersec
static int nrequests
static int opt_ims = 0
static int opt_range = 0
static int opt_accel = 0
static int max_connections = 64
static time_t lifetime = 60
static time_t process_lifetime = 86400
static struct timeval now
static long long total_bytes_written = 0
static long long total_bytes_read = 0
static int opt_checksum = 0
static char * custom_header = NULL
FILE * trace_file = NULL
struct _f FD [SQUID_MAXFD]
int nfds = 0
int maxfd = 0

Macro Definition Documentation


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

#define PROXY_ADDR   ""

Definition at line 83 of file tcp-banger2.c.

#define PROXY_PORT   3128

Definition at line 82 of file tcp-banger2.c.

#define READ_BUF_SZ   4096

Definition at line 84 of file tcp-banger2.c.

Referenced by read_reply().

#define RFC1123_STRFTIME   "%a, %d %b %Y %H:%M:%S GMT"

Definition at line 140 of file tcp-banger2.c.

Referenced by mkrfc1123().

Typedef Documentation

typedef void( CB)(int, void *)

Definition at line 104 of file tcp-banger2.c.

Function Documentation

void fd_close ( int  fd)

Definition at line 153 of file tcp-banger2.c.

References _f::cb, _f::ccb, data, _f::data, FD, maxfd, nfds, and NULL.

Referenced by main(), read_reply(), read_url(), and sig_intr().

void fd_open ( int  fd,
CB cb,
void *  data,
CB ccb 

Definition at line 170 of file tcp-banger2.c.

References assert, _f::cb, _f::ccb, data, _f::data, FD, maxfd, nfds, now, and _f::start.

Referenced by main(), and read_url().

static void free_request ( struct _request r)

Definition at line 133 of file tcp-banger2.c.

References free, and _request::url.

Referenced by reply_done(), and request().

char* mkrfc1123 ( time_t *  t)

Definition at line 142 of file tcp-banger2.c.

References buf, and RFC1123_STRFTIME.

void read_url ( int  fd,
void *  junk 

Definition at line 436 of file tcp-banger2.c.

References buf, _request::fd, fd_close(), fd_open(), max_connections, nfds, NULL, read_reply(), reply_done(), and request().

Referenced by main().

struct _request* request ( char *  urlin)

Definition at line 291 of file tcp-banger2.c.

References assert, buf, _request::content_length, custom_header, _request::fd, free_request(), int, len, _request::method, method, mkrfc850(), NULL, opt_accel, opt_ims, opt_range, proxy_addr, proxy_port, _request::requestbodyfile, size, _request::status, total_bytes_written, _request::url, _request::validsize, _request::validstatus, _request::validsum, and xstrdup.

Referenced by StoreEntry::adjustVary(), Ftp::Gateway::appendSuccessHeader(), AuthenticateAcl(), Ssl::ErrorDetail::buildDetail(), ConnStateData::buildFakeRequest(), Http::One::Server::buildHttpRequest(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), Downloader::buildRequest(), Ftp::Gateway::buildTitleUrl(), carpSelectParent(), Ftp::Gateway::checkAuth(), Security::PeerConnector::checkForMissingCertificates(), Ssl::PeekingPeerConnector::checkForPeekAndSplice(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceGuess(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), Ftp::Gateway::checkUrlpath(), Adaptation::Icap::ModXact::clearError(), clientBeginRequest(), clientCheckPinning(), clientFollowXForwardedForCheck(), clientHierarchical(), clientInterpretRequestHeaders(), Adaptation::Ecap::XactionRep::clientIpValue(), clientProcessRequest(), clientSetKeepaliveFlag(), Ftp::Gateway::completedListing(), Ipc::Forwarder::DequeueRequest(), Ipc::Inquirer::DequeueRequest(), Adaptation::Icap::ModXact::detailError(), Ipc::Forwarder::doneAll(), Ftp::Server::doProcessRequest(), Ssl::ErrorDetail::ErrorDetail(), ConnStateData::fakeAConnectRequest(), FindListeningPortAddress(), Ftp::Relay::forwardPreliminaryReply(), Ftp::Gateway::ftpRealm(), get_url(), getDefaultParent(), getFirstUpParent(), getRoundRobinParent(), getWeightedRoundRobinParent(), Ftp::Relay::handleControlReply(), Ssl::HandleGeneratorReply(), Ipc::Forwarder::handleRemoteAck(), Ipc::Inquirer::handleRemoteAck(), Ssl::PeekingPeerConnector::handleServerCertificate(), Ftp::Server::handleUploadRequest(), htcpClrStore(), httpHeaderInitModule(), httpRequestPack(), Security::BlindPeerConnector::initialize(), Ssl::PeekingPeerConnector::initialize(), Security::PeerConnector::initialize(), ConnStateData::initiateTunneledRequest(), Ipc::Inquirer::inquire(), main(), Adaptation::Icap::ModXact::makeRequestHeaders(), Adaptation::Ecap::XactionRep::masterxSharedValue(), ACLAnnotateTransactionStrategy::match(), ACLAdaptationServiceStrategy::match(), ACLAnnotateClientStrategy::match(), ACLNoteStrategy::match(), Adaptation::Ecap::XactionRep::metaValue(), neighborsDigestSelect(), netdbClosestParent(), Ssl::PeekingPeerConnector::noteNegotiationDone(), Security::PeerConnector::noteNegotiationError(), Ftp::Server::notePeerConnection(), IpcIoFile::open(), Adaptation::ServiceFilter::operator=(), Adaptation::Icap::ModXact::parseIcapHead(), Ftp::Server::parseOneRequest(), ConnStateData::parseTlsHandshake(), CacheManager::ParseUrl(), peerAllowedToUse(), peerDigestLookup(), peerSelect(), peerSelectIcpPing(), peerSourceHashSelectParent(), peerUserHashSelectParent(), peerWouldBePinged(), ConnStateData::postHttpsAccept(), Http::One::Server::processParsedRequest(), Ftp::Gateway::processReplyBody(), read_url(), Rock::SwapDir::readCompleted(), Ipc::Inquirer::requestTimedOut(), ConnStateData::requestTimeout(), Ftp::Gateway::restartable(), SendSharedListenRequest(), ConnStateData::serveDelayedError(), Ssl::PeekingPeerConnector::serverCertificateVerified(), Ftp::Server::setDataCommand(), ConnStateData::splice(), squidaio_cancel(), squidaio_poll_done(), squidaio_queue_request(), squidaio_thread_loop(), Security::PeerConnector::sslCrtvdCheckForErrors(), Security::PeerConnector::sslCrtvdHandleReply(), Security::PeerConnector::sslFinalized(), Ipc::Inquirer::start(), Ipc::Forwarder::start(), Adaptation::Iterator::start(), Adaptation::Ecap::XactionRep::start(), Ftp::Gateway::start(), Security::PeerConnector::startCertDownloading(), ConnStateData::startPeekAndSplice(), Ipc::Inquirer::status(), Adaptation::Iterator::step(), Ssl::Helper::Submit(), Ipc::Inquirer::swanSong(), Ipc::Forwarder::swanSong(), Adaptation::Ecap::XactionRep::swanSong(), Security::PeerConnector::swanSong(), Adaptation::Ecap::XactionRep::updateHistory(), Adaptation::Ecap::XactionRep::updateSources(), Adaptation::Ecap::XactionRep::usernameValue(), Adaptation::Icap::ModXact::virginRequest(), Adaptation::Ecap::XactionRep::visitEachMetaHeader(), Rock::SwapDir::writeCompleted(), Ftp::Server::writeErrorReply(), Ipc::Forwarder::~Forwarder(), and Adaptation::ServiceFilter::~ServiceFilter().

void sig_intr ( int  sig)

Definition at line 183 of file tcp-banger2.c.

References fd_close(), and nfds.

Referenced by main().

void usage ( void  )

Definition at line 462 of file tcp-banger2.c.

References progname.

Referenced by main().

Variable Documentation

char* custom_header = NULL

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

Referenced by main(), and request().

struct _f FD[SQUID_MAXFD]

Definition at line 128 of file tcp-banger2.c.

Referenced by fd_close(), fd_open(), and main().

time_t lifetime = 60

Definition at line 95 of file tcp-banger2.c.

Referenced by main().

int max_connections = 64

Definition at line 94 of file tcp-banger2.c.

Referenced by Adaptation::Icap::Options::configure(), main(), and read_url().

int maxfd = 0

Definition at line 130 of file tcp-banger2.c.

Referenced by comm_check_incoming_select_handlers(), fd_close(), fd_open(), and main().

struct timeval now

Definition at line 97 of file tcp-banger2.c.

Referenced by fd_open(), and main().

int nrequests

Definition at line 90 of file tcp-banger2.c.

Referenced by main(), main_loop(), and read_reply().

int opt_accel = 0

Definition at line 93 of file tcp-banger2.c.

Referenced by main(), and request().

int opt_checksum = 0

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

Referenced by main(), read_reply(), and reply_done().

int opt_ims = 0

Definition at line 91 of file tcp-banger2.c.

Referenced by main(), and request().

int opt_range = 0

Definition at line 92 of file tcp-banger2.c.

Referenced by main(), reply_done(), and request().

time_t process_lifetime = 86400

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

Referenced by main().

char* progname

Definition at line 88 of file tcp-banger2.c.

Referenced by main(), and usage().

char* proxy_addr = PROXY_ADDR

Definition at line 87 of file tcp-banger2.c.

Referenced by main(), and request().

int proxy_port = PROXY_PORT

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

Referenced by main(), and request().

int reqpersec

Definition at line 89 of file tcp-banger2.c.

Referenced by main(), main_loop(), and read_reply().

long long total_bytes_read = 0

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

Referenced by main(), and read_reply().

long long total_bytes_written = 0

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

Referenced by request().

FILE* trace_file = NULL

Definition at line 102 of file tcp-banger2.c.

Referenced by main(), and reply_done().






Web Site Translations