/*
- * $Id: acl.cc,v 1.159 1998/04/08 05:33:27 wessels Exp $
+ * $Id: acl.cc,v 1.160 1998/04/16 18:06:32 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
return ACL_DST_ASN;
if (!strcmp(s, "snmp_community"))
return ACL_SNMP_COMM;
+ if (!strcmp(s, "src_rtt"))
+ return ACL_NETDB_SRC_RTT;
#if USE_ARP_ACL
if (!strcmp(s, "arp"))
return ACL_SRC_ARP;
return "dst_as";
if (type == ACL_SNMP_COMM)
return "snmp_community";
+ if (type == ACL_NETDB_SRC_RTT)
+ return "src_rtt";
#if USE_ARP_ACL
if (type == ACL_SRC_ARP)
return "arp";
case ACL_URL_PORT:
case ACL_SRC_ASN:
case ACL_DST_ASN:
+ case ACL_NETDB_SRC_RTT:
aclParseIntlist(&A->data);
break;
case ACL_USER:
DOC_END
-NAME: cache_stoplist
-TYPE: wordlist
-DEFAULT: cgi-bin ?
-LOC: Config.cache_stoplist
+NAME: no_cache
+TYPE: acl_access
+DEFAULT: none
+LOC: Config.accessList.noCache
DOC_START
- A list of words which, if found in a URL, cause the object to
+ A list of ACL elements which, if matched, cause the reply to
immediately removed from the cache. In other words, use this
- to force certain objects to never be cached. You may list this
- option multiple times.
+ to force certain objects to never be cached.
- The default is to not cache URLs containing 'cgi-bin' or '?'.
+ There is no default. We recommend you uncomment the following
+ two lines.
-cache_stoplist cgi-bin ?
+acl QUERY urlpath_regex cgi-bin \?
+no_cache QUERY
DOC_END
-
NAME: cache_stoplist_pattern
TYPE: regexlist
LOC: Config.cache_stop_relist
/*
- * $Id: client_side.cc,v 1.277 1998/04/14 15:16:24 rousskov Exp $
+ * $Id: client_side.cc,v 1.278 1998/04/16 18:06:34 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
const char *url = http->uri;
request_t *req = http->request;
method_t method = req->method;
- const wordlist *p;
- for (p = Config.cache_stoplist; p; p = p->next) {
- if (strstr(url, p->key))
+ aclCheck_t ch;
+ memset(&ch, '\0', sizeof(ch));
+ /*
+ * Hopefully, nobody really wants 'no_cache' by client's IP
+ * address, but if they do, this should work if they use IP
+ * addresses in their ACLs, or if the client's address is in
+ * the FQDN cache.
+ *
+ * This may not work yet for 'dst' and 'dst_domain' ACLs.
+ */
+ ch.src_addr = http->conn->peer.sin_addr;
+ ch.request = http->request;
+ if (0 == aclCheckFast(Config.accessList.noCache, &ch))
return 0;
- }
if (Config.cache_stop_relist)
if (aclMatchRegex(Config.cache_stop_relist, url))
return 0;
char name[64];
int readView;
int writeView;
- struct _acl_access *acls;
- struct _communityEntry *next;
+ acl_access *acls;
+ communityEntry *next;
} communityEntry;
-typedef struct _usecEntry {
+typedef usecEntry {
u_char userName[32];
int userLen;
int qoS;
int noauthWriteView;
int authReadView;
int authWriteView;
- struct _usecEntry *next;
+ usecEntry *next;
} usecEntry;
#endif
squid_acl type;
void *data;
char *cfgline;
- struct _acl *next;
+ acl *next;
};
struct _acl_list {
int op;
- struct _acl *acl;
- struct _acl_list *next;
+ acl *acl;
+ acl_list *next;
};
struct _acl_access {
int allow;
- struct _acl_list *acl_list;
+ acl_list *acl_list;
char *cfgline;
- struct _acl_access *next;
+ acl_access *next;
};
struct _aclCheck_t {
- const struct _acl_access *access_list;
+ const acl_access *access_list;
struct in_addr src_addr;
struct in_addr dst_addr;
request_t *request;
struct _wordlist {
char *key;
- struct _wordlist *next;
+ wordlist *next;
};
struct _intlist {
int i;
- struct _intlist *next;
+ intlist *next;
};
struct _ushortlist {
u_short i;
- struct _ushortlist *next;
+ ushortlist *next;
};
struct _relist {
char *pattern;
regex_t regex;
- struct _relist *next;
+ relist *next;
};
struct _SquidConfig {
} Addrs;
size_t tcpRcvBufsz;
size_t udpMaxHitObjsz;
- wordlist *cache_stoplist;
wordlist *hierarchy_stoplist;
wordlist *mcast_group_list;
wordlist *dns_testname_list;
int mem_pools;
int test_reachability;
} onoff;
- struct _acl *aclList;
+ acl *aclList;
struct {
- struct _acl_access *http;
- struct _acl_access *icp;
- struct _acl_access *miss;
- struct _acl_access *NeverDirect;
- struct _acl_access *AlwaysDirect;
- struct _acl_access *ASlists;
+ acl_access *http;
+ acl_access *icp;
+ acl_access *miss;
+ acl_access *NeverDirect;
+ acl_access *AlwaysDirect;
+ acl_access *ASlists;
+ acl_access *noCache;
} accessList;
- struct _acl_deny_info_list *denyInfoList;
+ acl_deny_info_list *denyInfoList;
struct {
size_t list_width;
int list_wrap;
char *buf;
int len;
off_t buf_offset;
- struct _dwrite_q *next;
+ dwrite_q *next;
FREE *free_func;
};
struct _hash_link {
char *key;
- struct _hash_link *next;
+ hash_link *next;
void *item;
};
struct {
const char *method_str;
} private;
- struct _HierarchyLogEntry hier;
+ HierarchyLogEntry hier;
};
struct _clientHttpRequest {
int redirect_state;
aclCheck_t *acl_checklist; /* need ptr back so we can unreg if needed */
clientHttpRequest *next;
- struct _AccessLogEntry al;
+ AccessLogEntry al;
};
struct _ConnStateData {
struct _ipcache_entry {
/* first two items must be equivalent to hash_link */
char *name;
- struct _ipcache_entry *next;
+ ipcache_entry *next;
time_t lastref;
time_t expires;
ipcache_addrs addrs;
struct _fqdncache_entry {
/* first two items must be equivalent to hash_link */
char *name;
- struct _fqdncache_entry *next;
+ fqdncache_entry *next;
time_t lastref;
time_t expires;
unsigned char name_count;
struct _domain_ping {
char *domain;
int do_ping; /* boolean */
- struct _domain_ping *next;
+ domain_ping *next;
};
struct _domain_type {
char *domain;
peer_t type;
- struct _domain_type *next;
+ domain_type *next;
};
struct _Version {
u_short icp_port;
u_short http_port;
int icp_version;
- struct _domain_ping *pinglist;
- struct _domain_type *typelist;
- struct _acl_list *acls;
+ domain_ping *pinglist;
+ domain_type *typelist;
+ acl_list *acls;
int options;
int weight;
struct {
struct in_addr addresses[10];
int n_addresses;
int rr_count;
- struct _peer *next;
+ peer *next;
int ck_conn_event_pend;
int test_fd;
};
StoreEntry *entry; /* ptr to the parent StoreEntry, argh! */
int swapin_fd;
int disk_op_in_progress;
- struct _store_client *next;
+ store_client *next;
};
mem_hdr *data;
off_t inmem_hi;
off_t inmem_lo;
- struct _store_client *clients;
+ store_client *clients;
int nclients;
struct {
off_t queue_offset; /* relative to in-mem data */
struct _StoreEntry {
/* first two items must be same as hash_link */
const cache_key *key;
- struct _StoreEntry *next;
+ StoreEntry *next;
MemObject *mem_obj;
time_t timestamp;
time_t lastref;
size_t headers_sz;
char *body;
size_t body_sz;
- struct _HierarchyLogEntry hier;
+ HierarchyLogEntry hier;
err_type err_type;
};
struct _cachemgr_passwd {
char *passwd;
wordlist *actions;
- struct _cachemgr_passwd *next;
+ cachemgr_passwd *next;
};
struct _refresh_t {
time_t min;
int pct;
time_t max;
- struct _refresh_t *next;
+ refresh_t *next;
};
struct _CommWriteStateData {
char type;
int length;
void *value;
- struct _tlv *next;
+ tlv *next;
};
struct _storeSwapLogData {