Re: Q: How to notify a policy router about on behalf of which client squid is making a request

From: Duane Wessels <wessels@dont-contact.us>
Date: Fri, 15 Oct 1999 15:47:07 -0600

On Sun, 10 Oct 1999, Christian Worm Mortensen wrote:

> Hi,
>
> I have a simple question:
>
> Suppose the following happens:
>
> 1) A local client reqeusts an object from the Squid server.
> The Squid server does not have the object in the cache.
> 2) The Squid server opens a TCP connection to the remote machine which has
> the object.
> 3) The Squid server retreviews the object from the remote machine
> 4) The Squid server delivers the object to the local client.
>
> Now, is it possible to insert a point between 1 and 2 saying:
>
> 1.5) The squid server sends an UDP (or any other) packet to IP adress
> W.X.Y.Z telling that the TCP connection that it is just about to open
> is made on behalf of the local client with IP adress A.B.C.D and MAC
> address ab:cd:ef:gh:ij:kl
>
> ?
>
> My rationale for wanting this is the following:
>
> I have developed a bandwidth distribution system for the Linux 2.2 kernels
> (see http://monitor.dkik.dk/wrr). The system is able to distribute
> bandwidth on a shared internet connection fairly between local
> machines. Now, I want this system to be useable together with a proxy server.
> And I want to account the trafic generated by the proxy server to the
> client which has initiated the trafic.
>
> Note that this accounting information is used to make a real-time
> distribution of bandwidth. So it is not enough just to look in the squid
> log files. I need to send a message to the bandwidth distribution system
> before the TCP connection is setup or at least before any significant
> amount of data has been transfered on it.
>
> If this is not directly possible I will be glad to receive hints on
> how it would be best to implement this in the Squid source code. Note
> that I have only very little experience in using Squid and no knowledge of
> the source code.

This should be possible to implement.

Probably the hardest part is getting the ethernet address. I think
there is not a good way to do it for all operating systems, but then
again I'm often wrong.

The function commConnectDnsHandle() in src/comm.c is probably
where you want to try this. Thats where Squid has the IP
address before calling connect(2).

Duane W.
Received on Fri Oct 15 1999 - 14:47:40 MDT

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