On Sun, Aug 10, 2025 at 7:04 PM Tom Beecher <[email protected]> wrote:
>> With these data structures you can:
>>
>> header = (struct ipv4_header*) byte_buffer;
>> printf ("Don't fragment bit is: %s\n", header->dont_fragment?"set":"unset");
>>
>> Not only is that code simple, the amount of work the CPU has to do to
>> execute that code is trivial.
>
>     df_status = s.getsockopt(socket.IPPROTO_IP, socket.IP_DONTFRAG)
>     print(f"Don't Fragment flag status: {df_status}")

Hi Tom,

We're not talking about the same thing. I'm talking about parsing
network packets. You're talking about the socket interface to
getsockopt(), long after the network stack has parsed them. If your
DNS needs are satisfied with getaddrinfo() you can do it as easily and
effectively in Python as C. Such use moves into the territory where
Python's advantages make it a good choice of programming language.

Regards,
Bill Herrin


-- 
William Herrin
[email protected]
https://bill.herrin.us/
_______________________________________________
NANOG mailing list 
https://lists.nanog.org/archives/list/[email protected]/message/GG4OGKQG6YEGWW3RPMGJEKX3JE6K5VYG/

Reply via email to