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
