[squid-users] Squid Source Code: What files/functions receive/send packets from/to hardware

Priya Agarwal priyaiitmandi at gmail.com
Fri Feb 6 07:27:21 UTC 2015


Hi,
I needed some direction again. I also need to know where in the source code
does squid open the network interface before it reads/writes from it.
Thanks.

Regards

On Tue, Jan 6, 2015 at 11:37 AM, Priya Agarwal <priyaiitmandi at gmail.com>
wrote:

> Thanks a lot. :)
> I'll sign up for squid-dev mailing list and do any further discussions
> there.
>
>
> On Tue, Jan 6, 2015 at 12:13 AM, Amos Jeffries <squid3 at treenet.co.nz>
> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 6/01/2015 6:01 a.m., Priya Agarwal wrote:
>> > Thank you for the reply.
>> >
>> > I do not intend to change its functionality. I just want to make it
>> > run on a processor (Freescale's T4240). For that it has to use some
>> > new architectural features (Data Path Acceleration Architecture)
>> > which are a part of the processor.
>> >
>> > For e.g. suppose squid was merely swapping ipv4/mac src and dest
>> > addresses( just an example! ) in the packet header and sends it
>> > back. So I don't want to change what it does, I just want squid to
>> > send whatever data it has prepared to a memory location. Basically
>> > instead of receiving and sending to OS Stack, I want to it read and
>> > write from memory.  (Further details : This memory is basically a
>> > memory-mapped device which is further responsible for transmitting
>> > the frame to a network interface, ethernet)
>> >
>> > So maybe if I could know where in the source code does it
>> > communicate with the OS stack.
>>
>> Ah, that kind of packet handling is all much, much lower level than Squid.
>>
>> Squid uses functions provided by the POSIX system API with socket
>> handles/"filedescriptors".
>>
>> http://man7.org/linux/man-pages/man7/socket.7.html
>> http://man7.org/linux/man-pages/man2/read.2.html
>> http://man7.org/linux/man-pages/man2/write.2.html
>>
>> The functions in src/fd.cc are where that happens, the lowest
>> networking-I/O level of Squid.
>>
>>
>> NP: If you want to take this further and/or discuss any other feature
>> additions/changes I encourage you to sign up to squid-dev mailing list
>> and discuss it with the whole dev team. This list is for general user
>> discussions, (though sometimes code talk from someone doing bug
>> investigations does slip in).
>>
>> Amos
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2.0.22 (MingW32)
>>
>> iQEcBAEBAgAGBQJUqts4AAoJELJo5wb/XPRjJu4IANCAhXt7PM48xHkERw/mz/sa
>> heSoEC7nJXaLpRz9JSq085UY2F0p55/GH0Gdh+XLq0h6kMLZB8qYTify0WMp18Jj
>> sfVOhuURZVdabS5ldW2ZrqftsqCt5eu3JvgHtQ+ewp8RhN5OI6OTQbCL9sf6llWY
>> Vqm1gno2IymyjcsuPYzpDv7sw7M3odJSETAD2eh6E3r+++uN1q5R4JZ7GZt5mgaE
>> tIJF0DyOlhAfAJIniCImZ0MDqWHLWjrzLWZRazHg4zA025TinDxkjy+qfHnjYfDc
>> oIFh9t/mtSbHPnBiZmsyUDOfl/wB0EOMuXEItoLGgBLh/71huVf2QRmfXUr6qS8=
>> =oajV
>> -----END PGP SIGNATURE-----
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20150206/f1910c1b/attachment.html>


More information about the squid-users mailing list