#include "squid.h"
#include "util.h"
#include <cerrno>
#include <climits>
#include <csignal>
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "conffile.hh"
#include "convert.hh"
#include "copyout.hh"
#include "signal.hh"
#include "socket.hh"
#include "squid-tlv.hh"
Go to the source code of this file.
Classes | |
struct | REList |
Macros | |
#define | DEFAULTHOST "localhost" |
#define | DEFAULTPORT 3128 |
#define | LINESIZE 512 |
Functions | |
static char * | concat (const char *start,...) |
static bool | isxstring (const char *s, size_t testlen) |
int | log_output (const char *fn, int code, long size, const char *url) |
static int | log_extended (const char *fn, int code, long size, const SquidMetaList *meta) |
static bool | action (int fd, size_t metasize, const char *fn, const char *url, const SquidMetaList &meta) |
static bool | match (const char *fn, const REList *list) |
static bool | filelevel (const char *directory, const REList *list) |
static bool | dirlevel (const char *dirname, const REList *list, bool level=false) |
static int | checkForPortOnly (const char *arg) |
static void | helpMe (void) |
static void | parseCommandline (int argc, char *argv[], REList *&head, char *&conffile, char *©DirPath, struct in_addr &serverHostIp, unsigned short &serverHostPort) |
static void | exiter (void) |
static void | handler (int signo) |
static int | makelinebuffered (FILE *fp, const char *fn=nullptr) |
int | main (int argc, char *argv[]) |
Variables | |
volatile sig_atomic_t | term_flag = 0 |
char * | linebuffer = nullptr |
size_t | buffersize = 128*1024 |
static char * | copydir = nullptr |
static uint32_t | debugFlag = 0 |
static unsigned | purgeMode = 0 |
static bool | iamalive = false |
static bool | reminder = false |
static bool | verbose = false |
static bool | envelope = false |
static bool | no_fork = false |
static const char * | programname = nullptr |
static struct in_addr | serverHost |
static unsigned short | serverPort |
Macro Definition Documentation
◆ DEFAULTHOST
◆ DEFAULTPORT
◆ LINESIZE
#define LINESIZE 512 |
Function Documentation
◆ action()
|
static |
Definition at line 315 of file purge.cc.
References connectTo(), copy_out(), copydir, debugFlag, envelope, log_extended(), log_output(), purgeMode, reminder, serverHost, serverPort, size, sockfd, strerror(), and verbose.
Referenced by Mgr::Response::Response(), aclParseAccessLine(), Acl::Tree::add(), Mgr::CountersAction::add(), Mgr::InfoAction::add(), Mgr::IntervalAction::add(), Mgr::IoAction::add(), Mgr::ServiceTimesAction::add(), Mgr::StoreIoAction::add(), DiskdAction::add(), SBufStatsAction::add(), Acl::AllowOrDeny(), ACLChecklist::banAction(), ACLChecklist::bannedAction(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), CacheManager::CheckPassword(), dump_AuthSchemes(), dump_on_unsupported_protocol(), dump_sslproxy_ssl_bump(), CacheManager::findAction(), Mgr::Response::getAction(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Strand::handleCacheMgrRequest(), Mgr::Response::hasAction(), main(), match(), menu_url(), munge_action_line(), Mgr::Response::pack(), parse_AuthSchemes(), parse_on_unsupported_protocol(), parse_sslproxy_ssl_bump(), ParseAclWithAction(), Helper::ChildConfig::parseConfig(), CacheManager::ParseUrl(), CacheManager::PasswdGet(), read_reply(), Mgr::RegisterAction(), CacheManager::registerProfile(), Signal(), Mgr::ActionWriter::start(), Mgr::Filler::start(), CacheManager::start(), Mgr::Filler::swanSong(), TestCacheManager::testParseUrl(), TestCacheManager::testRegister(), and Acl::Tree::treeDump().
◆ checkForPortOnly()
|
static |
◆ concat()
|
static |
Definition at line 206 of file purge.cc.
References size.
Referenced by dirlevel(), and filelevel().
◆ dirlevel()
|
static |
Definition at line 536 of file purge.cc.
References concat(), debugFlag, dirlevel(), filelevel(), and strerror().
Referenced by dirlevel(), and main().
◆ exiter()
|
static |
◆ filelevel()
|
static |
Definition at line 496 of file purge.cc.
References assert, concat(), debugFlag, iamalive, isxstring(), match(), and strerror().
Referenced by dirlevel().
◆ handler()
|
static |
Definition at line 858 of file purge.cc.
References term_flag.
Referenced by callDialer(), cbdataDialer(), comm_add_close_handler(), comm_remove_close_handler(), commUpdateReadBits(), commUpdateWriteBits(), constructHelperQuery(), Mgr::FunAction::dump(), file_read(), file_write_mbuf(), fqdncache_nbgethostbyaddr(), Ftp::Server::handleReply(), Ftp::Server::handleRequest(), ipcache_nbgethostbyname(), ipcache_nbgethostbyname_(), kq_update_events(), main(), redirectStart(), StoreEntry::registerAbortCallback(), Mgr::RegisterAction(), CacheManager::registerProfile(), Comm::SetSelect(), Ipc::UdsOp::setTimeout(), Auth::UserRequest::start(), and storeIdStart().
◆ helpMe()
|
static |
Definition at line 591 of file purge.cc.
References DEFAULTHOST, DEFAULTPORT, and programname.
Referenced by parseCommandline().
◆ isxstring()
|
static |
Definition at line 239 of file purge.cc.
Referenced by filelevel().
◆ log_extended()
Definition at line 262 of file purge.cc.
References code, size, Store::STORE_META_KEY_MD5, Store::STORE_META_STD, Store::STORE_META_STD_LFS, and Store::STORE_META_URL.
◆ log_output()
◆ main()
Definition at line 887 of file purge.cc.
References assert, buffersize, convertHostname(), copydir, debugFlag, DEFAULTHOST, DEFAULTPORT, dirlevel(), exiter(), handler(), iamalive, linebuffer, makelinebuffered(), no_fork, parseCommandline(), readConfigFile(), serverHost, serverPort, Signal(), strerror(), xfree, and xstrdup.
◆ makelinebuffered()
|
static |
◆ match()
|
static |
Definition at line 402 of file purge.cc.
References action(), buffersize, debugFlag, head, linebuffer, log_extended(), log_output(), squidaio_request_t::next, purgeMode, reminder, size, Store::STORE_META_URL, strerror(), and verbose.
Referenced by Ssl::certificateMatchesProperties(), filelevel(), and TestSBuf::testGrow().
◆ parseCommandline()
|
static |
Definition at line 621 of file purge.cc.
References assert, assert_copydir(), checkForPortOnly(), convertHostname(), convertPortname(), REList::data, debugFlag, envelope, getopt(), head, helpMe(), iamalive, LINESIZE, REList::next, no_fork, optarg, opterr, port, programname, purgeMode, strerror(), verbose, xfree, and xstrdup.
Referenced by main().
Variable Documentation
◆ buffersize
size_t buffersize = 128*1024 |
Definition at line 146 of file purge.cc.
Referenced by copy_out(), main(), and match().
◆ copydir
|
static |
Definition at line 147 of file purge.cc.
Referenced by action(), assert_copydir(), copy_out(), and main().
◆ debugFlag
|
static |
Definition at line 148 of file purge.cc.
Referenced by action(), dirlevel(), filelevel(), main(), match(), and parseCommandline().
◆ envelope
|
static |
Definition at line 153 of file purge.cc.
Referenced by action(), and parseCommandline().
◆ iamalive
|
static |
Definition at line 150 of file purge.cc.
Referenced by filelevel(), main(), and parseCommandline().
◆ linebuffer
char* linebuffer = nullptr |
◆ no_fork
|
static |
Definition at line 154 of file purge.cc.
Referenced by main(), and parseCommandline().
◆ programname
|
static |
Definition at line 155 of file purge.cc.
Referenced by helpMe(), and parseCommandline().
◆ purgeMode
|
static |
Definition at line 149 of file purge.cc.
Referenced by action(), match(), and parseCommandline().
◆ reminder
|
static |
◆ serverHost
|
static |
◆ serverPort
|
static |
◆ term_flag
volatile sig_atomic_t term_flag = 0 |
◆ verbose
|
static |
Definition at line 152 of file purge.cc.
Referenced by action(), match(), and parseCommandline().