Re: how parsing works?

From: Robert Collins <robertc@dont-contact.us>
Date: 17 Feb 2003 17:28:27 +1100

On Mon, 2003-02-17 at 21:31, atit_ldce wrote:
> can u explain how pasring in squid works?

see cf_parser.h and cache_cf.cc.

> for e.g.
>
> i have following line in squid.conf
>
> acl normal_service_net src 10.0.0.0/255.255.255.0
> acl good_service_net src 10.0.1.0/255.255.255.0
> tcp_outgoing_address 10.0.0.1 normal_service_net
> tcp_outgoing_address 10.0.0.2 good_service_net
> tcp_outgoing_address 10.0.0.3
>
> for this how Config.accessList is manipulated
> and how Config.accesslist.outgoing_address is intialized.

the parser calls aclParseACLLine, which then creates new acls' as
needed.

outgoing address is initialised by it's own parser in a like fashion.
See cf.data.pre for the TYPE field, and from there look in cf_parser.h.

I think this is in the programmers guide - have you read it?

> also need explanation abt
>
> struct _acl {
> char name[ACL_NAME_SZ];
> squid_acl type;
> void *data;
> char *cfgline;
> acl *next;
> };
>
> what is purpose of data and cfgline in this struct.

data is used by the type-specific acl code, and cfgline is the first
line seen with this acl on it, for debug purposes.

> how this is related to struct _acl_ip_data struct

The acl IP matching code uses the acl data field to store it set of
acl_ip_data entries.

Rob

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Received on Sun Feb 16 2003 - 23:28:39 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:15 MST