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

Go to the source code of this file.

Classes

struct  _f
 
struct  _request
 

Macros

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

Typedefs

typedef void() CB(int, void *)
 

Functions

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)
 

Variables

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

◆ CHANGE_FD_SETSIZE

#define CHANGE_FD_SETSIZE   1

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

◆ PROXY_ADDR

#define PROXY_ADDR   "127.0.0.1"

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

◆ PROXY_PORT

#define PROXY_PORT   3128

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

◆ READ_BUF_SZ

#define READ_BUF_SZ   4096

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

◆ RFC1123_STRFTIME

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

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

Typedef Documentation

◆ CB

typedef void() CB(int, void *)

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

Function Documentation

◆ fd_close()

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

◆ fd_open()

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

◆ free_request()

static void free_request ( struct _request r)
static

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

References free, and _request::url.

Referenced by reply_done(), and request().

◆ main()

◆ mkrfc1123()

char* mkrfc1123 ( time_t *  t)

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

References buf, and RFC1123_STRFTIME.

◆ read_reply()

◆ read_url()

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

◆ reply_done()

◆ request()

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, method, _request::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 Auth::UserRequest::AddReplyAuthHeader(), StoreEntry::adjustVary(), Ftp::Gateway::appendSuccessHeader(), assembleVaryKey(), Auth::UserRequest::authenticate(), AuthenticateAcl(), authenticateAuthenticateUser(), authTryGetUser(), Http::Tunneler::bailOnResponseError(), ConnStateData::BorrowPinnedConnection(), ConnStateData::borrowPinnedConnection(), Ssl::ErrorDetail::buildDetail(), ConnStateData::buildFakeRequest(), Http::One::Server::buildHttpRequest(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), Downloader::buildRequest(), Ftp::Gateway::buildTitleUrl(), HttpReply::calcMaxBodySize(), carpSelectParent(), Security::PeerConnector::checkForMissingCertificates(), Ssl::PeekingPeerConnector::checkForPeekAndSplice(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceGuess(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), Ftp::Gateway::checkUrlpath(), Adaptation::Icap::ModXact::clearError(), clientBeginRequest(), clientBuildError(), clientCheckPinning(), clientFollowXForwardedForCheck(), clientHierarchical(), clientInterpretRequestHeaders(), Adaptation::Ecap::XactionRep::clientIpValue(), clientProcessRequest(), clientProcessRequestFinished(), clientSetKeepaliveFlag(), copyOneHeaderFromClientsideRequestToUpstreamRequest(), Ipc::Forwarder::DequeueRequest(), Ipc::Inquirer::DequeueRequest(), Adaptation::Icap::ModXact::detailError(), Ipc::Forwarder::doneAll(), Ftp::Server::doProcessRequest(), Ssl::ErrorDetail::ErrorDetail(), HttpReply::expectedBodyTooLarge(), ConnStateData::fakeAConnectRequest(), FindListeningPortAddress(), Ftp::Relay::forwardPreliminaryReply(), Ftp::Gateway::ftpAuthRequired(), Ftp::Gateway::ftpRealm(), get_url(), getDefaultParent(), Ssl::ErrorDetailsManager::getErrorDetail(), getFirstUpParent(), GetMarkingsToServer(), GetNfmarkToServer(), getOutgoingAddress(), StoreEntry::getPublicByRequest(), StoreEntry::getPublicByRequestMethod(), getRoundRobinParent(), GetTosToServer(), getWeightedRoundRobinParent(), gopher_request_parse(), Ipc::Strand::handleCacheMgrRequest(), Ipc::Coordinator::handleCacheMgrRequest(), Ftp::Relay::handleControlReply(), Http::Tunneler::handleException(), Ssl::HandleGeneratorReply(), Rock::IoState::handleReadCompletion(), Http::Tunneler::handleReadyRead(), Ipc::Forwarder::handleRemoteAck(), Ipc::Inquirer::handleRemoteAck(), Ftp::Server::handleRequest(), Http::Tunneler::handleResponse(), Ipc::Coordinator::handleSearchRequest(), Ssl::PeekingPeerConnector::handleServerCertificate(), Ipc::Coordinator::handleSharedListenRequest(), Ipc::Strand::handleSnmpRequest(), Ipc::Coordinator::handleSnmpRequest(), Ftp::Server::handleUploadRequest(), Rock::SwapDir::handleWriteCompletionProblem(), Rock::SwapDir::handleWriteCompletionSuccess(), Http::Tunneler::handleWrittenRequest(), StoreEntry::hasIfMatchEtag(), StoreEntry::hasIfNoneMatchEtag(), Auth::UserRequest::helperRequestKeyExtras(), htcpClrStore(), httpFixupAuthentication(), httpHdrAdd(), httpHdrMangle(), httpHdrMangleList(), httpHeaderInitModule(), httpMakeVaryMark(), httpRequestPack(), Security::BlindPeerConnector::initialize(), Ssl::PeekingPeerConnector::initialize(), Security::PeerConnector::initialize(), ConnStateData::initiateTunneledRequest(), Ipc::Inquirer::inquire(), internalStart(), Auth::SchemeConfig::isCP1251EncodingAllowed(), TemplateFile::loadFor(), main(), Adaptation::Icap::ModXact::makeRequestHeaders(), Adaptation::Icap::ModXact::makeUsernameHeader(), Adaptation::Ecap::XactionRep::masterxSharedValue(), ACLAnnotateTransactionStrategy::match(), ACLAdaptationServiceStrategy::match(), ACLAnnotateClientStrategy::match(), ACLNoteStrategy::match(), Note::match(), Adaptation::Ecap::XactionRep::metaValue(), neighborsDigestSelect(), neighborsUdpPing(), netdbClosestParent(), Ssl::PeekingPeerConnector::noteNegotiationDone(), Security::PeerConnector::noteNegotiationError(), Ftp::Server::notePeerConnection(), Ipc::Coordinator::notifySearcher(), IpcIoFile::open(), Ipc::Coordinator::openListenSocket(), Adaptation::ServiceFilter::operator=(), CacheManager::ParseHeaders(), Adaptation::Icap::ModXact::parseIcapHead(), Ftp::Server::parseOneRequest(), ConnStateData::parseTlsHandshake(), CacheManager::ParseUrl(), peerAllowedToUse(), peerDigestLookup(), peerNoteDigestLookup(), peerSelect(), peerSelectIcpPing(), peerSourceHashSelectParent(), peerUserHashSelectParent(), peerWouldBePinged(), ConnStateData::pinBusyConnection(), ConnStateData::pinConnection(), ConnStateData::postHttpsAccept(), prepareLogWithRequestDetails(), Http::One::Server::processParsedRequest(), Ftp::Gateway::processReplyBody(), ConnStateData::quitAfterError(), DiskThreadsDiskFile::read(), Rock::IoState::read_(), read_url(), Rock::SwapDir::readCompleted(), DiskThreadsDiskFile::readDone(), HttpReply::receivedBodyTooLarge(), refreshCheck(), refreshCheckHTCP(), refreshCheckHTTP(), refreshCheckICP(), Ipc::Inquirer::requestTimedOut(), ResetMarkingsToServer(), Mgr::FunAction::respond(), Mgr::Action::respond(), Mgr::InfoAction::respond(), Ftp::Gateway::restartable(), schemesConfig(), Snmp::Forwarder::sendError(), Snmp::Inquirer::sendResponse(), SendSharedListenRequest(), ConnStateData::serveDelayedError(), Ssl::PeekingPeerConnector::serverCertificateVerified(), Ftp::Server::setDataCommand(), Http::One::Server::setReplyError(), ConnStateData::splice(), squidaio_cancel(), squidaio_debug(), squidaio_poll_done(), squidaio_queue_request(), squidaio_thread_loop(), Security::PeerConnector::sslCrtvdCheckForErrors(), Security::PeerConnector::sslCrtvdHandleReply(), Security::PeerConnector::sslFinalized(), Ipc::Inquirer::start(), Ipc::Forwarder::start(), CacheManager::start(), Adaptation::Iterator::start(), Http::Tunneler::start(), Adaptation::Ecap::XactionRep::start(), Ftp::Gateway::start(), Auth::UserRequest::start(), Security::PeerConnector::startCertDownloading(), ConnStateData::startPeekAndSplice(), PeerSelectionInitiator::startSelectingDestinations(), Ipc::Inquirer::status(), Adaptation::Iterator::step(), storeKeyPublicByRequest(), storeKeyPublicByRequestMethod(), Ssl::Helper::Submit(), Ssl::CertValidationHelper::Submit(), Ipc::Inquirer::swanSong(), Ipc::Forwarder::swanSong(), Http::Tunneler::swanSong(), Adaptation::Ecap::XactionRep::swanSong(), Security::PeerConnector::swanSong(), ConnStateData::switchToHttps(), Auth::UserRequest::tryToAuthenticateAndSetAuthUser(), ConnStateData::tunnelOnError(), Adaptation::Ecap::XactionRep::updateHistory(), UpdateRequestNotes(), Adaptation::Ecap::XactionRep::updateSources(), urlCanonicalFakeHttps(), Ftp::UrlWith2f(), Adaptation::Ecap::XactionRep::usernameValue(), varyEvaluateMatch(), Adaptation::Icap::ModXact::virginRequest(), Adaptation::Ecap::XactionRep::visitEachMetaHeader(), Rock::SwapDir::writeCompleted(), DiskThreadsDiskFile::writeDone(), Ftp::Server::writeErrorReply(), Http::Tunneler::writeRequest(), Ipc::Forwarder::~Forwarder(), and Adaptation::ServiceFilter::~ServiceFilter().

◆ sig_intr()

void sig_intr ( int  sig)

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

References fd_close(), and nfds.

Referenced by main().

◆ usage()

void usage ( void  )

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

References progname.

Referenced by main().

Variable Documentation

◆ custom_header

char* custom_header = NULL
static

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

Referenced by main(), and request().

◆ FD

struct _f FD[SQUID_MAXFD]

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

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

◆ lifetime

time_t lifetime = 60
static

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

Referenced by main().

◆ max_connections

int max_connections = 64
static

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

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

◆ maxfd

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

◆ nfds

◆ now

struct timeval now
static

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

Referenced by fd_open(), and main().

◆ nrequests

int nrequests
static

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

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

◆ opt_accel

int opt_accel = 0
static

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

Referenced by main(), and request().

◆ opt_checksum

int opt_checksum = 0
static

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

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

◆ opt_ims

int opt_ims = 0
static

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

Referenced by main(), and request().

◆ opt_range

int opt_range = 0
static

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

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

◆ process_lifetime

time_t process_lifetime = 86400
static

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

Referenced by main().

◆ progname

char* progname
static

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

Referenced by main(), and usage().

◆ proxy_addr

char* proxy_addr = PROXY_ADDR
static

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

Referenced by main(), and request().

◆ proxy_port

int proxy_port = PROXY_PORT
static

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

Referenced by main(), and request().

◆ reqpersec

int reqpersec
static

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

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

◆ total_bytes_read

long long total_bytes_read = 0
static

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

Referenced by main(), and read_reply().

◆ total_bytes_written

long long total_bytes_written = 0
static

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

Referenced by request().

◆ trace_file

FILE* trace_file = NULL

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

Referenced by main(), and reply_done().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors