Re: HIT/MISS Packet marking (new squid developer)

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 22 Mar 2003 18:17:13 +0100

Daniel Draper wrote:

> My name is Daniel Draper and I am currently working on a project that
> involves squid as one of its core components. The problem is I need
> squid to be able to mark tcp packets with a HIT or MISS flag so I can
> control bandwidth and IP accounting. From what I have seen this feature
> could be useful to many people.
>
> I've decided to attempt to write this feature myself but need some
> advice on where to start. I don't fully understand the internal
> operation of squid.

To have Squid mark packets with a suitable ToS/DS value you will need to
modify client_side to have it call setsockopt() to set the TOS (see
comm_openex in Squid for an example).

A suitable point in time where to set the TOS would be when preparing to
send the reply headers. ClientSocketContext::sendStartOfMessage in HEAD,
or clientSendMoreData in 2.5, somewhere around the call to
httpReplyPack, or somewhere around the http_reply_access control (where
Config.access.reply is used).

Regards
Henrik
Received on Sat Mar 22 2003 - 10:22:21 MST

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